A software and hardware co-simulation system, method, electronic device and storage medium

Through the combined software and hardware simulation system, the data packet processing is performed using a private protocol, which solves the problems of high cost and long cycle of Vulkan CTS and HLK verification in graphics card development, and achieves low-cost and efficient simulation verification.

CN119989747BActive Publication Date: 2025-07-04METAX INTEGRATED CIRCUITS (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510466376.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-07-04
Estimated Expiration
2045-04-15

AI Technical Summary

Technical Problem

In the development of graphics graphics card, Vulkan CTS and HLK verification costs are high and have long cycles, Emulator verification costs are high, time-consuming and cannot be run in parallel, Simulator transplantation projects are large and error-prone.

Method used

Using a joint software and hardware simulation system, the first and second protocol conversion modules in the adapter module use private protocols for data packaging and unpacking, implementing interface adaptation between the software and hardware environment, simplifying the driver adaptation process, and allowing independent development and testing of the software and hardware environment.

Benefits of technology

It reduces verification costs, reduces adaptation workload, improves simulation efficiency, realizes joint software and hardware simulation, and shortens the verification cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119989747B_ABST
    Figure CN119989747B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of chip simulation technology, and particularly to a software and hardware co-simulation system, method, electronic device and storage medium, which includes a software driver, an adaptation module and a hardware driver. 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. The first protocol conversion module and the second protocol conversion module respectively perform packing or unpacking according to the agreement of the private protocol, parse the hardware ports in the data packet through the private protocol and call the drivers of the hardware ports, or obtain the hardware ports of the hardware executable information according to the private protocol and perform packing, so as to realize the interface adaptation between the software environment and the hardware environment, achieve the purpose of software and hardware co-simulation, reduce costs at the same time, and reduce the workload of adaptation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of chip simulation, and in particular, to a software and hardware co-simulation system, method, electronic device, and storage medium. Background Art

[0002] In the development field related to graphics cards, Vulkan CTS (Vulkan Compatibility Test Suite) and HLK (Windows Hardware Lab Kit) are a set of software standard test collections specifically for graphics cards. Their core function is to test and verify whether the implementation of the graphics card for the Vulkan and HLK graphics interfaces is correct. Especially in the pre-silicon verification stage, it is necessary to verify the correctness of the chip through the test cases of Vulkan CTS and HLK.

[0003] Currently, the verification work for Vulkan CTS and HLK is carried out on an Emulator. Firstly, the cost of using an Emulator for verification is high, and secondly, the test cycle is long. Because the test sets of Vulkan and HLK themselves are extremely large in scale, the Emulator does not have the ability to run these test sets in parallel, resulting in a long time-consuming for the entire test process, that is, a long verification cycle. Moreover, the long test caused by the serial operation of the Emulator also brings high test costs, greatly affecting the efficiency and benefits of the project.

[0004] To solve the problems of high cost and long verification cycle, Simulator verification can be selected. The 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, the Simulator cannot directly run VKCTS / HLK cases. It is necessary to transplant the VKCTS / HLK cases in the software environment to the Simulator and convert them into Simulator stimuli. The workload of this transplantation operation is extremely large and errors are prone to occur. Therefore, there is an urgent need for a co-simulation method with low cost and less adaptation workload. Summary of the Invention

[0005] For the above technical problems, the technical solution adopted by the present invention is as follows:

[0006] In a first aspect, an embodiment of the present invention provides a software and hardware co-simulation system, and the system includes:

[0007] Software driver, running in a software environment, is used to convert the simulation test tasks sent by the software environment into hardware-executable information; or, is used to issue test tasks according to the parsing result of the second data packet.

[0008] Adapter module, including a first protocol conversion module and a first transport protocol interface module running in a software environment, and a second transport protocol interface module and a second protocol conversion module running in a hardware environment; wherein, a set of private protocols is shared between the first protocol conversion module and the second protocol conversion module; a set of transport protocols is shared between the first transport protocol interface module and the second transport protocol interface module. Wherein, the first protocol conversion module is used to receive and pack the hardware-executable information sent by the software driver and its mapped hardware ports according to the private protocol to obtain a first data packet; or receive the second data packet forwarded by the first transport protocol interface module and parse the second data packet according to the private protocol. Wherein, the first transport protocol interface module and the second transport protocol interface module are interconnected and used to forward the first data packet and the second data packet according to the transport protocol. Wherein, the second protocol conversion module is used to receive the first data packet forwarded by the second transport protocol interface module, parse the first data packet according to the private protocol to obtain the hardware-executable information and its mapped hardware ports, and call a hardware driver running in the hardware environment according to the hardware ports; or, receive and pack the task request initiated by the hardware driver according to the private protocol to obtain the second data packet.

[0009] Hardware driver, running in a hardware environment, is used to convert the hardware-executable information into stimuli, and apply the stimuli to the hardware ports through the interfaces of the hardware ports to implement hardware simulation; or is used to initiate the task request.

[0010] In a second aspect, an embodiment of the present invention provides a software and hardware co-simulation method, and the method includes the following steps:

[0011] S100, obtain a software driver, and the software driver converts N simulation test tasks sent by the software environment into N pieces of hardware-executable information respectively; wherein, N is greater than or equal to 1.

[0012] S200, perform hardware simulation on N simulation test tasks, and the hardware simulation steps of each simulation test task include:

[0013] S210, the first protocol conversion module receives the hardware-executable information of the current simulation test task, obtains the hardware ports for hard-executing the hardware-executable information, and packs the hardware-executable information and its hardware ports into a first data packet according to the private protocol; wherein, the first protocol conversion module runs in a software environment.

[0014] S220, send the first data packet to the second protocol conversion module running in the hardware environment through the first transmission protocol interface module and the second transmission protocol interface module.

[0015] 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 an excitation, and applies the excitation to the hardware port through the interface of the hardware port to realize the simulation of the hardware.

[0016] 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 segment is stored, and the at least one instruction or the at least one program segment is loaded and executed by a processor to implement the above method.

[0017] In addition, the present invention also provides an electronic device, including a processor and the above non-transitory computer-readable storage medium.

[0018] The present invention has at least the following beneficial effects:

[0019] The present invention provides a software and hardware co-simulation system, method, electronic device and storage medium, which respectively perform packaging or unpacking according to the agreement of the private protocol through the first protocol conversion module and the second protocol conversion module in the adaptation module, not only improving the security of data transmission, but also parsing the hardware port in the data packet through the private protocol and calling the driver of the hardware port, and also can obtain the hardware port of the hardware executable information according to the private protocol and perform packaging, realizing the interface adaptation between the software environment and the hardware environment, no longer needing to transplant the driver in the software environment to the hardware environment, simplifying the driver adaptation process, reducing the cost, and having less adaptation workload; at the same time, allowing the software environment and the hardware environment to be different and independently developing and testing respectively, with better flexibility; and at the same time achieving the purpose of software and hardware co-simulation. Description of the Drawings

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained according to these drawings without creative efforts.

[0021] Figure 1Schematic diagram of a software and hardware co - simulation system provided by an embodiment of the present invention;

[0022] Figure 2 Flowchart of a software and hardware co - simulation method provided by an embodiment of the present invention. Detailed implementation manners

[0023] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the present invention.

[0024] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present invention have the same meaning as commonly understood by those skilled in the art.

[0025] Please refer to Figure 1 , which shows a schematic diagram of a software and hardware co - simulation system. The system includes a software driver, an adaptation module, and a hardware driver.

[0026] Further, the software driver runs in a software environment and is used to convert the simulation test tasks sent by the software environment into hardware - executable information; or, it is used to issue test tasks according to the parsing result of the second data packet.

[0027] In one implementation manner, the software environment is any one of a set of test collections for testing and validating the implementation of the Vulkan graphics API (Vulkan Conformance Testing Suite, Vulkan CTS), a set of software standard test collections for graphics cards (Hardware Logo Kit, HLK), and other software application programs.

[0028] Among them, the simulation test task is a sequence of instructions for testing the hardware behavior under the simulation of the real - system operation scenario. The simulation test task is generated by the software environment and is used to imitate various operation requests of the software for the hardware in the actual application scenario, so as to evaluate the functions, performance, and behavioral responses of the hardware under software control. As an example, the software test task is an operation of configuring registers or accessing memory, etc.

[0029] Among them, the hardware - executable information is a signal, instruction, or data format that the hardware can directly understand and process, and is mainly used to transfer the operation intention between the software environment and the hardware driver. It is the software environment that specifies the data content of the tasks or operations to be executed by the hardware.

[0030] Further, 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, a set of private protocols is shared between the first protocol conversion module and the second protocol conversion module; and a set of transmission protocols is shared between the first transmission protocol interface module and the second transmission protocol interface module.

[0031] In one embodiment, the private protocol at least includes specifications of each hardware port and its identity identifier. As an example, the identity identifier of the hardware port corresponding to the power-on operation is 00, the identity identifier of the hardware port corresponding to the reset release operation is 01, the identity identifier of the hardware port for normal test task instructions is 10, and so on.

[0032] In one embodiment, 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 data transmission also fall within the protection scope of the present invention.

[0033] Further, the first protocol conversion module is configured to receive and package the hardware executable information sent by the software driver and its mapped hardware port 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.

[0034] In one embodiment, the hardware port is configured in the header of the first data packet.

[0035] Among them, the hardware port is an abstract representation of an actual physical port and is a hardware interface for receiving incentives of hardware executable information. As an example, the hardware port is a register interface or a memory interface, etc.

[0036] It should be noted that the first protocol conversion module can both package and unpack.

[0037] Further, the first transmission protocol interface module and the second transmission protocol interface module are interconnected and are configured to forward the first data packet and the second data packet according to the transmission protocol.

[0038] In one embodiment, the transmission protocol is the TCP / IP protocol or the Hypertext Transfer Protocol. Other types of transmission protocols also fall within the protection scope of the present invention.

[0039] Further, the second protocol conversion module is configured 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 pack the task request initiated by the hardware driver according to the private protocol to obtain the second data packet.

[0040] 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 pack and unpack.

[0041] Further, the hardware driver runs in the hardware environment and is configured to convert the hardware executable information into an excitation, apply the excitation to the hardware port through the interface of the hardware port to implement the simulation of the hardware; or to initiate the task request.

[0042] Among them, the excitation is a signal that directly triggers the physical circuits and logic units inside the hardware device to work. The excitation is generated after the hardware executable information is processed and converted by the hardware driver. For example, the excitation can be an electrical signal, a specific command sequence, or a data format. As an example, when performing a register operation to configure a timer, the hardware driver converts the timer configuration parameters extracted from the data packet into an excitation for the corresponding register write operation. For example, the configuration parameters are the timing period and the working mode, etc., and the excitation for the write operation is applied through the hardware ports corresponding to the timer module to implement the simulation or actual control of the timer function. Among them, the hardware ports corresponding to the timer module are the data input pin, address selection pin, write enable pin, etc. of the register.

[0043] 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 drivers of the corresponding hardware ports according to the hardware ports in the data packet through the private protocol, realizing the interface adaptation between the software environment and the hardware environment. There is no need to transplant the drivers 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 develop and test independently. The adaptation module completes the docking of the software and hardware environments, improves the simulation efficiency, and achieves the purpose of software and hardware co-simulation.

[0044] Based on the same inventive concept as the system embodiment, please refer to Figure 2 , the present invention also provides a software and hardware co-simulation method, and the method includes the following steps:

[0045] S100, Obtain software drivers, where the software drivers convert N simulation test tasks sent by the software environment into N pieces of hardware-executable information respectively; where N is greater than or equal to 1.

[0046] In one implementation, each of the N simulation test tasks has a unique identity identifier. Each simulation test task is a task in response to a registration request initiated by the hardware, and this unique identity identifier is the unique identity identifier in the registration request initiated by the hardware.

[0047] In one implementation, before S100, it further 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.

[0048] In one implementation, the emulator is a simulator, and other types of emulators also fall within the protection scope of the present invention.

[0049] S200, Perform hardware simulation on N simulation test tasks.

[0050] In one implementation, the N simulation test tasks are executed serially one by one.

[0051] In one implementation, the method further includes a parallel execution mode. In the parallel execution mode, the N simulation test tasks are executed in parallel, and each simulation test task respectively executes S210 - S230. Among them, in S220, different simulation test tasks communicate through different network configurations, and each network configuration transmits one simulation test task. The network configuration is the interconnected first transmission protocol interface module and the second transmission protocol interface module. It should be noted that when performing simulation on the simulator, combined with the adaptation module provided by the embodiment of the present invention, hardware port information is added to each simulation test task through a private protocol, and communication is carried out with the hardware environment through different network configurations, so that the hardware environment can obtain the data packets of the N simulation test tasks through different network configurations, realizing the parallel execution of the simulation test tasks, improving the simulation efficiency, making full use of the hardware resources, and shortening the verification cycle. The traditional verification method through the emulator cannot execute the corresponding simulation test tasks in parallel.

[0052] Furthermore, the hardware simulation steps of each simulation test task include:

[0053] S210, the first protocol conversion module receives the hardware executable information of the current simulation test task, obtains the hardware ports for hard-executing the hardware executable information, and packs the hardware executable information and its hardware ports into a first data packet according to a private protocol; wherein, the first protocol conversion module runs in a software environment.

[0054] 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.

[0055] 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 ports and the hardware executable information, and calls a hardware driver running in the hardware environment according to the hardware ports; wherein, the second protocol conversion module runs in the hardware environment; the hardware driver converts the hardware executable information into an excitation, and applies the excitation to the hardware ports through the interfaces of the hardware ports to implement the simulation of the hardware.

[0056] In one embodiment, the hardware is one or both of HW DUT (Hardware Device Under Test) and Cmodel, and other types of hardware platforms also fall within the protection scope of the present invention.

[0057] In one embodiment, compare the test results of the software environment and the test results of the hardware environment. If they are the same, the test passes; otherwise, the test fails.

[0058] It should be noted that in the software environment, the first data packet is repacked with a specific packet header according to the transmission protocol 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 data packets through the transmission protocol.

[0059] In summary, the software and hardware co-simulation method provided by the present invention uses a first transmission protocol interface module and a second transmission protocol interface module of a set of transmission protocols to dock data packets transmitted between a software environment and a hardware environment, and uses a first protocol conversion module and a second protocol conversion module of the same set of private protocols to package or unpack instructions for corresponding tasks, 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 workload, but also allows the software environment and the hardware environment to be different and develop and test independently, improving the simulation efficiency and achieving the purpose of software and hardware co-simulation.

[0060] 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 segment of a program related to a method in the method embodiment. The at least one instruction or the at least one segment of the program is loaded and executed by the processor to implement the method provided in the above embodiment.

[0061] An embodiment of the present invention also provides an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0062] An embodiment of the present invention also provides a computer program product, which includes program code. When the program product runs on an electronic device, the program code is used to cause the electronic device to execute the steps in the methods according to various exemplary embodiments of the present invention described above in this specification.

