Bus exchange simulation system and method, electronic equipment and storage medium

Through the bus switching simulation system, chip simulation equipment, bus switching simulation equipment and simulation end nodes are used to solve the problems of high cost and low efficiency of PCIe switching chip simulation system, and efficient simulation debugging and rapid debugging are achieved, suitable for large-scale storage PCIe switching chip simulation of the system.

CN118945092APending Publication Date: 2024-11-12SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411214662.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The existing PCIe switching chip simulation system is costly and inefficient, making it difficult to meet the expansion needs of large-scale storage systems.

Method used

Design a bus switching simulation system, including chip simulation equipment, bus switching simulation equipment and simulation end nodes, receive bus requests sent by chip simulation equipment through bus switching simulation equipment, and determine the target downlink port according to the port topology configuration table, and convert the bus request. Send to the simulation end node, and the response result is used to determine the bus-switched simulation result.

Benefits of technology

It reduces simulation costs, improves bus switching simulation efficiency, and realizes rapid debugging through software, and is suitable for PCIe switching chip simulation for large-scale storage systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118945092A_ABST
    Figure CN118945092A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a bus switching simulation system and method, electronic equipment and a storage medium, and the system comprises chip simulation equipment which is used for sending a bus request to bus switching simulation equipment; the bus exchange simulation equipment is used for receiving a bus request sent by the chip simulation equipment, obtaining a port topology configuration table, determining a target downlink port of the bus request according to the port topology configuration table and request information represented by the bus request, and sending the bus request to a corresponding simulation end node through the target downlink port; and the simulation end node is used for responding to the bus request to obtain a response result of the bus request so as to determine a bus exchange simulation result according to the response result of the bus request. According to the bus exchange simulation method, the bus exchange simulation equipment and the simulation end nodes are adopted for bus simulation exchange, the simulation cost is reduced, the bus exchange simulation equipment and the simulation end nodes can be rapidly debugged based on software programs, and the bus exchange simulation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a bus exchange simulation system, method, electronic device and storage medium. Background Art

[0002] At present, with the continuous expansion of the scale of Internet big data, the required storage space and network resources are also growing. In order to expand the existing storage system or network system, PCIe switch chips have been widely used. PCIe switch chips are used to expand the PCIe bus according to user needs. Therefore, how to develop and design PCIe switch chips has become a key research content.

[0003] In related technologies, in order to ensure that the functions and performance of the PCIe switch chip finally developed meet the user's design requirements, a PCIe-based physical simulation environment is usually built. The chip simulation system is connected to the host side through a simulated host interface bus, and is connected to the real PCIe switch board and real physical device through a simulated adapter.

[0004] However, in the field of chip simulation modeling, physical simulation is not only costly, but also requires debugging of physical devices during the simulation process, which reduces simulation efficiency. Summary of the invention

[0005] The present application provides a bus exchange simulation system, method, electronic device and storage medium to solve the defects of related technologies such as high simulation cost and low efficiency.

[0006] The first aspect of the present application provides a bus switching simulation system, comprising: a chip simulation device, a bus switching simulation device and a plurality of simulation end nodes;

[0007] The chip emulation device is used to send a bus request to the bus switch emulation device;

[0008] The bus switching simulation device is used to receive the bus request sent by the chip simulation device, and obtain a port topology configuration table, determine the target downstream port of the bus request according to the port topology configuration table and the request information represented by the bus request, and send the bus request to the corresponding simulation end node through the target downstream port;

[0009] The simulation end node is used to respond to the bus request and obtain a response result of the bus request, so as to determine a bus exchange simulation result according to the response result of the bus request.

[0010] In an optional implementation, the bus switching simulation device includes:

[0011] The simulation bus exchange initialization module is used to create port topology configuration information according to user simulation requirements, and register the simulation port configuration in the top-level configuration module according to the port topology configuration information;

[0012] A simulation bus switching topology configuration module, used to read the simulation port configuration registration information from the top-level configuration module, and generate and cache a port topology configuration table according to the analysis result of the simulation port configuration registration information;

[0013] An uplink port management module, configured to initialize the uplink port according to the port topology configuration table when the port topology configuration table cached by the simulated bus switching topology configuration module includes the uplink port configuration;

[0014] A downstream port management module, configured to initialize the downstream port according to the port topology configuration table when the port topology configuration table cached by the simulated bus switching topology configuration module includes the downstream port configuration;

[0015] The simulation bus exchange addressing module is used to receive a bus request sent by a chip simulation device, query the target downstream port corresponding to the request information of the bus request in the port topology configuration table, and send the bus request to the corresponding simulation end node through the target downstream port;

[0016] The port topology configuration table includes a bus identifier combination, a port type, a device configuration space, a device memory space and a device parameter of each service port, and the request information of the bus request includes at least a bus identifier combination.

[0017] In an optional implementation manner, the simulated bus exchange initialization module is further used to:

[0018] Obtain a simulation configuration file; wherein the simulation configuration file at least includes a device name, a device type, the number of bus domains where the device is located, the number of upstream ports, the number of downstream ports, the name of the upstream port, and the name of the downstream port;

[0019] Initializing and configuring the bus switching simulation device according to the simulation configuration file;

[0020] Memory resources are applied for according to the number of uplink ports and the number of downlink ports, so as to store the uplink port device information and the downlink port device information based on the applied memory resources.

[0021] In an optional implementation, the simulated bus switching topology configuration module is further used to:

[0022] Reading the simulation configuration file;

[0023] Determining configuration parameter information of the bus switching simulation device according to the simulation configuration file;

[0024] Verifying the configuration parameter information to determine a configuration verification result of the bus switching simulation device;

[0025] The configuration parameter information at least includes the device connection status of each service port.

[0026] In an optional implementation manner, the uplink port management module is specifically configured to:

[0027] In the case where the port topology configuration table cached by the simulation bus switching topology configuration module includes an uplink port configuration, obtaining configuration information of an uplink opposite-end device connected to the uplink port from the port topology configuration table;

[0028] Verifying, according to the configuration information of the uplink peer device, whether the uplink peer device has completed initialization configuration;

[0029] When it is determined that the upstream peer device has completed initialization configuration, creating an upstream port device;

[0030] Registering the upstream port device with the upstream peer device, so that when the upstream peer device receives a bus request, it determines a target upstream port device according to the upstream port device registration information, so as to transmit the bus request based on the target upstream port device;

