Information enumeration method, device, equipment and readable storage medium

Through the enumeration script automatically calculates the bus number and allocates storage space, the problem of low information enumeration efficiency in the simulation system is solved, and fast information enumeration and simulation cycle shortening are achieved.

CN113850036BActive Publication Date: 2025-08-12SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110997816.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-27
Publication Date
2025-08-12
Estimated Expiration
2041-08-27

AI Technical Summary

Technical Problem

The existing simulation systems are inefficient when enumerating information on DUT, resulting in extended simulation verification cycles, especially when the DUT information changes, which requires repeated enumeration, which increases the time.

Method used

The enumeration script obtains the number of uplink ports, downlink ports and device attribute information of the DUT, calculates the bus number, and automatically allocates storage space to fill the template file to achieve automatic generation of information enumeration results.

Benefits of technology

Improves the efficiency of information enumeration, reduces the enumeration time and simulation cycle, and repeats the script only when the DUT information changes, without the need to modify the relevant information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113850036B_ABST
    Figure CN113850036B_ABST
Patent Text Reader

Abstract

The present application discloses an information enumeration method, apparatus, device and readable storage medium. The enumeration script in the present application obtains the number of uplink ports and downlink ports of the DUT, the range of the storage space required for simulation verification, the device attribute information and functional attribute information of the DUT and each device connected to the DUT; the above-mentioned devices are used as devices to be configured, and the bus number of each device to be configured is calculated based on the number of uplink ports and downlink ports; the storage space is then allocated to each device to be configured, and the allocation result is recorded; finally, the preset template file is filled in according to the above-mentioned various information, thereby obtaining the information enumeration result for simulating the DUT. This process is automatically executed by the enumeration script, and there is no need for the simulation system to perform a lengthy enumeration process, so it can improve the efficiency of information enumeration and reduce the enumeration time and simulation cycle. The information enumeration device, equipment and readable storage medium provided by the present application also have the above-mentioned technical effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of chip verification and testing technology, and in particular to an information enumeration method, apparatus, device, and readable storage medium. Background Art

[0002] Currently, before a simulation system can perform simulation verification on a DUT (Design Under Test), it must frequently read and write data to obtain all of the DUT's information. This process consumes a significant portion of the simulation time. If the DUT's information changes, the simulation system must repeat the above process to enumerate and obtain the information again. This significantly increases the time required to obtain information, resulting in long and inefficient information acquisition and a prolonged simulation verification cycle.

[0003] Therefore, how to improve the efficiency of information enumeration is a problem that those skilled in the art need to solve. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide an information enumeration method, apparatus, device and readable storage medium to improve the efficiency of information enumeration. The specific scheme is as follows:

[0005] In a first aspect, the present application provides an information enumeration method, which is applied to enumeration scripts, comprising:

[0006] Obtaining target information specified by the user; the target information includes: the number of uplink ports and downlink ports of the DUT, the range of storage space required for simulation verification, device attribute information and functional attribute information corresponding to the DUT and each device connected to the DUT;

[0007] The DUT and each device connected to the DUT are regarded as devices to be configured, and a bus number corresponding to each device to be configured is calculated based on the number of upstream ports and the number of downstream ports;

[0008] Allocating the storage space to each device to be configured and recording the allocation result;

[0009] A preset template file is filled according to the target information, the bus number corresponding to each device to be configured, and the allocation result to obtain an information enumeration result for simulating the DUT.

[0010] Preferably, the acquiring of target information specified by the user includes:

[0011] Receive the target information input by the user based on the human-computer interaction interface.

[0012] Preferably, the calculating the bus number corresponding to each device to be configured based on the number of uplink ports and the number of downlink ports includes:

[0013] Determining an RC device connected to the upstream port of the DUT based on the number of upstream ports;

[0014] Determining an EP device connected to the downstream port of the DUT based on the number of downstream ports;

[0015] Calculate the bus numbers corresponding to the DUT, the RC device, and the EP device respectively.