[0063] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is used as an example. In practical applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.

[0064] Although some specific embodiments of the present invention have been described in detail by way of examples, those skilled in the art should understand that the above examples are only for illustration and not for limiting the scope of the present invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the present invention. The scope disclosed by the present invention is defined by the appended claims.

Claims

1. A software and hardware co-simulation system, characterized in that The system includes: A software driver, running in a software environment, for converting the simulation test tasks sent by the software environment into hardware-executable information; or, for issuing test tasks according to the parsing result of the second data packet; An adaptation module, including a first protocol conversion module and a first transport protocol interface module running in the software environment, and a second transport protocol interface module and a second protocol conversion module running in the hardware environment; wherein, a set of private protocols is shared between the first protocol conversion module and the second protocol conversion module; a set of transport protocols is shared between the first transport protocol interface module and the second transport protocol interface module; wherein, the private protocol at least includes the specifications of each hardware port and its identity identifier; Wherein, the first protocol conversion module is used to receive and package the hardware-executable information sent by the software driver and its mapped hardware port according to the private protocol to obtain a first data packet; or receive the second data packet forwarded by the first transport protocol interface module, and parse the second data packet according to the private protocol; Wherein, the first transport protocol interface module and the second transport protocol interface module are interconnected for forwarding the first data packet and the second data packet according to the transport protocol; Wherein, the second protocol conversion module is used to receive the first data packet forwarded by the second transport 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; A hardware driver, running in the hardware environment, for converting the hardware-executable information into an excitation, and applying the excitation to the hardware port through the interface of the hardware port to implement the simulation of the hardware; or for initiating the task request.