[0031] Wherein, the chip simulation device includes the uplink peer device.

[0032] In an optional implementation manner, the downlink port management module is specifically used to:

[0033] When the port topology configuration table cached by the simulation bus switching topology configuration module includes a downstream port configuration, obtaining configuration information of a downstream opposite-end device connected to the downstream port from the port topology configuration table;

[0034] Verifying, according to the configuration information of the downstream peer device, whether the downstream peer device has completed initialization configuration;

[0035] When it is determined that the downstream peer device has completed initialization configuration, creating a downstream port device;

[0036] Registering the downstream peer device to the downstream port device, so that when the downstream port device receives a bus request, it determines a target downstream peer device according to the registration information of the downstream peer device, so as to transmit the bus request to the target downstream peer device;

[0037] Wherein, the simulation end node includes the downlink opposite end device.

[0038] In an optional implementation manner, the simulated bus switch addressing module is further used to:

[0039] After determining the target downlink port, determining whether the target downlink port has completed initialization configuration;

[0040] When it is determined that the target downstream port has completed initialization configuration, the bus request is forwarded to a target downstream port device corresponding to the target downstream port, so as to transmit the bus request to the target downstream opposite-end device based on the target downstream port device.

[0041] In an optional implementation manner, the simulated bus switch addressing module is further used to:

[0042] Receiving, through a target downstream port device, a response result of the bus request sent by the target downstream peer device;

[0043] The response result is fed back to the target upstream opposite-end device through the target upstream port device.

[0044] A second aspect of the present application provides a bus switching simulation method, comprising:

[0045] Sending a bus request to the bus switching emulation device based on the chip emulation device;

[0046] Determine the target downstream port of the bus request based on the bus switching simulation device according to the port topology configuration table and the request information represented by the bus request;

[0047] Sending the bus request to the corresponding simulation end node through the target downstream port, so that the simulation end node responds to the bus request and obtains a response result of the bus request;

[0048] A bus exchange simulation result is determined according to the response result of the bus request.

[0049] A third aspect of the present application provides an electronic device, comprising: at least one processor and a memory;

[0050] The memory stores computer-executable instructions;

[0051] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method described in the first aspect and various possible designs of the first aspect.

[0052] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in the first aspect and various possible designs of the first aspect are implemented.

[0053] The fifth aspect of the present application provides a computer program product, including computer instructions, which are used to enable a computer to execute the method described in the first aspect and various possible designs of the first aspect.

[0054] The technical solution of this application has the following advantages:

[0055] The present application provides a bus exchange simulation system, method, electronic device and storage medium, the system includes: a chip simulation device, a bus exchange simulation device and several simulation end nodes; the chip simulation device is used to send a bus request to the bus exchange simulation device; the bus exchange simulation device is used to receive the bus request sent by the chip simulation device, and obtain the port topology configuration table, determine the target downstream port of the bus request according to the port topology configuration table and the request information represented by the bus request, and send the bus request to the corresponding simulation end node through the target downstream port; the simulation end node is used to respond to the bus request, obtain the response result of the bus request, and determine the bus exchange simulation result according to the response result of the bus request. The system provided by the above scheme reduces the simulation cost by using the bus exchange simulation device and several simulation end nodes to perform bus simulation exchange, and the bus exchange simulation device and the simulation end node can realize fast debugging based on the software program, thereby improving the efficiency of bus exchange simulation. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technical descriptions. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.

[0057] Figure 1 A schematic diagram of the structure of a conventional bus simulation system provided in an embodiment of the present application;

[0058] Figure 2 A schematic diagram of the interaction process of the bus switching simulation system provided in an embodiment of the present application;

[0059] Figure 3 A schematic diagram of the structure of a bus switching simulation system provided in an embodiment of the present application;

[0060] Figure 4 A schematic diagram of the structure of a bus switching simulation cascade system provided in an embodiment of the present application;

[0061] Figure 5 A schematic diagram of the structure of a bus switching simulation device provided in an embodiment of the present application;

[0062] Figure 6 A schematic diagram of the initialization process of the top-level configuration module provided in an embodiment of the present application;

[0063] Figure 7 A schematic diagram of the initialization process of the bus switching simulation device provided in an embodiment of the present application;

[0064] Figure 8 A schematic diagram of the topological structure of a bus switching simulation device provided in an embodiment of the present application;

[0065] Fig. 9 A schematic diagram of the business process of the simulation bus switching topology configuration module provided in an embodiment of the present application;

[0066] Fig.10 A schematic diagram of the service process of the uplink port management module provided in an embodiment of the present application;

[0067] Fig.11 A schematic diagram of a cascade topology structure of an exemplary bus switching simulation device provided in an embodiment of the present application;

[0068] Fig.12 A schematic diagram of the business process of the downlink port management module provided in an embodiment of the present application;

[0069] Fig.13 A schematic diagram of the business process of the simulated bus exchange addressing module provided in an embodiment of the present application;

[0070] Fig.14 A schematic diagram of a process flow of a bus switching simulation method provided in an embodiment of the present application;

[0071] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0072] The above drawings have shown clear embodiments of the present application, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0073] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0074] In addition, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the description of the following embodiments, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.

[0075] In related technologies, as the scale of Internet big data continues to expand, the required storage space is also growing. The current popular storage system is the flash memory system of the NVMe specification. NVMe devices are usually connected to the storage system based on the PCIe bus. In large-scale storage systems, if a large number of NVMe devices based on the PCIe bus are to be connected, PCIe switching chips are usually used to expand the PCIe bus. In the field of chip design, when building a physical simulation environment based on PCIe, it is usually necessary to use an adapter device to transfer to a real PCIe switching physical device as a peripheral device to connect to the simulation device.

[0076] like Figure 1 As shown, it is a structural diagram of the traditional bus simulation system provided by the embodiment of the present application, wherein the part in the dotted box diagram is a functional block diagram of the chip simulation system. The chip simulation system has simulation hardware, simulation CPU bus, simulation PCIe-RC and simulation adapter inside, and PCIe-RC is the PCIe root node. The chip simulation system is connected to the storage system host through the simulation host interface bus, and is connected to the real PCIe exchange and real physical devices through the simulation adapter to build a complete physical simulation system. In the field of chip simulation modeling, the disadvantages of physical simulation are high cost, few equipment, scarce environmental resources, and inconvenience for large-scale parallel development, debugging and testing by software teams.