[0016] Preferably, allocating the storage space to each device to be configured and recording the allocation result includes:

[0017] The storage space is evenly distributed to each device to be configured, and the distribution result is recorded.

[0018] Preferably, allocating the storage space to each device to be configured and recording the allocation result includes:

[0019] The storage space is randomly allocated to each device to be configured using a random function, and the allocation result is recorded.

[0020] Preferably, after obtaining the information enumeration result for simulating the DUT, the method further includes:

[0021] Visually display the information enumeration results of the DUT.

[0022] Preferably, after obtaining the information enumeration result for simulating the DUT, the method further includes:

[0023] The simulation system is set up according to the information enumeration result, so as to simulate the DUT using the simulation system.

[0024] In a second aspect, the present application provides an information enumeration device, which is applied to enumerate scripts, including:

[0025] An acquisition module is configured to acquire target information specified by a user; the target information includes: the number of uplink ports and downlink ports of the DUT, the range of storage space required for simulation verification, and device attribute information and functional attribute information corresponding to the DUT and each device connected to the DUT;

[0026] a calculation module, configured to treat the DUT and each device connected to the DUT as a device to be configured, and calculate a bus number corresponding to each device to be configured based on the number of uplink ports and the number of downlink ports;

[0027] an allocation module, configured to allocate the storage space to each device to be configured and record the allocation result;

[0028] A filling module is used to fill a preset template file according to the target information, the bus number corresponding to each device to be configured and the allocation result to obtain an information enumeration result for simulating the DUT.

[0029] In a third aspect, the present application provides an electronic device, comprising:

[0030] memory for storing computer programs;

[0031] A processor is used to execute the computer program to implement the aforementioned disclosed information enumeration method.

[0032] In a fourth aspect, the present application provides a readable storage medium for storing a computer program, wherein the computer program implements the aforementioned disclosed information enumeration method when executed by a processor.

[0033] It can be seen from the above scheme that the present application provides an information enumeration method, which is applied to the enumeration script, including: obtaining target information specified by the user; the target information includes: the number of upstream ports and the number of downstream ports of the DUT, the range of the storage space required for simulation verification, the device attribute information and functional attribute information corresponding to the DUT and each device connected to the DUT; the DUT and each device connected to the DUT are regarded as devices to be configured, and the bus number corresponding to each device to be configured is calculated based on the number of upstream ports and the number of downstream ports; the storage space is allocated to each device to be configured, and the allocation result is recorded; according to the target information, the bus number corresponding to each device to be configured and the allocation result, a preset template file is filled to obtain the information enumeration result for simulating the DUT.

[0034] It can be seen that the enumeration script in this application obtains the number of uplink ports and downlink ports of the DUT specified by the user, the range of the storage space required for simulation verification, the device attribute information and functional attribute information corresponding to the DUT and each device connected to the DUT; first calculates the bus number corresponding to each device to be configured based on the number of uplink ports and downlink ports; then allocates storage space to each device to be configured and records the allocation result; finally, fills the preset template file based on all the information specified by the user, the bus number of each device to be configured automatically determined by the script, and the allocation result, thereby obtaining the information enumeration result for simulating the DUT. This process is automatically executed by the enumeration script, which can automatically fill all the information that needs to be enumerated into the template file, thereby automatically obtaining the information enumeration result of the DUT, thereby improving the efficiency of information enumeration. If the relevant information of the DUT changes, the user only needs to modify the relevant information and repeat the enumeration script according to this application. There is no need for the simulation system to perform a lengthy enumeration process, thus reducing the enumeration time and simulation cycle.

[0035] Correspondingly, the information enumeration device, equipment and readable storage medium provided by this application also have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0037] Figure 1 This is a flow chart of an information enumeration method disclosed in this application;

[0038] Figure 2 A schematic diagram of a DUT disclosed in this application;

[0039] Figure 3 This is a schematic diagram of an information enumeration device disclosed in this application;

[0040] Figure 4 A schematic diagram of an electronic device disclosed in this application;