2. The system according to claim 1, characterized in that The hardware port is configured with the header of the first data packet.

3. The system according to claim 1, characterized in that, The transport protocol is the TCP / IP protocol or the HyperText Transfer Protocol.

4. A software and hardware co-simulation method, characterized in that, The method includes the following steps: S100, obtain a software driver, and the software driver converts N simulation test tasks sent by the software environment into N pieces of hardware-executable information respectively; wherein, N is greater than or equal to 1; S200, perform hardware simulation on the N simulation test tasks, and 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, and obtains the hardware port for hard-executing the hardware-executable information, and packages the hardware-executable information and the hardware port into a first data packet according to the private protocol; wherein, the first protocol conversion module runs in the software environment; S220, send the first data packet to the second protocol conversion module running in the hardware environment through the first transport protocol interface module and the second transport 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 an excitation, and applies the excitation to the hardware port through the interface of the hardware port to implement hardware simulation.

5. The method according to claim 4, characterized in that, Before the S100, it further includes: S00, when the 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 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.

6. The method according to claim 5, characterized in that, The N simulation test tasks in S200 are executed in parallel.

7. The method according to claim 4, characterized in that, Each of the N simulation test tasks has a unique identity identifier.

8. A non-transitory computer-readable storage medium storing at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program segment is loaded and executed by a processor to implement the method according to any one of claims 4-7.

9. An electronic device, characterized in that, It includes a processor and the non-transitory computer-readable storage medium described in claim 8.