[0077] In view of the above problems, the embodiments of the present application provide a bus exchange simulation system, method, electronic device and storage medium, the system comprising: a chip simulation device, a bus exchange simulation device and several simulation end nodes; the chip simulation device is used to send a bus request to the bus exchange simulation device; the bus exchange simulation device is used to receive the bus request sent by the chip simulation device, and obtain the port topology configuration table, determine the target downstream port of the bus request according to the port topology configuration table and the request information represented by the bus request, and send the bus request to the corresponding simulation end node through the target downstream port; the simulation end node is used to respond to the bus request, obtain the response result of the bus request, and determine the bus exchange simulation result according to the response result of the bus request. The system provided by the above scheme reduces the simulation cost by using the bus exchange simulation device and several simulation end nodes to perform bus simulation exchange, and the bus exchange simulation device and the simulation end node can realize fast debugging based on the software program, thereby improving the efficiency of bus exchange simulation.

[0078] The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.

[0079] An embodiment of the present application provides a bus switching simulation system for performing configuration simulation on a PCIe switching chip to verify whether the function and performance of the PCIe switching chip meet the design requirements of the user.

[0080] like Figure 2 As shown, it is a schematic diagram of the interaction process of the bus switching simulation system provided in an embodiment of the present application. The system includes: a chip simulation device, a bus switching simulation device and a plurality of simulation end nodes.

[0081] Among them, the chip simulation device is used to send a bus request to the bus switching simulation device; the bus switching simulation device is used to receive the bus request sent by the chip simulation device, and obtain the port topology configuration table, determine the target downstream port of the bus request according to the port topology configuration table and the request information represented by the bus request, and send the bus request to the corresponding simulation end node through the target downstream port; the simulation end node is used to respond to the bus request and obtain the response result of the bus request, so as to determine the bus switching simulation result according to the response result of the bus request. When the application scenario of the PCIe switching chip is a storage system, the bus request can specifically be a read request or a write request, and the simulation end node can be an NVMe device, etc.

[0082] It should be noted that the bus switching simulation system provided in the embodiment of the present application is implemented using SystemC transaction-level modeling. Such a simulation system can provide a software simulation function model that is consistent with the hardware access interface for software debugging. A common software function model simulation design method is to build a software simulation system based on SystemC's transaction-level simulation modeling, and the software simulation system can be built according to the simulation requirements of software debugging. There are some common device models in the existing SystemC-based transaction-level simulation modeling, including the PCIe-RC device model and the PCIe-EP device model, which facilitate the construction of a software simulation environment for debugging by the software team. When implementing transaction-level modeling for PCIe switching chips based on SystemC, the relevant technology is currently blank for the software simulation device model for transaction-level modeling of PCIe switching devices based on SystemC.

[0083] Specifically, Figure 3 As shown, it is a structural diagram of the bus switching simulation system provided in an embodiment of the present application. On the basis of the original simulation system, a PCIe switching simulation unit (bus switching simulation device) is established in the chip simulation system. The PCIe switching simulation unit simulates the function of a real PCIe switching chip. Multiple simulated PCIe port modules are implemented in the PCIe switching simulation unit for connecting simulated PCIe-EP (PCIe Endpoint) physical devices (simulated end nodes). In this way, a transaction-level simulation model of a PCIe switching chip supporting multiple PCIe ports is built, which solves the needs of the software team for simulation and debugging of PCIe switching chip scenarios during the chip development process and saves the hardware resources consumed in building a hardware simulation environment.

[0084] Specifically, the storage system host can send a bus request to the simulated CPU through the simulated host interface bus, and then the simulated CPU sends the bus request to the simulated PCIe-RC device, and finally the simulated PCIe-RC device sends the bus request to the bus switching simulation device, and the chip simulation device includes a simulated CPU and a simulated PCIe-RC device. The bus switching simulation device is connected to the simulated Root Complex (simulated PCIe-RC device) through a simulated PCIe bus; the bus switching simulation device is also connected to one or more simulated physical devices PCIe Endpoint (simulated end nodes) through a simulated PCIe bus connection. After obtaining the bus request, the bus switching simulation device determines the target downstream port of the bus request according to the pre-obtained port topology configuration table, and sends the bus request to the corresponding simulated end node through the target downstream port, so that the simulated end node responds to the bus request and obtains the request response result, and then determines the bus switching simulation result of the PCIe switching chip according to the request response result.

[0085] Among them, Figure 4 As shown, it is a structural diagram of the bus switching simulation cascade system provided in an embodiment of the present application. The bus switching simulation device also supports connection with other bus switching simulation devices to build a simulation environment for PCIe switching cascade.

[0086] On the basis of the above embodiments, in order to further ensure the reliability of the bus switching simulation device, as Figure 5 A schematic diagram of the structure of a bus switching simulation device provided in an embodiment of the present application, as an implementable manner, in one embodiment, the bus switching simulation device includes:

[0087] The simulation bus exchange initialization module is used to create port topology configuration information according to user simulation requirements, and register the simulation port configuration in the top-level configuration module (simulation system top-level configuration module) according to the port topology configuration information;

[0088] The simulation bus switching topology configuration module is used to read the simulation port configuration registration information from the top-level configuration module, and generate and cache the port topology configuration table according to the analysis result of the simulation port configuration registration information;

[0089] An uplink port management module (simulated bus switching uplink port management module), used to initialize the uplink port according to the port topology configuration table when the port topology configuration table cached by the simulated bus switching topology configuration module includes the uplink port configuration;

[0090] A downstream port management module (simulated bus switching downstream port management module), configured to initialize the downstream port according to the port topology configuration table when the port topology configuration table cached by the simulated bus switching topology configuration module includes the downstream port configuration;

[0091] The simulation bus exchange addressing module is used to receive the bus request sent by the chip simulation device, query the target downstream port corresponding to the request information of the bus request in the port topology configuration table, and send the bus request to the corresponding simulation end node through the target downstream port.

[0092] The port topology configuration table includes the bus identifier combination, port type, device configuration space, device memory space and device parameters of each service port, and the request information of the bus request includes at least the bus identifier combination.

[0093] Specifically, the simulated PCIe exchange initialization module (simulated bus exchange initialization module) is responsible for the initialization of the simulated PCIe exchange (bus exchange simulation device), creating a simulated PCIe exchange port topology configuration table, completing the registration of the transaction-level access port to the simulation system top-level configuration module, creating a SystemC processing thread, and creating a SystemC notification event.