[0041] Figure 5 A schematic diagram of a template file disclosed in this application;

[0042] Figure 6 This is a schematic diagram of a structure tree disclosed in this application. DETAILED DESCRIPTION

[0043] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0044] At present, before the simulation system performs simulation verification on the DUT, it is necessary to frequently read and write the DUT to obtain all the information of the DUT, but this process will take up most of the simulation time. If the relevant information of the DUT changes, the simulation system will need to repeat the above process to enumerate and obtain the information again. In this way, the time consumed in obtaining information is greatly increased, resulting in a long time and low efficiency for obtaining information, which prolongs the cycle of simulation verification. To this end, the present application provides an information enumeration scheme that can improve the efficiency of information enumeration and reduce the enumeration time and simulation cycle.

[0045] The simulation system frequently reads and writes to the DUT to obtain all the information about the DUT, including the following:

[0046] Run test cases in full enumeration mode in the simulation system, perform enumeration according to standard protocols (such as PCIe), and record the obtained DUT physical structure and device information.

[0047] The execution steps of the complete enumeration mode of the simulation system are as follows:

[0048] A. Read the base address register of the DUT, starting at offset 10h, to determine the memory space region and memory size requirements for this physical function.

[0049] B. Read the capability pointer of the protocol to access the standard device function and extended function registers supported by the physical function using the PCIe linked list structure.

