Chip joint simulation system based on shared memory
By using shared memory in the chip co-simulation system, the output data of the chip design under test and the chip reference model are converted into SystemVerilog data, which solves the problem of low data storage and conversion efficiency in the existing technology and achieves a more efficient simulation process. .
Patent Information
- Application Number
- CN202410680356.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-08-27
AI Technical Summary
In the current chip joint simulation process, the data storage and conversion efficiency is low, resulting in low simulation efficiency.
Using a system based on shared memory, by setting an area mapped to the first memory in the second memory, the output data of the chip design under test and the chip reference model are converted into SystemVerilog data and stored in the same memory to facilitate subsequent debugging. and compare.
It improves the efficiency of chip joint simulation, makes data conversion and comparison more convenient, and improves the efficiency of the simulation process.
Smart Images

Figure CN118551702A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip technology, and in particular to a chip joint simulation system based on a shared memory. Background Art
[0002] In the chip development process, it is necessary to develop a chip reference model based on the software language and build a chip design based on the hardware language. After the chip reference model is determined, a joint simulation is performed based on the chip reference model and the chip design to verify the chip design. In the prior art, in the joint simulation process, it is necessary to store the data output by the chip reference model in the memory corresponding to the chip reference model, store the data output by the chip design in the corresponding memory, and convert the data of the memory corresponding to the chip reference model and the memory corresponding to the chip design one by one to make them consistent before comparison. The efficiency of the joint simulation is low. Therefore, how to improve the efficiency of chip joint simulation has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The present invention aims to provide a chip co-simulation system based on shared memory, thereby improving the chip co-simulation efficiency.
[0004] According to a first aspect of the present invention, a chip joint simulation system based on a shared memory is provided, comprising: a test platform, a chip design to be tested, a chip reference model, a first memory and a second memory, wherein:
[0005] The test platform is connected to the second memory, the chip design to be tested and the chip reference model respectively, the chip design to be tested is connected to the first memory and the second memory respectively, and the chip reference model is connected to the second memory;
[0006] The first memory is generated based on a hardware description language, the second memory is generated based on a SystemVerilog language, and the chip reference model is generated based on a preset high-level language;
[0007] The second memory includes a first storage area, a second storage area and a third storage area, the first storage area is used to store the joint simulation excitation data, and the second storage area and the third storage area are both mapping areas of the first memory;
[0008] The chip under test is designed to store output data directly in the first memory, and to convert the output data into corresponding SystemVerilog data and then store it in the second storage area;
[0009] The chip reference model is used to convert the output data into corresponding SystemVerilog data and then store them in the third storage area.
[0010] Compared with the prior art, the present invention has obvious advantages and beneficial effects. By means of the above technical solution, the chip joint simulation system based on shared memory provided by the present invention can achieve considerable technical advancement and practicality, and has wide industrial utilization value, and has at least the following beneficial effects:
[0011] The system of the present invention sets a second storage area and a third storage area mapped to the first memory in the second memory, and converts the data output by the chip design to be tested into corresponding SystemVerilog data and then stores them in the second storage area, and converts the data output by the chip reference model into corresponding SystemVerilog data and then stores them in the third storage area. In this way, during the simulation process, the data output by the chip design to be tested and the data output by the chip reference model are both converted into SystemVerilog data and stored in the same memory, which is convenient for subsequent debugging and comparison and improves the efficiency of chip joint simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] 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.
[0013] Figure 1 A schematic diagram of a chip co-simulation system based on shared memory provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0014] 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.
[0015] The embodiment of the present invention provides a chip joint simulation system based on shared memory, such as Figure 1 As shown, it includes: a test platform, a chip design to be tested, a chip reference model, a first memory and a second memory, wherein the test platform is respectively connected to the second memory, the chip design to be tested and the chip reference model, the chip design to be tested is respectively connected to the first memory and the second memory, the chip reference model is connected to the second memory, and the chip reference model is used to simulate the chip design to be tested.
[0016] The first memory is generated based on a hardware description language, for example, the hardware description language may be Verilog or VHDL, etc. The second memory is generated based on SystemVerilog, and the chip reference model is generated based on a preset high-level language, for example, the preset high-level language may be C++, SystemC or Python, etc.
[0017] The second memory includes a first storage area, a second storage area and a third storage area, the first storage area is used to store joint simulation stimulus data, and the joint simulation stimulus data includes test stimulus data. The second storage area and the third storage area are both mapped areas of the first memory. It should be noted that the first memory is a physical memory, and the second storage area and the third storage area are both models that simulate the first memory, so the second storage area and the third storage area have the same address space as the first memory.
[0018] The chip under test is designed to store output data directly in the first memory, and to store the output data in the second storage area after converting it into corresponding SystemVerilog data; it should be noted that, since the data output by the chip under test is Verilog data, and the second storage area is located in the second memory generated based on the SystemVerilog language, it is necessary to convert the data output by the chip under test into SystemVerilog data before storing it in the second storage area. The output data stored in the second storage area by the chip under test is always consistent with the output data stored in the first memory.
[0019] The chip reference model is used to convert the output data into corresponding SystemVerilog data and then store it in the third storage area. It should be noted that since the chip reference model output data is preset high-level language data, and the third storage area is located in the second memory generated based on the SystemVerilog language, it is necessary to first use the reference model to convert the output data into corresponding SystemVerilog data and then store it in the third storage area.
[0020] It should be noted that the system can set a series of application programming interfaces (Application Programming Interface, referred to as: API) for the second memory to access the second memory. As an embodiment, the second memory also includes a first application programming interface corresponding to the first storage area, wherein the test platform is used to call the first application programming interface to sequentially obtain test stimulus data from the first storage area, and send them to the chip design to be tested and the chip reference model respectively, so as to ensure that the chip design to be tested and the chip reference model input the same test stimulus data.
[0021] As an embodiment, the second memory also includes a second application programming interface corresponding to the second storage area and a third application programming interface corresponding to the third storage area. The system also includes a first data conversion interface set between the chip design to be tested and the second storage area and a second data conversion interface set between the chip reference model and the third storage area. The first data conversion interface is used to convert Verilog data into data that conforms to SystemVerilog syntax, and the second data conversion interface is used to convert preset high-level language data into data that conforms to SystemVerilog syntax. Specifically, the chip design to be tested is used to call the first data conversion interface to convert the output data of the chip design to be tested into data that conforms to SystemVerilog syntax, and then call the second application programming interface to store the data converted by the first data conversion interface in the second storage area. The chip reference model is used to call the second data conversion interface to convert the output data of the reference model into data that conforms to SystemVerilog syntax, and then call the third application programming interface to store the data converted by the second data conversion interface in the third storage area. As a result, the output data of the chip design to be tested in the form of SystemVerilog syntax is stored in the second storage area, and the output data of the chip reference model in the form of SystemVerilog syntax is stored in the third storage area, which is convenient for later debugging and data comparison.
[0022] As an embodiment, the test platform is also used to call the first application programming interface to sequentially obtain the i-th test stimulus data from the first storage area, and send the i-th test stimulus data to the chip design to be tested and the chip reference model respectively, and the value range of i is 1 to 1, and I is the total number of test stimulus data. The chip design to be tested is used to store the i-th output data corresponding to the i-th test stimulus data in the i-th address of the first memory. The chip design to be tested is used to convert the i-th output data into data that conforms to the SystemVerilog syntax and then store it in the i-th address corresponding to the second storage area. The chip reference model is used to convert the i-th output data into data that conforms to the SystemVerilog syntax and then store it in the i-th address corresponding to the third storage area.
[0023] It should be noted that, during the joint simulation process, the progress of the chip design to be tested and the chip reference model may be different, but the output data for the same test stimulus must be stored in the same address. Therefore, the chip design to be tested or the chip reference model that outputs the i-th output data first determines the i-th address based on the i-th output data, and the test platform sets the i-th address corresponding to the first memory, the second storage area or the third storage area of the chip design to be tested or the chip reference model that does not currently output the i-th output data to the reserved address corresponding to the i-th output data. This ensures that the storage of the output data in the first memory, the second storage area and the third storage area is always consistent.
[0024] As an embodiment, the second memory further includes a fourth application programming interface corresponding to the second storage area, a fifth application programming interface corresponding to the third storage area, and a sixth application programming interface corresponding to the first memory. The fourth application programming interface is used to set a reserved storage space in the second storage area, the fifth application programming interface is used to set a reserved storage space in the third storage area, and the sixth application programming interface is used to set a reserved storage space in the first memory.
[0025] As an embodiment, if the chip to be tested is designed to first output the i-th output data corresponding to the i-th test stimulus data, the i-th address corresponding to the i-th output data is first determined, the i-th output data corresponding to the i-th test stimulus data is stored in the i-th address of the first memory, the i-th output data is converted into data that conforms to the SystemVerilog syntax and then stored in the i-th address corresponding to the second storage area, and a reserved storage space instruction is generated based on the i-th address. Based on the reserved storage space instruction, the fifth application programming interface is called to set the i-th address in the third storage area to the reserved address corresponding to the i-th output data, and when the chip reference model outputs the i-th output data, the i-th output data is directly converted into data that conforms to the SystemVerilog syntax and then stored in the i-th address corresponding to the third storage area.
[0026] As an embodiment, if the chip reference model first outputs the i-th output data corresponding to the i-th test stimulus data, the i-th address corresponding to the i-th output data is first determined, and the i-th output data corresponding to the i-th test stimulus data is converted into data that conforms to the SystemVerilog syntax and then stored in the i-th address corresponding to the third storage area, and a reserved storage space instruction is generated based on the i-th address. Based on the reserved storage space instruction, the fourth application programming interface is called to set the i-th address in the second storage area to the reserved address corresponding to the i-th output data, and based on the reserved storage space instruction, the sixth application programming interface is called to set the i-th address in the first storage device to the reserved address corresponding to the i-th output data. When the chip to be tested is designed to output the i-th output data, the i-th output data corresponding to the i-th test stimulus data is directly stored in the i-th address of the first storage device. And the i-th output data is converted into data that conforms to the SystemVerilog syntax and then stored in the i-th address corresponding to the second storage area.
[0027] As an embodiment, the test platform is also used to compare the data stored in the i-th address of the first storage area in the second memory with the data stored in the i-th address of the second area. If all are consistent, the joint simulation passes; if not, the joint simulation fails, and subsequent debugging can be performed based on the inconsistent data.
[0028] It should be noted that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0029] The embodiment of the present invention sets a second storage area and a third storage area mapped to the first memory in the second memory, and converts the data output by the chip design to be tested into corresponding SystemVerilog data and then stores them in the second storage area, and converts the data output by the chip reference model into corresponding SystemVerilog data and then stores them in the third storage area. In this way, during the simulation process, the data output by the chip design to be tested and the data output by the chip reference model are both converted into SystemVerilog data and stored in the same memory, which is convenient for subsequent debugging and comparison and improves the efficiency of chip joint simulation.
[0030] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of the technical solution of the present invention.
Claims
1. A chip joint simulation system based on shared memory , It is characterized in that The method comprises: a test platform, a chip design to be tested, a chip reference model, a first memory and a second memory, wherein: The test platform is connected to the second memory, the chip design to be tested and the chip reference model respectively, the chip design to be tested is connected to the first memory and the second memory respectively, and the chip reference model is connected to the second memory; The first memory is generated based on a hardware description language, the second memory is generated based on a SystemVerilog language, and the chip reference model is generated based on a preset high-level language; The second memory includes a first storage area, a second storage area and a third storage area, the first storage area is used to store the joint simulation excitation data, and the second storage area and the third storage area are both mapping areas of the first memory; The chip under test is designed to store output data directly in the first memory, and to convert the output data into corresponding SystemVerilog data and then store it in the second storage area; The chip reference model is used to convert the output data into corresponding SystemVerilog data and then store them in the third storage area.
2. The system according to claim 1, It is characterized in that The second memory also includes a first application programming interface corresponding to the first storage area, wherein: The test platform is used to call the first application programming interface to sequentially obtain test stimulus data from the first storage area, and send them to the chip design to be tested and the chip reference model respectively.
3. The system according to claim 1, It is characterized in that The second memory also includes a second application programming interface corresponding to the second storage area and a third application programming interface corresponding to the third storage area. The system also includes a first data conversion interface provided between the chip design to be tested and the second storage area and a second data conversion interface provided between the chip reference model and the third storage area, wherein: The chip under test is designed to call the first data conversion interface to convert the output data of the chip under test into data conforming to the SystemVerilog syntax, and then call the second application programming interface to store the data converted by the first data conversion interface into the second storage area; The chip reference model is used to call the second data conversion interface to convert the output data of the reference model into data conforming to the SystemVerilog syntax, and then call the third application programming interface to store the data converted by the second data conversion interface into the third storage area.
4. The system according to claim 2, It is characterized in that The chip under test is designed to store the i-th output data corresponding to the i-th test stimulus data into the i-th address of the first memory, where the value range of i is 1 to I, and I is the total number of test stimulus data; The chip under test is designed to convert the i-th output data into data conforming to SystemVerilog syntax and then store it in the i-th address corresponding to the second storage area; The chip reference model is used to convert the i-th output data into data conforming to SystemVerilog syntax and then store the data into the i-th address corresponding to the third storage area.
5. The system according to claim 4, It is characterized in that The chip design under test or chip reference model that first outputs the i-th output data determines the i-th address based on the i-th output data, and the test platform sets the i-th address corresponding to the first memory, second storage area or third storage area of the chip design under test or chip reference model that currently does not output the i-th output data as the reserved address corresponding to the i-th output data.
6. The system according to claim 4, It is characterized in that The test platform is also used to compare the data stored in the i-th address of the first storage area in the second memory with the data stored in the i-th address of the second area. If all are consistent, the joint simulation passes.
7. The system according to claim 1, It is characterized in that The hardware description language is Verilog or VHDL.
8. The system according to claim 1, It is characterized in that The preset high-level language is C++, SystemC or Python.