[0094] Among them, the simulated PCIe switch port topology configuration table (port topology configuration table) includes the following fields: table index, BDF information (bus identifier combination), device type (port type), device configuration space, device Memory space (device memory space) and other PCIe device parameters.

[0095] Among them, the table index is a positive integer, ranging from 0; BDF information is a 32-bit positive integer, identifying the bus-device-function number of the device; device type: value 1 identifies the RC port, value 2 indicates the upstream port of PCIe exchange, value 3 indicates the downstream port of PCIe exchange, and value 0 identifies the connected EP port. Device list information, including the name of the connected device list device configuration space, identifying the starting address of the configuration space of the PCIe device; device memory space, identifying the starting address of the memory access space of the PCIe device; other PCIe device parameters are device parameters specified by the protocol, and this embodiment of the application does not limit this.

[0096] Specifically, the simulated PCIe exchange topology configuration module (simulated bus exchange topology configuration module) is responsible for reading the simulated PCIe exchange topology configuration file, parsing the configuration file content, and storing the simulated system PCIe device topology information established based on the simulated PCIe exchange in the simulated PCIe exchange port topology configuration table for query and use by other modules of the simulated PCIe exchange unit (bus exchange simulation device). At the same time, the simulated PCIe exchange topology configuration module also calls the simulated PCIe exchange upstream port management module to initialize the configuration of the simulated PCIe exchange upstream port according to the read topology configuration information if it is an upstream port configuration; if it is a downstream port configuration, the simulated PCIe exchange downstream port management module is called to initialize the configuration of the simulated PCIe exchange downstream port.

[0097] Specifically, the simulated PCIe switch addressing module (simulated bus switch addressing module) is responsible for receiving transaction-level requests from the bus, searching for the PCIe device registered in the corresponding address space according to the requested port number, BDF information and target address information, and forwarding the request to the PCIe device registered in the PCIe bus (simulated end node). The PCIe device generates the response data of the request and returns the response to the requester. The request can be a request for the PCIe configuration space or a request for the PCIeMemory space. The simulated PCIe switch module receives a request, which can be a request issued by a PCIe-RC device, a request forwarded by a PCIe switch device, or a PCIe EP device connected to a simulated PCIe switch. If the request is a request for the configuration space, the request object is generally a PCIe-RC device, a PCIe switch device, or a PCIe-EP device; if the request is a request for the Memory space, the request object is generally a PCIe EP device.

[0098] For example, Figure 6 As shown, it is a schematic diagram of the initialization process of the top-level configuration module provided in the embodiment of the present application. The initialization of the bus exchange simulation device is divided into three parts. The first part is the pre-initialization, including S1001 initialization of the simulation basic library based on SystemC's TLM, the simulation system top-level module (top-level configuration module) system bus initialization, and the simulation system bus is responsible for connecting each simulation unit and processing bus requests and responses. It also includes S1002 simulation PCIe-RC device and S1003 simulation PCIe-EP device initialization, in preparation for building a simulation system based on the simulation PCIe exchange model. The second part is S1004 simulation PCIe exchange initialization, including creating a core processing thread, creating a notification event, creating a global variable, and calling the simulation PCIe exchange topology configuration module to process the topological relationship of the PCIe exchange model of the simulation system. In the third part, S1005 calls the interface of the simulation PCIe exchange uplink port management module to bind the PCIe-RC device to the PCIe exchange uplink port. S1006 calls the interface of the simulated PCIe switch downstream port management module to bind the PCIe switch downstream port to the PCIe-EP device. Finally, the simulation system top-level module is initialized and the simulation system runs.

[0099] On the basis of the above embodiments, in order to further ensure the reliability of the bus switching simulation device, as Figure 7 The schematic diagram of the initialization process of the bus exchange simulation device provided in the embodiment of the present application is an implementable method. In one embodiment, the simulation bus exchange initialization module is further used to:

[0100] Obtain a simulation configuration file; wherein the simulation configuration file includes at least a device name, a device type, the number of bus domains where the device is located, the number of upstream ports, the number of downstream ports, the name of the upstream port, and the name of the downstream port; initialize the bus switching simulation device according to the simulation configuration file; apply for memory resources according to the number of upstream ports and the number of downstream ports, so as to store the upstream port device information and the downstream port device information based on the applied memory resources.

[0101] Among them, the specific initialization steps of the simulation bus exchange initialization module are as follows:

[0102] S2001: Reading a simulation configuration file, which is generated according to environment requirements before the environment is established;

[0103] S2002: parsing the configuration parameters of the PCIe switching device in the simulation configuration file;

[0104] S2003: applying for memory for storing the uplink port device information of the switch according to the parsed parameter of the number of uplink ports of the simulated PCIe switch device;

[0105] S2004: Apply for memory for storing the downstream port device information of the switch according to the analyzed number of downstream ports of the simulated PCIe switch device. The port topology configuration information includes part of the port device information, and the upstream port device information and downstream port device information stored here include more detailed information;

[0106] S2005: calling the simulated PCIe switching topology configuration module to process PCIe switching topology information;

[0107] S2006: Initialize the core processing thread of the simulated PCIe switch module, which is implemented using sc_thread of SystemC and is used to process TLM transactions. Initialize the notification event, which is implemented using sc_event of SystemC and binds the event to the processing thread, so as to notify the core processing thread to process the transaction after it arrives.

[0108] The following is a set of exemplary initialization configuration parameters of the bus switching simulation device recorded in the simulation configuration file:

[0109] [pcie_switch_0]

[0110] type=switch

[0111] domain_num=1

[0112] up_num=1

[0113] dp_num=4

[0114] conn = pcie_rc_0

[0115] up_port=pcie_switch_up_0

[0116] dp_port=pcie_switch_dp_0pcie_switch_dp_1pcie_switch_dp_2pcie_switch_dp_3

[0117] Among them, pcie_swich_0 represents the name of the PCIe switching device; type=switch indicates that the device type is a switching device; domain_num=1 indicates that the number of bus domains where the simulated PCIe switching device is located is 1; up_num=1 indicates that the number of upstream ports of the simulated PCIe switching device is 1; dp_num=4 indicates that the number of downstream ports of the simulated PCIe switching device is 4; up_port=pcie_switch_up_0 represents the name of the upstream port of the simulated PCIe switching device; dp_port=pcie_switch_dp_0pcie_switch_dp_1pcie_switch_dp_2pcie_switch_dp_3 represents the names of the four downstream ports of the simulated PCIe switching device.