[0050] C. Read the complete list of capabilities in the configuration space registers (used to record the device's own, upstream, and downstream information) by traversing the nodes of the linked list. If the device supports SR-IOV, the enumeration process follows the SR-IOV capability method. SR-IOV defines a set of lightweight PCIe virtual functions that share one or more physical resources in a device with the device's physical functions.

[0051] D. The emulation system begins configuring the device and writes a series of information required for enumeration. For example, it initializes the BAR addresses for all physical and virtual functions based on memory requirements. It also initializes various device features, such as power management, maximum payload size, maximum read request size, and read completion boundaries. It enables the device's bus mastering capabilities to initiate transactions on the PCIe bus. It also initializes the MSI / MSI-X address for the device.

[0052] E. Wait for all test cases to finish running. At this time, the simulation system can obtain all the information of the DUT, including the physical structure and device information of the DUT, which is generally recorded in text files.

[0053] See also Figure 1 As shown, the embodiment of the present application discloses an information enumeration method, which is applied to enumeration scripts, including:

[0054] S101. Obtain target information specified by the user; the target information includes: the number of uplink ports and downlink ports of the DUT, the range of storage space required for simulation verification, device attribute information and functional attribute information corresponding to the DUT and each device connected to the DUT.

[0055] Specifically, the user may specify the target information by inputting a command line, or may select or input the target information through a web page. Therefore, in a specific embodiment, obtaining the target information specified by the user includes: receiving the target information input by the user based on the human-computer interaction interface.

[0056] If the DUT is a Switch device, the devices connected to the Switch device can be RC (Root Complex) devices and EP (End Point) devices. Switch devices, RC devices, and EP devices can all be PCIe (Peripheral Component Interconnect express, a high-speed serial computer expansion bus standard) devices. Among them, the Switch device is a transfer bridge used to connect the RC device and the EP device. The EP device is an endpoint device and therefore has no downstream connection line. For details, please refer to Figure 2 .

[0057] Among them, the range of storage space required for simulation verification can be expressed by the starting address and address length. The device attribute information and functional attribute information corresponding to the Switch device, RC device, and EP device respectively depend on whether the current device is a DUT hardware module or a VIP (Verify Intellectual Property, verified IP module). If the current device is a DUT hardware module, the device attribute information and functional attribute information of the current device are determined by the fixed attributes of the DUT. If the current device is a VIP, the device attribute information and functional attribute information of the current device are determined by the configurable attributes of the VIP. Both the device attribute information and the functional attribute information can be freely specified by the user. The device attribute information can specifically include the device number (Device number) and the corresponding attribute information.

[0058] exist Figure 2 In the example, the Switch device is the DUT, which includes three Bridge nodes: one Bridge connected to the RC device and two Bridges connected to the EP device. When the Switch device includes multiple Bridges, each Bridge also has a corresponding bus number.

[0059] S102: The DUT and each device connected to the DUT are regarded as devices to be configured, and a bus number corresponding to each device to be configured is calculated based on the number of uplink ports and the number of downlink ports.

[0060] In a specific embodiment, a bus number corresponding to each device to be configured is calculated based on the number of uplink ports and the number of downlink ports, including: determining an RC device connected to the uplink port of the DUT based on the number of uplink ports; determining an EP device connected to the downlink port of the DUT based on the number of downlink ports; and calculating the bus numbers corresponding to the DUT, the RC device, and the EP device, respectively.

[0061] Calculating the bus numbers corresponding to the DUT, RC device, and EP device respectively includes: constructing a structure tree based on the DUT, RC device, and EP device, and traversing the structure tree in depth first to determine the bus number of each device one by one.

[0062] If the DUT is Figure 2 For the Switch device shown in the figure, the bus number corresponding to the DUT is the bus number corresponding to the three Bridges.

[0063] by Figure 2 The DUT shown (i.e. Figure 2For example, the Switch device has one uplink port, sw_up_port0, and two downlink ports, sw_dn_port0 and sw_dn_port1. The bus numbers corresponding to each device to be configured (including three Bridges, one RC, and two EPs) are as follows:

[0064] For Bridge connected to RC devices (ie: Figure 2 For device0 in the Switch, its upstream bus number sw_up_port0.primary_bus_number = 0, corresponding to Figure 2 bus0 in the downstream bus number sw_up_port0.secondary_bus_number=1, corresponding to Figure 2 bus1 in the downstream; the bus number sw_up_port0.subordinate_bus_number = 3, corresponding to Figure 2 bus3 in.

[0065] For Bridge ( Figure 2 For device1 in the Switch, its upstream bus number is sw_dn_port0.primary_bus_number=1, corresponding to Figure 2 bus1 in the downstream bus number sw_dn_port0.secondary_bus_number = 2, corresponding to Figure 2 bus2 in the downstream; the bus number of the farthest end sw_dn_port0.subordinate_bus_number = 2, corresponding to Figure 2 bus2 in.

[0066] For another Bridge connected to the EP device ( Figure 2 For device2 in the Switch, its upstream bus number is sw_dn_port1.primary_bus_number=1, corresponding to Figure 2 bus1 in the downstream bus number sw_dn_port1.secondary_bus_number=3, corresponding to Figure 2 bus3 in the downstream; the bus number of the farthest end sw_dn_port1.subordinate_bus_number = 3, corresponding to Figure 2 bus3 in.

[0067] For the RC device connected to the Switch, there is no bus upstream, so the upstream bus number rc0.primary_bus_number = null; the downstream bus number rc0.secondary_bus_number = 0, corresponding to Figure 2 bus0 in the downstream; the bus number rc0.subordinate_bus_number is 3, corresponding to Figure 2 bus3 in.

[0068] For the EP0 device connected to the Switch, its upstream bus number ep0.primary_bus_number = 2, corresponding to Figure 2 bus2 in it; it has no downstream bus and farthest bus, so ep0.secondary_bus_number = null; ep0.subordinate_bus_number = null.

[0069] For the EP1 device connected to the Switch, its upstream bus number ep1.primary_bus_number = 3, corresponding to Figure 2 bus3 in it; it has no downstream bus and farthest bus, so ep1.secondary_bus_number = null; ep1.subordinate_bus_number = null.

[0070] So far, Figure 2 The bus numbers corresponding to all the devices to be configured have been calculated. As can be seen from the above, any device to be configured needs to record the upstream bus number (Primary Bus Number), downstream bus number (Secondary Bus Number), and the most distant bus number (Subordinate Bus Number).

[0071] S103: Allocate storage space to each device to be configured, and record the allocation result.

[0072] In a specific implementation, allocating storage space to each device to be configured and recording the allocation result includes: evenly allocating storage space to each device to be configured and recording the allocation result.

[0073] In a specific implementation, allocating storage space to each device to be configured and recording the allocation result includes: utilizing a random function to randomly allocate storage space to each device to be configured and recording the allocation result.

[0074] S104: Fill in a preset template file according to the target information, the bus number corresponding to each device to be configured, and the allocation result to obtain an information enumeration result for simulating the DUT.

[0075] Each device to be configured can correspond to at least one function, and the corresponding information is recorded in the device's function attribute information. A template file can pre-set all the functions supported by common devices. This allows users to select and record the corresponding functions for each device to be configured based on the template file. Supported functions can be set to 1, and unsupported functions can be set to 0, allowing the enumeration script to identify the functions of each device to be configured.

[0076] Each function can be represented by a number, so the function number can be used to record the functions supported by the device. Figure 2 As shown in the figure, the three functions supported by EP0 are recorded as: Function0, 1, 2; the three functions supported by EP1 are recorded as: Function0, 1, 2. The functions represented by "0, 1, 2" can be defined in the template file in advance.

[0077] It should be noted that the function number, device number, and bus number are device ID resources that can be used to locate the device's position within the entire structure. Generally speaking, the function number can be considered as function attribute information, and the device number can be considered as device attribute information.

[0078] In a specific implementation, after obtaining the information enumeration result for simulating the DUT, the method further includes: visually displaying the information enumeration result of the DUT.

[0079] In one specific embodiment, after obtaining the information enumeration results for simulating the DUT, the method further includes: configuring the simulation system according to the information enumeration results, so as to simulate the DUT using the simulation system. As can be seen, the simulation system can recognize the file format of the information enumeration results and directly configure the file contents into the simulation system through the backdoor, thereby accelerating the simulation process.

[0080] It can be seen that the enumeration script in this embodiment obtains the number of uplink ports and downlink ports of the DUT specified by the user, the range of storage space required for simulation verification, and the device attribute information and functional attribute information corresponding to each device to be configured; first, the bus number corresponding to each device to be configured is calculated based on the number of uplink ports and downlink ports; then the storage space is allocated to each device to be configured, and the allocation result is recorded; finally, the preset template file is filled according to all the information specified by the user, the bus number corresponding to each device to be configured and the allocation result automatically determined by the script, thereby obtaining the information enumeration result for simulating the DUT. This process is automatically executed by the enumeration script, and all the information that needs to be enumerated can be automatically filled into the template file, thereby automatically obtaining the information enumeration result of the DUT, thereby improving the efficiency of information enumeration. If the relevant information of the DUT changes, the user only needs to modify the relevant information and repeat the enumeration script according to this application. There is no need for the simulation system to perform a lengthy enumeration process, thus reducing the enumeration time and simulation cycle.

[0081] An information enumeration device provided in an embodiment of the present application is introduced below. The information enumeration device described below and the information enumeration method described above can be referenced to each other.

[0082] See also Figure 3 As shown, the embodiment of the present application discloses an information enumeration device, which is applied to enumerate scripts, including:

[0083] The acquisition module 301 is used to obtain target information specified by the user; the target information includes: the number of uplink ports and downlink ports of the DUT, the range of storage space required for simulation verification, and device attribute information and functional attribute information corresponding to the DUT and each device connected to the DUT;

[0084] A calculation module 302 is configured to treat the DUT and each device connected to the DUT as a device to be configured, and calculate a bus number corresponding to each device to be configured based on the number of uplink ports and the number of downlink ports;

[0085] Allocation module 303, used to allocate storage space to each device to be configured and record the allocation result;

[0086] The filling module 304 is used to fill the preset template file according to the target information, the bus number corresponding to each device to be configured, and the allocation result, so as to obtain the information enumeration result for simulating the DUT.

[0087] In a specific embodiment, the acquisition module is specifically used to:

[0088] Receive target information input by the user based on the human-computer interaction interface.

[0089] In a specific embodiment, the calculation module is specifically used to:

[0090] Determine the RC device connected to the upstream port of the DUT based on the number of upstream ports;

[0091] Determine the EP device connected to the downstream port of the DUT based on the number of downstream ports;

[0092] Calculate the bus numbers corresponding to the DUT, RC device, and EP device respectively.

[0093] In a specific embodiment, the allocation module is specifically configured to:

[0094] Allocate storage space evenly to each device to be configured and record the allocation results.

[0095] or

[0096] Use the random function to randomly allocate storage space to each device to be configured, and record the allocation results.

[0097] In a specific embodiment, it also includes:

[0098] The display module is used to visually display the DUT information enumeration results.

[0099] In a specific embodiment, after obtaining the information enumeration result for simulating the DUT, the method further includes:

[0100] The simulation module is used to make settings in the simulation system according to the information enumeration result, so as to simulate the DUT using the simulation system.

[0101] Among them, for more specific working processes of each module and unit in this embodiment, reference can be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0102] It can be seen that this embodiment provides an information enumeration device, which can improve the efficiency of information enumeration and reduce the enumeration time and simulation cycle.

[0103] An electronic device provided in an embodiment of the present application is introduced below. The electronic device described below and the information enumeration method and device described above can be referenced to each other.

[0104] See also Figure 4 As shown, the embodiment of the present application discloses an electronic device, including:

[0105] Memory 401, used for storing computer programs;

[0106] The processor 402 is configured to execute the computer program to implement the method disclosed in any of the above embodiments.

[0107] A readable storage medium provided in an embodiment of the present application is introduced below. The readable storage medium described below and the information enumeration method, apparatus, and device described above can be referenced to each other.

[0108] A readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the information enumeration method disclosed in the aforementioned embodiment. The specific steps of the method can be referred to the corresponding contents disclosed in the aforementioned embodiment and will not be repeated here.

[0109] The following takes the DUT that complies with the PCIe standard as an example to introduce the enumeration script and the corresponding template file in detail.

[0110] This embodiment can use enumeration scripts and template files to generate a complete PCIe resource information file (i.e., the information enumeration result of the simulated DUT), and configure it into the simulation system through a backdoor, thereby omitting the enumeration process through the simulation system and saving simulation time.

[0111] In a PCIe system, each PCIe device possesses three types of resources: ID resources, which identify the device within the system and identify it, defined by three variables: Bus number, Device number, and Function number; Memory resources, which define the device's memory available for external or internal use; and I / O resources, which define the device's available I / O space. These three resources enable PCIe devices to be accessed and used. Memory and I / O resources require user-configured base address registers.

[0112] The template file can be designed based on an enumeration information file, including fixed and variable information locations. Fixed information can include parameter names, such as function names, device attribute names, such as dev_type, bus_num, sec_bus, sub_bus, vendor_id, device_id, ARI_sup, SRIOV_sup, and resource configuration values. Variable information refers to the values of various parameters, specifically the specific values corresponding to the fixed information.

[0113] From this we can see that before filling the template file, the template file only has fixed information. After filling, the specific values corresponding to the fixed information will be filled in it. Figure 5 , Figure 5 The column on the left is the fixed information, and the column on the right is the corresponding parameter value.

[0114] The enumeration script directly fills in single, non-repeating content in the template. For content with repetitive patterns, loop statements are defined in the template to keep the template content concise. In this way, the enumeration script can expand these loop statements to complete the repeated filling and obtain a PCIe resource information file that complies with the PCIe standard.

[0115] The process of enumerating scripts to determine various parameter values includes:

[0116] 1. Determination of bus number.

[0117] Determine the device connected to the DUT based on its upstream and downstream ports, so that the enumeration script can determine the device connected to the DUT. Figure 6 The structure tree shown in FIG. 1 is used, and a depth-first traversal is performed based on the structure tree to determine the bus number of each device one by one.

[0118] The Bridge in the structure tree may have more Bridges or EP devices mounted downstream, so the Primary Bus Number, Secondary Bus Number, and Subordinate Bus Number need to be calculated. The Primary Bus Number indicates the upstream Bus number to which the device is connected, the Secondary Bus Number indicates the downstream Bus number to which the device is connected, and the Subordinate Bus Number indicates the furthest downstream Bus number accessible to the device.

[0119] For the EP device in the structure tree, since it is already the end of the bus connection and there are no other devices downstream of it, only its Primary Bus Number can be calculated.

[0120] RC devices in the structure tree generally have no upstream, so only the Secondary Bus Number and Subordinate Bus Number can be calculated.

[0121] The bus numbers of each device in a structure tree are calculated and determined in sequence according to the PCIe standard. Figure 6 As shown, the bus to which RC is connected is numbered Bus0, and its downstream buses are numbered Bus1, Bus2, Bus3, etc. in increasing order according to the depth-first traversal principle.

[0122] exist Figure 6In the example, Bridge1(0_1_3) means that the primary bus number of Bridge1 is Bus0, the secondary bus number is Bus1, and the subordinate bus number is Bus3. The same applies to the others.

[0123] 2. Determine the device number.

[0124] The device number is directly related to the device's properties. If the current device is a DUT hardware, the device number is determined by the DUT's fixed properties. If the current device is a VIP, the device number is determined by the VIP's configurable properties. The DUT's fixed properties and the VIP's configurable properties are user-defined based on the actual design.

[0125] Generally, the device number of EP devices is 0. The device numbers of PCIe_to_PCIe bridges in Switch devices are 0, 1, and 2. Figure 2 .

[0126] 3. Determine the Function Number.

[0127] The Function Number is directly related to the device's properties. If the current device is a DUT hardware, the Function Number is determined by the DUT's fixed properties. If the current device is a VIP, the Function Number is determined by the VIP's configurable properties. The DUT's fixed properties and the VIP's configurable properties are user-defined based on the actual design.

[0128] 4. The user specifies the following information for the script to retrieve:

[0129] (1) Device ID and Vendor ID. This information is related to the actual device and does not need to be randomized in the script language.

[0130] (2) Class Code: Indicates the type of the device and the specific interface type.

[0131] (3) HeaderType: Indicates the type of configuration space, where 0 indicates a normal device and 1 indicates a Bridge device. A 0 in the highest bit indicates a single function, and a 1 in the highest bit indicates a multi-function device. Note that the configuration value here must be consistent with the Function Number obtained in step 3.

[0132] (4) BAR (Base Address Register): Complete the BAR definition according to the PCIe protocol and the actual connection structure. Define the starting address and address range of the storage space to determine the size of the space range. You can also define: whether the space type is IO or Memory, whether the addressing range is 32-bit or 64-bit, whether prefetching is supported, etc. Each device has a base address register.

[0133] 5. The script determines the following based on the relevant information defined in (4) above:

[0134] (1)Memory Limit: the memory size allocated by the device;

[0135] (2)Memory Base: The memory base address of the device configuration.

[0136] To obtain the values for memory limit and memory base, you first manually provide the starting address and address range of the available memory space. The script then randomly or evenly distributes these addresses based on the number of RC, EP, and switch ports. The allocations must not result in out-of-bounds addresses.

[0137] The number of BARs required varies depending on whether the device is an EP or a Bridge.

[0138] Based on the relevant information specified by the user, the script can automatically determine the information required for enumeration based on the PCIe standard and fill the specific values into the template file, thereby generating an enumeration information file that can be recognized by the simulation system.

[0139] As can be seen, this embodiment utilizes scripts to automatically generate enumeration result information, significantly shortening the overall simulation time. According to actual tests, when enumerating a PCIe device, using this method can save approximately 30% of the time. If the DUT contains more PCIe devices, the simulation time saved by this embodiment will be even more significant. Of course, if the DUT is designed based on other protocol standards, then the corresponding scripts can also be implemented according to this application, thereby using the scripts to obtain and enumerate the information required for simulation.

[0140] References to "first," "second," "third," "fourth," and the like (if any) herein are intended to distinguish similar objects and are not necessarily intended to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, or apparatus.

[0141] It should be noted that the descriptions of "first", "second", etc. in this application are for descriptive purposes only and should not be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0142] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0143] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of readable storage medium known in the art.

[0144] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. An information enumeration method, characterized in that: Applies to enumeration scripts, including: Obtaining target information specified by the user; the target information includes: the number of uplink ports and downlink ports of the DUT, the range of storage space required for simulation verification, device attribute information and functional attribute information corresponding to the DUT and each device connected to the DUT; The DUT and each device connected to the DUT are regarded as devices to be configured, and a bus number corresponding to each device to be configured is calculated based on the number of upstream ports and the number of downstream ports; wherein each device to be configured has an upstream bus number, a downstream bus number, and a farthest bus number recorded; Allocating the storage space to each device to be configured and recording the allocation result; Filling a preset template file according to the target information, the bus number corresponding to each device to be configured, and the allocation result to obtain an information enumeration result for simulating the DUT; The calculating the bus number corresponding to each to-be-configured device based on the number of uplink ports and the number of downlink ports includes: Determine the RC device connected to the upstream port of the DUT based on the number of upstream ports; determine the EP device connected to the downstream port of the DUT based on the number of downstream ports; construct a structure tree based on the DUT, the RC device, and the EP device, and traverse the structure tree depth-first to determine the bus number of each device to be configured one by one.

2. The information enumeration method according to claim 1, characterized in that: The obtaining of target information specified by the user includes: Receive the target information input by the user based on the human-computer interaction interface.

3. The information enumeration method according to claim 1, characterized in that: The allocating the storage space to each device to be configured and recording the allocation result includes: The storage space is evenly distributed to each device to be configured, and the distribution result is recorded.

4. The information enumeration method according to claim 1, characterized in that: The allocating the storage space to each device to be configured and recording the allocation result includes: The storage space is randomly allocated to each device to be configured using a random function, and the allocation result is recorded.

5. The information enumeration method according to any one of claims 1 to 4, characterized in that: After obtaining the information enumeration result for simulating the DUT, the method further includes: Visually display the information enumeration results of the DUT.

6. The information enumeration method according to any one of claims 1 to 4, characterized in that: After obtaining the information enumeration result for simulating the DUT, the method further includes: The simulation system is set up according to the information enumeration result, so as to simulate the DUT using the simulation system.

7. An information enumeration device, characterized in that: Applies to enumeration scripts, including: An acquisition module is configured to acquire target information specified by a user; the target information includes: the number of uplink ports and downlink ports of the DUT, the range of storage space required for simulation verification, and device attribute information and functional attribute information corresponding to the DUT and each device connected to the DUT; a calculation module, configured to treat the DUT and each device connected to the DUT as a device to be configured, and calculate a bus number corresponding to each device to be configured based on the number of upstream ports and the number of downstream ports; wherein each device to be configured records an upstream bus number, a downstream bus number, and a farthest bus number; an allocation module, configured to allocate the storage space to each device to be configured and record the allocation result; A filling module, configured to fill a preset template file according to the target information, the bus number corresponding to each device to be configured, and the allocation result, so as to obtain an information enumeration result for simulating the DUT; The information enumeration device is specifically used to: Determine the RC device connected to the upstream port of the DUT based on the number of upstream ports; determine the EP device connected to the downstream port of the DUT based on the number of downstream ports; construct a structure tree based on the DUT, the RC device, and the EP device, and traverse the structure tree depth-first to determine the bus number of each device to be configured one by one.

8. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to execute the computer program to implement the information enumeration method according to any one of claims 1 to 6.

9. A readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the information enumeration method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • USB keyboard and mouse simulation system and control method thereof

    CN111722729A

  • Method for flexibly configuring and generating service application enumeration

    CN113238813A

  • Device enumeration method, device, system and storage medium

    CN113297124A