Software and hardware joint simulation system and method, electronic equipment and storage medium
Through the combined software and hardware simulation system, the coordinated work of software drivers, adaptation modules and hardware drivers is used to solve the problems of high cost and long cycle of graphics graphics card verification in the existing technology, and efficient simulation verification and independent software and hardware environment development are achieved.
Patent Information
- Application Number
- CN202510466376.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-04-15
AI Technical Summary
When verifying the Vulkan CTS and HLK implementation of graphics graphics cards, the use of simulators for verification results in high costs and long verification cycles, and the simulator cannot directly run VKCTS/HLK case, requiring huge transplant project volume.
Provides a joint software and hardware simulation system, through the coordinated work of software drivers, adaptation modules and hardware drivers, to realize information adaptation between the software environment and the hardware environment. The software driver converts the simulation test tasks into hardware executable information, and the adapter module uses a private protocol to package and unpack data. The hardware driver converts the hardware executable information into incentives and applies it to the hardware port to realize simulation.
It reduces the cost and cycle of simulation verification, simplifies the driver adaptation process, allows independent development and testing of software and hardware environments, improves simulation efficiency, and realizes joint software and hardware simulation.
Smart Images

Figure CN119989747A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip simulation technology, and in particular to a software and hardware joint simulation system, method, electronic equipment and storage medium. Background Art
[0002] In the field of graphics card development, Vulkan CTS (Vulkan Compatibility Test Suite) and HLK (Windows Hardware Lab Kit) are a set of software standard tests specifically for graphics cards. Their core function is to test and verify whether the graphics card implements Vulkan and HLK graphics interfaces correctly. Especially in the pre-silicon verification stage, the correctness of the chip needs to be verified through VulkanCTS test cases and HLK test cases.
[0003] Currently, the verification of Vulkan CTS and HLK is performed on the Emulator. The cost of Emulator verification is high, and the test cycle is long. Because the test sets of Vulkan and HLK are extremely large, the Emulator does not have the ability to run these test sets in parallel, which makes the entire test process time-consuming, that is, the verification cycle is long. Not only that, the long test time caused by the serial operation of the Emulator also brings high test costs, which greatly affects the efficiency and benefits of the project.
[0004] In order to solve the problems of high cost and long verification cycle, Simulator verification can be selected. Simulator runs on a general-purpose computer, such as a CPU. However, due to the huge difference between the software working environment and the hardware working environment, Simulator cannot directly run VKCTS / HLK cases. It is necessary to transplant the VKCTS / HLK cases in the software environment to Simulator and convert them into Simulator stimuli. The amount of engineering for this transplant operation is very large and it is very easy to make mistakes. Therefore, there is an urgent need for a joint simulation method that can be low-cost and has a small amount of adaptation engineering. Summary of the invention
[0005] In view of the above technical problems, the technical solution adopted by the present invention is: In a first aspect, an embodiment of the present invention provides a software and hardware joint simulation system, the system comprising: The software driver runs in the software environment and is used to convert the simulation test task sent by the software environment into hardware executable information; or to send the test task according to the parsing result of the second data packet.
[0006] The adapter module includes a first protocol conversion module and a first transmission protocol interface module running in a software environment, and a second transmission protocol interface module and a second protocol conversion module running in a hardware environment; wherein the first protocol conversion module and the second protocol conversion module share a set of private protocols; and the first transmission protocol interface module and the second transmission protocol interface module share a set of transmission protocols. The first protocol conversion module is used to receive and package the hardware executable information and its mapped hardware port sent by the software driver according to the private protocol to obtain a first data packet; or receive a second data packet forwarded by the first transmission protocol interface module, and parse the second data packet according to the private protocol. The first transmission protocol interface module and the second transmission protocol interface module are interconnected, and are used to forward the first data packet and the second data packet according to the transmission protocol. The second protocol conversion module is used to receive the first data packet forwarded by the second transmission protocol interface module, parse the first data packet according to the private protocol to obtain the hardware executable information and its mapped hardware port, and call the hardware driver running in the hardware environment according to the hardware port; or receive and package the task request initiated by the hardware driver according to the private protocol to obtain the second data packet.
[0007] The hardware driver runs in the hardware environment and is used to convert the hardware executable information into stimulus, and apply the stimulus to the hardware port through the interface of the hardware port to realize the simulation of the hardware; or to initiate the task request.
[0008] In a second aspect, an embodiment of the present invention provides a software and hardware joint simulation method, the method comprising the following steps: S100, obtaining a software driver, wherein the software driver converts N simulation test tasks sent by the software environment into N hardware executable information respectively; wherein N is greater than or equal to 1.
[0009] S200, performing hardware simulation on N simulation test tasks, wherein the hardware simulation steps of each simulation test task include: S210, the first protocol conversion module receives the hardware executable information of the current simulation test task, obtains the hardware port for rigidly executing the hardware executable information, and packages the hardware executable information and its hardware port into a first data packet according to a private protocol; wherein the first protocol conversion module runs in a software environment.
[0010] S220: Send the first data packet to a second protocol conversion module running in a hardware environment through a first transmission protocol interface module and a second transmission protocol interface module.
[0011] S230, the second protocol conversion module receives the first data packet, parses the first data packet according to the private protocol to obtain the hardware port and hardware executable information, and calls the hardware driver running in the hardware environment according to the hardware port; wherein the second protocol conversion module runs in the hardware environment; the hardware driver converts the hardware executable information into a stimulus, and applies the stimulus to the hardware port through the interface of the hardware port to realize the simulation of the hardware.
[0012] In addition, the present invention also provides a non-transitory computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the above method.
[0013] In addition, the present invention also provides an electronic device, including a processor and the above-mentioned non-transitory computer-readable storage medium.
[0014] The present invention has at least the following beneficial effects: The present invention provides a software-hardware joint simulation system, method, electronic device and storage medium, which respectively perform packaging or unpacking according to the agreement of a private protocol through a first protocol conversion module and a second protocol conversion module in an adaptation module, which not only improves the security of data transmission, but also parses the hardware port in the data packet through the private protocol and by calling the driver of the hardware port, it can also obtain the hardware port of the hardware executable information according to the private protocol and package it, thereby realizing interface adaptation of the software environment and the hardware environment, and no longer needs to transplant the driver in the software environment to the hardware environment, thereby simplifying the driver adaptation process, reducing the cost and reducing the workload of adaptation; at the same time, it allows the software environment and the hardware environment to be different, and each can be developed and tested independently, which has better flexibility; and also achieves the purpose of software-hardware joint simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0016] Figure 1 A schematic diagram of a software and hardware joint simulation system provided by an embodiment of the present invention; Figure 2A flowchart of a software and hardware joint simulation method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0018] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present invention have the same meanings as commonly understood by those skilled in the art.
[0019] See also Figure 1 , which shows a schematic diagram of a software-hardware joint simulation system, the system including a software driver, an adaptation module and a hardware driver.
[0020] Furthermore, the software driver runs in the software environment, and is used to convert the simulation test task sent by the software environment into hardware executable information; or, to send the test task according to the parsing result of the second data packet.
[0021] In one embodiment, the software environment is any software application such as a set of tests for testing and verifying Vulkan graphics API implementation (Vulkan Conformance Testing Suite, Vulkan CTS), a set of software standard tests for graphics cards (Hardware Logo Kit, HLK), etc.
[0022] Among them, the simulation test task is an instruction sequence that simulates the hardware behavior in the real system operation scenario. The simulation test task is generated by the software environment and is used to imitate the various operation requests of the software to the hardware in the actual application scenario, and then evaluate the function, performance and behavior response of the hardware under the control of the software. As an example, the software test task is the operation of configuring registers or accessing memory.
[0023] Among them, hardware executable information is a signal, instruction or data format that can be directly understood and processed by the hardware. It is mainly used to transmit operation intentions between the software environment and the hardware driver. The software environment specifies the data content of the tasks or operations to be performed by the hardware.
[0024] Furthermore, the adaptation module includes a first protocol conversion module and a first transmission protocol interface module running in a software environment, and a second transmission protocol interface module and a second protocol conversion module running in a hardware environment; wherein the first protocol conversion module and the second protocol conversion module share a set of private protocols; and the first transmission protocol interface module and the second transmission protocol interface module share a set of transmission protocols.
[0025] In one embodiment, the private protocol at least includes specifications of each hardware port and its identity. As an example, the identity of the hardware port corresponding to the power-on operation is 00, the identity of the hardware port corresponding to the reset operation is 01, and the identity of the hardware port of the normal test task instruction is 10, etc.
[0026] In one implementation, the transmission protocol is the TCP / IP (Transmission Control Protocol / Internet Protocol) protocol or the Hypertext Transfer Protocol (HTTP) protocol. Other types of interface protocols for transmitting data also fall within the protection scope of the present invention.
[0027] Furthermore, the first protocol conversion module is used to receive and package the hardware executable information and its mapped hardware port sent by the software driver according to the private protocol to obtain a first data packet; or receive a second data packet forwarded by the first transmission protocol interface module, and parse the second data packet according to the private protocol.
[0028] In one implementation, the hardware port is configured in a header of the first data packet.
[0029] The hardware port is an abstract representation of an actual physical port, and is a hardware interface for receiving stimulation of hardware executable information. As an example, the hardware port is a register interface or a memory interface.
[0030] It should be noted that the first protocol conversion module can both pack and unpack.
[0031] Furthermore, the first transmission protocol interface module and the second transmission protocol interface module are interconnected and used to forward the first data packet and the second data packet according to the transmission protocol.
[0032] In one embodiment, the transmission protocol is TCP / IP or Hypertext Transfer Protocol. Other types of transmission protocols also fall within the protection scope of the present invention.
[0033] Furthermore, the second protocol conversion module is used to receive the first data packet forwarded by the second transmission protocol interface module, and parse the first data packet according to the private protocol to obtain the hardware executable information and its mapped hardware port, and call the hardware driver running in the hardware environment according to the hardware port; or, receive and package the task request initiated by the hardware driver according to the private protocol to obtain the second data packet.
[0034] It should be noted that the first protocol conversion module and the second protocol conversion module share a set of private protocols, and the software driver and the hardware driver share a set of driver protocols. The second protocol conversion module can both package and unpack.
[0035] Furthermore, the hardware driver runs in the hardware environment and is used to convert the hardware executable information into stimulus, and apply the stimulus to the hardware port through the interface of the hardware port to realize the simulation of the hardware; or to initiate the task request.
[0036] Among them, the stimulus is a signal that directly triggers the physical circuits and logic units inside the hardware device to work. The stimulus is generated after the hardware executable information is processed and converted by the hardware driver. For example, the stimulus can be an electrical signal, a specific command sequence or a data format. As an example, when executing the register operation of configuring the timer, the hardware driver converts the timer configuration parameters extracted from the data packet into the stimulus of the corresponding register write operation, such as the configuration parameters are the timing period and the working mode, etc., and applies the stimulus of the write operation through the hardware port corresponding to the timer module to realize the simulation or actual control of the timer function. Among them, the hardware ports corresponding to the timer module are the data input pins, address selection pins and write enable pins of the register.
[0037] Among them, the first protocol conversion module and the second protocol conversion module in the adaptation module respectively pack or unpack the data packet according to the agreement of the private protocol, which not only improves the security of data transmission, but also can call the driver of the corresponding hardware port according to the hardware port in the data packet through the private protocol, so as to realize the interface adaptation of the software environment and the hardware environment. It is no longer necessary to transplant the driver in the software environment to the hardware environment, which simplifies the driver adaptation process. At the same time, it allows the software environment and the hardware environment to be different, and each can be developed and tested independently. The docking of the software and hardware environments is completed through the adaptation module, which improves the simulation efficiency and achieves the purpose of software and hardware joint simulation.
[0038] Based on the same inventive concept as the system embodiment, please refer to Figure 2 The present invention also provides a software and hardware joint simulation method, the method comprising the following steps: S100, obtaining a software driver, wherein the software driver converts N simulation test tasks sent by the software environment into N hardware executable information respectively; wherein N is greater than or equal to 1.
[0039] In one implementation, each of the N simulation test tasks has a unique identity. Each simulation test task is a task that responds to a registration request initiated by hardware, and the unique identity is a unique identity in the registration request initiated by hardware.
[0040] In one embodiment, before S100, it also includes: S00, when the hardware emulator starts N simulation test tasks, each simulation test task calls the registration interface in the second protocol conversion module, and sends a registration request to the first protocol conversion module respectively through the first transmission protocol interface module and the second transmission protocol interface module in the N adaptation modules according to the N registration interfaces; the registration request is used to trigger the software environment to start N simulation test tasks.
[0041] In one implementation, the emulator is a simulator, and other types of emulators also fall within the protection scope of the present invention.
[0042] S200, performing hardware simulation on N simulation test tasks.
[0043] In one implementation, the N simulation test tasks are executed serially one by one.
[0044] In one embodiment, the method further includes a parallel execution mode, in which N simulation test tasks are executed in parallel, and each simulation test task executes S210-S230 respectively, wherein different simulation test tasks in S220 communicate through different network configurations, and each network configuration transmits a simulation test task, and the network configuration is a first transmission protocol interface module and a second transmission protocol interface module that are interconnected. It should be noted that the simulation is performed on the simulator, and at the same time, in combination with the adapter module provided in the embodiment of the present invention, hardware port information is added to each simulation test task through a private protocol, and the hardware environment is communicated through different network configurations, so that the hardware environment can obtain data packets of N simulation test tasks through different network configurations, thereby realizing the parallel execution of simulation test tasks, improving simulation efficiency, making full use of hardware resources, and shortening the verification cycle. However, the traditional method of verification through an emulator cannot execute the corresponding simulation test tasks in parallel.
[0045] Furthermore, the hardware simulation steps of each simulation test task include: S210, the first protocol conversion module receives the hardware executable information of the current simulation test task, obtains the hardware port for rigidly executing the hardware executable information, and packages the hardware executable information and its hardware port into a first data packet according to a private protocol; wherein the first protocol conversion module runs in a software environment.
[0046] S220: Send the first data packet to a second protocol conversion module running in a hardware environment through a first transmission protocol interface module and a second transmission protocol interface module.
[0047] S230, the second protocol conversion module receives the first data packet, parses the first data packet according to the private protocol to obtain the hardware port and hardware executable information, and calls the hardware driver running in the hardware environment according to the hardware port; wherein the second protocol conversion module runs in the hardware environment; the hardware driver converts the hardware executable information into a stimulus, and applies the stimulus to the hardware port through the interface of the hardware port to realize the simulation of the hardware.
[0048] In one implementation, the hardware is one or both of HW DUT (Hardware Device Under Test) and Cmodel. Other types of hardware platforms also fall within the protection scope of the present invention.
[0049] In one implementation, the test result of the software environment is compared with the test result of the hardware environment. If the two are consistent, the test passes; otherwise, the test fails.
[0050] It should be noted that, in the software environment, a specific packet header is added to the first data packet according to the transmission protocol and repackaged into a specific data packet suitable for transmission by the current transmission protocol; after the specific data packet is transmitted to the hardware environment according to the transmission protocol, the specific packet header of the specific data packet is removed according to the transmission protocol and restored to the first data packet, and the first data packet is sent to the second protocol conversion module. That is, the first data packet obtained by the second protocol conversion module is the same as the first data packet output by the first protocol conversion module in the software environment, achieving the purpose of transmitting the data packet through the transmission protocol.
[0051] In summary, the present invention provides a method for joint simulation of software and hardware, which connects the data packets transmitted between the software environment and the hardware environment by using the first transmission protocol interface module and the second transmission protocol interface module of a set of transmission protocols, and uses the first protocol conversion module and the second protocol conversion module of the same set of private protocols to pack or unpack the instructions of the corresponding tasks, thereby realizing information adaptation between the software environment and the hardware environment. Compared with the traditional transplantation method, it not only has low cost and less adaptation engineering, but also allows the software environment and the hardware environment to be different, and each can be developed and tested independently, thereby improving the simulation efficiency and achieving the purpose of joint simulation of software and hardware.
[0052] An embodiment of the present invention also provides a non-transitory computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to implementing a method in a method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiment.
[0053] An embodiment of the present invention further provides an electronic device, comprising a processor and the aforementioned non-transitory computer-readable storage medium.
[0054] An embodiment of the present invention further provides a computer program product, which includes program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the method according to various exemplary embodiments of the present invention described above in this specification.
[0055] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0056] Although some specific embodiments of the present invention have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It should also be understood by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.
Claims
1. A software and hardware joint simulation system, characterized in that: The system comprises: A software driver, running in the software environment, for converting the simulation test task sent by the software environment into hardware executable information; or for issuing the test task according to the parsing result of the second data packet; The adaptation module includes a first protocol conversion module and a first transmission protocol interface module running in a software environment, and a second transmission protocol interface module and a second protocol conversion module running in a hardware environment; wherein the first protocol conversion module and the second protocol conversion module share a set of private protocols; and the first transmission protocol interface module and the second transmission protocol interface module share a set of transmission protocols; The first protocol conversion module is used to receive and package the hardware executable information and its mapped hardware port sent by the software driver according to the private protocol to obtain a first data packet; or receive a second data packet forwarded by the first transmission protocol interface module, and parse the second data packet according to the private protocol; Wherein, the first transmission protocol interface module and the second transmission protocol interface module are interconnected and used to forward the first data packet and the second data packet according to the transmission protocol; The second protocol conversion module is used to receive the first data packet forwarded by the second transmission protocol interface module, and parse the first data packet according to the private protocol to obtain the hardware executable information and the hardware port mapped thereto, and call the hardware driver running in the hardware environment according to the hardware port; or, receive and package the task request initiated by the hardware driver according to the private protocol to obtain the second data packet; The hardware driver runs in the hardware environment and is used to convert the hardware executable information into stimulus, and apply the stimulus to the hardware port through the interface of the hardware port to realize the simulation of the hardware; or to initiate the task request.
2. The system according to claim 1, characterized in that The private protocol at least includes the specifications of each hardware port and its identity.
3. The system according to claim 1, characterized in that The hardware port is configured with a header of the first data packet.
4. The system according to claim 1, characterized in that The transmission protocol is TCP / IP protocol or Hypertext Transfer Protocol.
5. A software and hardware joint simulation method, characterized in that: The method comprises the following steps: S100, obtaining a software driver, wherein the software driver converts N simulation test tasks sent by the software environment into N hardware executable information respectively; wherein N is greater than or equal to 1; S200, performing hardware simulation on N simulation test tasks, wherein the hardware simulation steps of each simulation test task include: S210, the first protocol conversion module receives the hardware executable information of the current simulation test task, obtains the hardware port for rigidly executing the hardware executable information, and packages the hardware executable information and the hardware port into a first data packet according to a private protocol; wherein the first protocol conversion module runs in a software environment; S220, sending the first data packet to a second protocol conversion module running in a hardware environment through a first transmission protocol interface module and a second transmission protocol interface module; S230, the second protocol conversion module receives the first data packet, parses the first data packet according to the private protocol to obtain the hardware port and hardware executable information, and calls the hardware driver running in the hardware environment according to the hardware port; wherein the second protocol conversion module runs in the hardware environment; the hardware driver converts the hardware executable information into a stimulus, and applies the stimulus to the hardware port through the interface of the hardware port to realize the simulation of the hardware.
6. The method according to claim 5, characterized in that The S100 also includes: S00, when the simulator starts N simulation test tasks, each simulation test task calls the registration interface in the second protocol conversion module, and sends a registration request to the first protocol conversion module through the first transmission protocol interface module and the second transmission protocol interface module according to the registration interface; the registration request is used to trigger the software environment to start N simulation test tasks.
7. The method according to claim 6, characterized in that The N simulation test tasks in S200 are executed in parallel.
8. The method according to claim 5, characterized in that Each of the N simulation test tasks has a unique identity.
9. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the storage medium, characterized in that: The at least one instruction or the at least one program is loaded and executed by the processor to implement the method as claimed in any one of claims 5 to 8.
10. An electronic device, characterized in that: The invention comprises a processor and the non-transitory computer-readable storage medium as claimed in claim 9.
Citation Information
Patent Citations
Coverage-driven software and hardware cooperative SOPC function verification method and system
CN108563545A
Method and device for identifying action information in private industrial control protocol, and storage medium
CN112187583A
Software and hardware co-simulation verification method and device and medium
CN112861468A
Transaction transacter rapid design method based on universal bus
CN117494624A
Data transmission method and communication system of processing card based on PCIe protocol
CN118295954A