[0118] It should be noted that the simulation configuration file is stored in the form of a file and is read when the simulation system program is running.

[0119] The format is as follows:

[0120] [PCIe device name]

[0121] PCIe device type parameter = host / switch / up / dp / ep

[0122] PCIe device BUS parameter = bus number

[0123] PCIe device DEV parameter = device number

[0124] PCIe device FUNC parameter = function number

[0125] PCIe device domain parameter = region number

[0126] PCIe device configuration space base address = configuration space address

[0127] PCIe device memory space base address = memory space address

[0128] PCIe device connection type parameter = list of connected PCIe device names

[0129] Figure 8 A schematic diagram of the topological structure of the bus switching simulation device provided in the embodiment of the present application is shown in FIG. Figure 8 Take the simulated PCIe switching network topology shown as an example:

[0130] [pcie_rc_0]

[0131] type=host

[0132] bus=0

[0133] dev=0

[0134] func=0

[0135] conf_base=0x4_0000_0000

[0136] mem_base = 0x5_0000_0000

[0137] conn = pcie_switch_0

[0138] [pcie_switch_0]

[0139] type=switch

[0140] domain_num=1

[0141] up_num=1

[0142] dp_num=4

[0143] conn = pcie_rc_0

[0144] up_port=pcie_switch_up_0

[0145] dp_port=pcie_switch_dp_0 pcie_switch_dp_1 pcie_switch_dp_2pcie_switch_dp_3

[0146] [pcie_switch_up_0]

[0147] type=up

[0148] bus=1

[0149] dev=0

[0150] func=0

[0151] domain=0

[0152] conn=pcie_rc_0

[0153] [pcie_switch_dp_0]

[0154] type=dp

[0155] bus=2

[0156] dev=0

[0157] func=0

[0158] conn=pcie_ep_0

[0159] [pcie_switch_dp_1]

[0160] type=dp

[0161] bus=2

[0162] dev=1

[0163] func=0

[0164] conn=pcie_ep_1

[0165] [pcie_switch_dp_2]

[0166] type=dpbus=2dev=2func=0conn=pcie_ep_2

[0167] [pcie_switch_dp_3]type=dpbus=2dev=3func=0conn=pcie_ep_3

[0168] [pcie_ep_0]type=epbus=3dev=0func=0conn=pcie_switch_dp_0[pcie_ep_1]type=epbus=3dev=1func=0conn=pcie_switch_dp_1[pcie_ep_2]type=epbus=3

[0169] dev=2

[0170] func=0

[0171] conn=pcie_switch_dp_2

[0172] [pcie_ep_3]

[0173] type=ep

[0174] bus=3

[0175] dev=3

[0176] func=0

[0177] conn = pcie_switch_dp_3

[0178] Specifically, according to the above simulation configuration file, it is clear that pcie_rc_0 is connected to pcie_switch0, and the configuration file of pcie_switch_0 specifies the device information, port number and port list of the PCIe switch itself, the upstream port pcie_swith_up_0 is connected to pcie_rc_0, the downstream port pcie_switch_dp_0 is connected to the PCIe device pcie_ep_0, the downstream port pcie_switch_dp_1 is connected to the PCIe device pcie_ep_1, the downstream port pcie_switch_dp_2 is connected to the PCIe device pcie_ep_2, and the downstream port pcie_switch_dp_3 is connected to the PCIe device pcie_ep_3. The simulation configuration file also specifies the connection correspondence between the PCIe device and the downstream port of the PCIe switch.

[0179] The embodiment of the present application uses the simulation design of "transaction-level model based on SystemC, independent configuration of ports", provides a method for independent configuration of simulated PCIe switch ports based on SystemC transaction-level model, performs port-independent configuration of the topological relationship, port list, upstream port, downstream port, and port-to-port connection relationship of the simulated PCIe switch, and facilitates the initialization of the port topology. And on this basis, using the simulation design of "transaction-level model based on SystemC, port differentiation and binding", when a complete simulation system is constructed based on the simulated PCIe switch model constructed based on the transaction-level model of SystemC, the upstream port of the simulated PCIe switch can distinguish the RC port bound to the simulated PCIe, and the downstream port of the simulated PCIe switch can distinguish the EP port bound to the simulated PCIe, so as to construct a complete simulation system including devices.

[0180] Furthermore, in one embodiment, the simulation bus switching topology configuration module is further used to:

[0181] Read the simulation configuration file; determine the configuration parameter information of the bus switching simulation device according to the simulation configuration file; verify the configuration parameter information to determine the configuration verification result of the bus switching simulation device.

[0182] The configuration parameter information at least includes the device connection status of each service port.

[0183] Specifically, Fig. 9As shown, it is a schematic diagram of the business process of the simulation bus switching topology configuration module provided in an embodiment of the present application, which specifically includes the following steps:

[0184] S3001: Create a port topology configuration table to store the connection relationship between port topologies and the configuration parameters of each port and device, for use by the simulated PCIe switch upstream port configuration module and the simulated PCIe switch downstream port configuration module when configuring ports.

[0185] S3002: Read the simulation configuration file. Here, the options related to the PCIe device in the simulation configuration file are read. Generally, the simulation system configuration file will have configuration options for all simulation devices. Here, the options and parameters related to the pcie_rc, pcie_switch, and pcie_ep devices are read for processing.

[0186] S3003: Parse the device configuration parameters to obtain the configuration parameter information of the bus exchange simulation device. The options related to the PCIe device in the configuration file here explicitly indicate the parameter name and parameter value of the device in the form of a string, which needs to be converted into variables and numbers that can be recognized by the program for storage. Here, the parameter name string is processed by the string matching method to obtain the parameter value in the string format corresponding to the parameter, convert the parameter value string, and assign the converted digital value to the corresponding parameter variable.

[0187] S3004: Verify the configuration parameter information to verify the device parameters. The main rules used in the embodiment of the present application are as follows:

[0188] (1) Check whether the device connected to the RC device emulating PCIe exists. If it exists, it is considered to be a normal connection. If the corresponding device cannot be found, it is considered to be an incorrect configuration.

[0189] (2) Check whether the upstream port of the simulated PCIe switch specifies the connected device. If it exists, it is considered to be a normal connection. If the corresponding device cannot be found, it is considered to be an incorrect configuration.

[0190] (3) Check whether the downstream port of the simulated PCIe switch has a specified connected device. If so, it is considered a normal connection. If no corresponding device is found, it is considered an incorrect configuration.

[0191] (4) Check whether the upstream port device of the simulated PCIe switch is in the upstream port device list of the simulated PCIe switch. If it exists, it is considered to be a normal connection. If the corresponding device is not found, it is considered to be an incorrect configuration.

[0192] (5) Check whether the downstream port device of the simulated PCIe switch is in the downstream port device list of the simulated PCIe switch. If it exists, it is considered to be a normal connection. If the corresponding device is not found, it is considered to be an incorrect configuration.

[0193] (6) Check whether the device connected to the downstream port device of the simulated PCIe switch exists. If it exists, it is considered to be a normal connection. If the corresponding device cannot be found, it is considered to be an incorrect configuration.

[0194] (7) Check whether the device connected to the EP device simulating PCIe switching exists. If it exists, it is considered to be a normal connection. If the corresponding device cannot be found, it is considered to be an incorrect configuration.

[0195] S3005: Determine the verification result.

[0196] If the verification passes, execute step S3006 to store the device parameters in the port topology configuration table;

[0197] If the verification fails, execute step S3007; report the error, print the specific error message, and exit the program.

[0198] Further, in one embodiment, the uplink port management module is specifically used to:

[0199] In the case where the port topology configuration table cached by the simulation bus exchange topology configuration module includes the uplink port configuration, the configuration information of the uplink opposite device connected to the uplink port is obtained from the port topology configuration table; based on the configuration information of the uplink opposite device, it is verified whether the uplink opposite device has completed the initialization configuration; when it is determined that the uplink opposite device has completed the initialization configuration, the uplink port device is created; the uplink port device is registered with the uplink opposite device, so that when the uplink opposite device receives a bus request, it determines the target uplink port device according to the uplink port device registration information, so as to transmit the bus request based on the target uplink port device.

[0200] The chip simulation device includes an uplink peer device.

[0201] Specifically, Fig.10 As shown, it is a schematic diagram of the service process of the uplink port management module provided in the embodiment of the present application, which specifically includes the following steps:

[0202] S4001: Read the port topology configuration table to obtain the configuration information of the uplink port itself and the corresponding topology configuration information.

[0203] S4002: Obtain the information of the opposite device connected to the simulated PCIe switch upstream port, that is, obtain the configuration information of the upstream opposite device. In the embodiment of the present application, the simulated PCIe switch upstream port is connected to the simulated PCIe RC device, that is, the upstream opposite device is the RC device in the chip simulation device, and the creation of the simulated PCIe RC device is created in the existing simulated PCIe RC model of S1002 in the top-level module initialization process.

[0204] S4003: Check whether the peer device has been initialized;

[0205] If the initialization is completed, go to S4004 and continue the configuration process of the uplink port;

[0206] If initialization is not completed, go to S4007, report the model initialization error, print the error message, and exit the model initialization process.

[0207] S4004: Create an uplink port device. An uplink port refers to a port connected to a higher-level device or system (uplink peer device). It is an exit for data transmission and is used to send data from the current device to an upstream device or network. The created uplink port device refers to a device actually created or configured in the system for connecting to an uplink port. By associating and configuring the created uplink port device with the uplink port, uplink data transmission can be achieved.

[0208] S4005: Get the device handle of the other end. In the embodiment of the present application, the device handle of the other end connected to the uplink port is the RC device handle of the simulated PCIe. When building a simulation system of multiple PCIe switches cascaded, the device handle of the other end connected to the uplink port of the lower-level PCIe switch in the cascade can be the device handle of the downlink port of the upper-level simulated PCIe switch in the cascade, thereby completing the cascade connection. Fig.11 The figure shows a schematic diagram of the cascade topology structure of an exemplary bus exchange simulation device provided in an embodiment of the present application. By distinguishing and binding the upstream port of the simulated PCIe exchange in the downstream port of the simulated PCIe exchange, the cascade of the simulated PCIe exchange is realized, and the device topology of the simulation system is expanded.

[0209] S4006: Register the upstream port device in the peer device. The registered interface is the interface method provided by the RC device handle of the simulated PCIe. After registration, when the RC device of the simulated PCIe receives a bus transaction request, it will search and process the upstream port of the simulated PCIe exchange. When the upstream peer device receives a bus request, it can determine the target upstream port device according to the upstream port device registration information, so as to transmit the bus request based on the target upstream port device.

[0210] Accordingly, in one embodiment, the downlink port management module is specifically configured to:

[0211] In the case where the port topology configuration table cached by the simulation bus exchange topology configuration module includes the downstream port configuration, the configuration information of the downstream opposite device connected to the downstream port is obtained from the port topology configuration table; based on the configuration information of the downstream opposite device, it is verified whether the downstream opposite device has completed the initialization configuration; when it is determined that the downstream opposite device has completed the initialization configuration, a downstream port device is created; the downstream opposite device is registered with the downstream port device, so that when the downstream port device receives a bus request, it can determine the target downstream opposite device according to the registration information of the downstream opposite device, so as to transmit the bus request to the target downstream opposite device.

[0212] The simulation end node includes a downlink peer device.

[0213] Specifically, Fig.12 As shown, it is a schematic diagram of the business process of the downlink port management module provided in the embodiment of the present application, which specifically includes the following steps:

[0214] S5001: Read the port topology configuration table to obtain the configuration information of the downstream port itself and the corresponding topology configuration information.

[0215] S5002: Obtain the information of the opposite device connected to the simulated PCIe switch downstream port. In the example of this case, the simulated PCIe switch downstream port is connected to the simulated PCIe EP device, that is, the downstream opposite device is a simulated end node (EP device), and the creation of the simulated PCIe EP device is performed in the existing simulated PCIe EP model of S1003 in the top-level module initialization process.

[0216] S5003: Check whether the peer device has completed initialization.

[0217] If the initialization is completed, go to S5004 and continue the configuration process of the downstream port;

[0218] If the initialization is not completed, go to S5007, report the model initialization error, print the error message, and exit the model initialization process.

[0219] S5004: Create a downstream port device.

[0220] S5005: Get the device handle of the other end. In this case, the device handle of the other end connected to the downstream port is the EP device handle of the simulated PCIe. When building a simulation system with multiple PCIe switches cascaded, the device handle of the other end connected to the downstream port of the simulated PCIe switch as the upper level can be the device handle of the upstream port of the simulated PCIe switch as the lower level, thereby completing the cascade connection.

[0221] S5006: Register the device handle of the opposite end to the downstream port. The registered interface is an interface method provided by the downstream port management module of the simulated PCIe switch. After registration, when the downstream port of the simulated PCIe switch receives a bus transaction request, the bus transaction request will be forwarded to the device corresponding to the registered downstream port. In the embodiment of the present application, it will be forwarded to the simulated PCIe EP device registered to the downstream port of the simulated PCIe switch for processing.

[0222] Specifically, in one embodiment, the simulated bus exchange addressing module is further used for:

[0223] After determining the target downstream port, determine whether the target downstream port has completed initialization configuration; if it is determined that the target downstream port has completed initialization configuration, forward the bus request to the target downstream port device corresponding to the target downstream port, so as to transmit the bus request to the target downstream opposite device based on the target downstream port device.

[0224] Accordingly, in one embodiment, the simulated bus exchange addressing module is further used for:

[0225] The response result of the bus request sent by the target downstream opposite-end device is received through the target downstream port device; and the response result is fed back to the target upstream opposite-end device through the target upstream port device.

[0226] Specifically, Fig.13 As shown, it is a schematic diagram of the business process of the simulated bus exchange addressing module provided in an embodiment of the present application, which specifically includes the following steps:

[0227] S6001: The uplink port receives a bus transaction request (bus request), wherein the request information of the bus transaction request includes BDF information, Domain information and target address information of the PCIe bus, wherein the target address information may specifically refer to the device memory space address information.

[0228] S6002: Determine the target port number for forwarding according to the BDF information, the Domain information and the target address information, that is, determine the target downlink port device. The BDF information, the Domain information and the target address information generate a port topology configuration table during the process of enumeration and discovery by the software. In the embodiment of the present application, the simulated PCIe switch addressing module can actually search for the target port number for forwarding in the existing port topology configuration table according to the BDF information and the target address information.

[0229] S6003: Check whether the target downstream port corresponding to the target port has been initialized.

[0230] If the target downlink port is initialized, go to S6004 and continue the forwarding process;

[0231] If initialization is not completed, go to S6008, report an inaccessible bus error, print the error information, and return a response message corresponding to the error type.

[0232] S6004: Forward to the target downstream port device corresponding to the target downstream port.

[0233] S6005: Obtain the device handle of the target downstream port device.

[0234] S6006: Obtain the handle of the opposite device (target downstream opposite device) connected to the target downstream port from the device handle of the target downstream port device, and forward the request to the opposite device (target downstream opposite device) connected to the downstream port.

[0235] S6007: Receive a response result sent by the target downstream peer device through the target upstream port device, and return it to the upstream port, so that the response result is fed back to the target upstream peer device through the upstream port device corresponding to the upstream port.

[0236] Specifically, in one embodiment, the response result can be compared with the expected result. The expected result can be determined based on the design specification, test case or known correct behavior. If the response result is consistent with the expected result, it means that the simulation result is correct, that is, it is determined whether the function and performance of the PCIe switch chip simulation configuration meet the user's design requirements. It is also possible to check whether there are errors or abnormalities in the response result. Error codes, warning messages or other abnormal indications may indicate that a problem occurred during the simulation process. It is necessary to further analyze the cause of the error and determine whether corrective measures need to be taken. It is also possible to verify whether the function and performance of the PCIe switch chip simulation configuration meet the requirements based on the type and purpose of the bus request. For example, check the performance indicators of the correctness, speed, bandwidth, etc. of data transmission.

[0237] The embodiment of the present application uses the simulation design of "transaction-level model based on SystemC, bus-level transaction search and distribution". When the simulation system is completed by building a simulated PCIe exchange model based on the transaction-level model of SystemC, the simulated PCIe exchange can perform port search through the request information of the bus, distribute transaction requests according to the search target, complete the data forwarding of the simulated PCIe exchange, and process the response message.

[0238] The embodiment of the present application provides a bus exchange simulation system, including: a chip simulation device, a bus exchange simulation device and several simulation end nodes; the chip simulation device is used to send a bus request to the bus exchange simulation device; the bus exchange simulation device is used to receive the bus request sent by the chip simulation device, and obtain the port topology configuration table, determine the target downstream port of the bus request according to the port topology configuration table and the request information represented by the bus request, and send the bus request to the corresponding simulation end node through the target downstream port; the simulation end node is used to respond to the bus request, obtain the response result of the bus request, and determine the bus exchange simulation result according to the response result of the bus request. The system provided by the above scheme reduces the simulation cost by using the bus exchange simulation device and several simulation end nodes to perform bus simulation exchange, and the bus exchange simulation device and the simulation end node can realize fast debugging based on the software program, thereby improving the efficiency of bus exchange simulation. In addition, the system provided in the embodiment of the present application has high scalability and can connect more simulated external devices, reducing the dependence on hardware resources based on the real hardware debugging environment during software debugging, facilitating the software to build and debug the environment for the chip simulation system model based on PCIe exchange, reducing the cost of software development and debugging, and allowing the software to be developed and debugged in advance before the hardware is completed, thereby shortening the project cycle.

[0239] The embodiment of the present application provides a bus switching simulation method for simulating the configuration of a PCIe switching chip to verify whether the function and performance of the PCIe switching chip meet the design requirements of the user. The execution subject of the embodiment of the present application is an electronic device, such as a server, a desktop computer, a laptop computer, a tablet computer, and other electronic devices that can be used for bus switching simulation.

[0240] like Fig.14 FIG. 1 is a flow chart of a bus switching simulation method provided in an embodiment of the present application, the method comprising:

[0241] Step 1401, sending a bus request to a bus switching simulation device based on a chip simulation device;

[0242] Step 1402, the bus switching simulation device determines the target downstream port of the bus request according to the port topology configuration table and the request information represented by the bus request;

[0243] Step 1403, sending the bus request to the corresponding simulation end node through the target downstream port, so that the simulation end node responds to the bus request and obtains a response result of the bus request;

[0244] Step 1404: Determine the bus exchange simulation result according to the response result of the bus request.

[0245] Regarding the bus switching simulation method in this embodiment, the specific implementation of each step has been described in detail in the embodiment of the system, and will not be elaborated here.

[0246] The bus switching simulation method provided in the embodiment of the present application is applied to the bus switching simulation system provided in the above embodiment. Its implementation method and principle are the same and will not be repeated here.

[0247] An embodiment of the present application provides an electronic device for executing the bus switching simulation method provided in the above embodiment.

[0248] like Fig.15 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 150 includes: at least one processor 1501 and a memory 1502.

[0249] The memory stores computer-executable instructions; at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the bus switching simulation method provided in the above embodiment.

[0250] The electronic device provided in the embodiment of the present application is used to execute the bus switching simulation method provided in the above embodiment. Its implementation method and principle are the same and will not be repeated here.

[0251] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the bus exchange simulation method provided in any of the above embodiments is implemented.

[0252] The storage medium containing computer executable instructions provided in the embodiment of the present application can be used to store the computer executable instructions of the bus exchange simulation method provided in the aforementioned embodiment. The implementation method and principle are the same and will not be repeated here.

[0253] An embodiment of the present application provides a computer program product, including computer instructions, which are used to enable a computer to execute the bus switching simulation method provided in the above-mentioned embodiment.

[0254] The embodiment of the present application provides a computer program product that can be used to execute computer instructions of the bus exchange simulation method provided in the above embodiments. The implementation method and principle are the same and will not be repeated here.

[0255] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0256] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0257] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0258] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.

[0259] A part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0260] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0261] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A bus switching simulation system, characterized in that: include: Chip simulation equipment, bus switching simulation equipment and several simulation end nodes; The chip emulation device is used to send a bus request to the bus switch emulation device; The bus switching simulation device is used to receive the bus request sent by the chip simulation device, and obtain a port topology configuration table, determine the target downstream port of the bus request according to the port topology configuration table and the request information represented by the bus request, and send the bus request to the corresponding simulation end node through the target downstream port; The simulation end node is used to respond to the bus request and obtain a response result of the bus request, so as to determine a bus exchange simulation result according to the response result of the bus request.

2. The system according to claim 1, characterized in that The bus switching simulation device comprises: The simulation bus exchange initialization module is used to create port topology configuration information according to user simulation requirements, and register the simulation port configuration in the top-level configuration module according to the port topology configuration information; A simulation bus switching topology configuration module, used to read the simulation port configuration registration information from the top-level configuration module, and generate and cache a port topology configuration table according to the analysis result of the simulation port configuration registration information; An uplink port management module, configured to initialize the uplink port according to the port topology configuration table when the port topology configuration table cached by the simulated bus switching topology configuration module includes the uplink port configuration; A downstream port management module, configured to initialize the downstream port according to the port topology configuration table when the port topology configuration table cached by the simulated bus switching topology configuration module includes the downstream port configuration; The simulation bus exchange addressing module is used to receive a bus request sent by a chip simulation device, query the target downstream port corresponding to the request information of the bus request in the port topology configuration table, and send the bus request to the corresponding simulation end node through the target downstream port; The port topology configuration table includes a bus identifier combination, a port type, a device configuration space, a device memory space and a device parameter of each service port, and the request information of the bus request includes at least a bus identifier combination.

3. The system according to claim 2, characterized in that The simulated bus exchange initialization module is also used for: Obtain a simulation configuration file; wherein the simulation configuration file at least includes a device name, a device type, the number of bus domains where the device is located, the number of upstream ports, the number of downstream ports, the name of the upstream port, and the name of the downstream port; Initializing and configuring the bus switching simulation device according to the simulation configuration file; Memory resources are applied for according to the number of uplink ports and the number of downlink ports, so as to store the uplink port device information and the downlink port device information based on the applied memory resources.

4. The system according to claim 3, characterized in that The simulation bus switching topology configuration module is also used for: Reading the simulation configuration file; Determining configuration parameter information of the bus switching simulation device according to the simulation configuration file; Verifying the configuration parameter information to determine a configuration verification result of the bus switching simulation device; The configuration parameter information at least includes the device connection status of each service port.

5. The system according to claim 2, characterized in that The uplink port management module is specifically used for: In the case where the port topology configuration table cached by the simulation bus switching topology configuration module includes an uplink port configuration, obtaining configuration information of an uplink opposite-end device connected to the uplink port from the port topology configuration table; Verifying, according to the configuration information of the uplink peer device, whether the uplink peer device has completed initialization configuration; When it is determined that the upstream peer device has completed initialization configuration, creating an upstream port device; Registering the upstream port device with the upstream peer device, so that when the upstream peer device receives a bus request, it determines a target upstream port device according to the upstream port device registration information, so as to transmit the bus request based on the target upstream port device; Wherein, the chip simulation device includes the uplink peer device.

6. The system according to claim 2, characterized in that The downlink port management module is specifically used for: In the case where the port topology configuration table cached by the simulation bus switching topology configuration module includes a downstream port configuration, obtaining configuration information of a downstream opposite-end device connected to the downstream port from the port topology configuration table; Verifying, according to the configuration information of the downstream peer device, whether the downstream peer device has completed initialization configuration; When it is determined that the downstream peer device has completed initialization configuration, creating a downstream port device; Registering the downstream peer device to the downstream port device, so that when the downstream port device receives a bus request, it determines a target downstream peer device according to the registration information of the downstream peer device, so as to transmit the bus request to the target downstream peer device; Wherein, the simulation end node includes the downlink opposite end device.

7. The system according to claim 6, characterized in that The simulated bus exchange addressing module is also used for: After determining the target downlink port, determining whether the target downlink port has completed initialization configuration; When it is determined that the target downstream port has completed initialization configuration, the bus request is forwarded to a target downstream port device corresponding to the target downstream port, so as to transmit the bus request to the target downstream opposite-end device based on the target downstream port device.

8. The system according to claim 7, characterized in that The simulated bus exchange addressing module is also used for: Receiving, through a target downstream port device, a response result of the bus request sent by the target downstream peer device; The response result is fed back to the target upstream opposite-end device through the target upstream port device.

9. A bus switching simulation method, characterized in that: include: Sending a bus request to the bus switching emulation device based on the chip emulation device; Determine the target downstream port of the bus request based on the bus switching simulation device according to the port topology configuration table and the request information represented by the bus request; Sending the bus request to the corresponding simulation end node through the target downstream port, so that the simulation end node responds to the bus request and obtains a response result of the bus request; A bus exchange simulation result is determined according to the response result of the bus request.

10. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-implemented instructions stored in the memory, so that the at least one processor performs the method of claim 9.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the method according to claim 9 is implemented.