Data processing method based on shared memory, electronic equipment and medium

By generating memory models of the same address space during chip development and performing data storage and conversion in different operating paths, the problem of low efficiency in comparing memory data in different languages ​​is solved and efficient data processing and verification is achieved.

CN118568009APending Publication Date: 2024-08-30METAX INTEGRATED CIRCUITS (SHANGHAI) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410680350.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-08-30

Smart Images

  • Figure CN118568009A
    Figure CN118568009A
Patent Text Reader

Abstract

The invention relates to the technical field of chips, in particular to a data processing method based on a shared memory, electronic equipment and a medium, and the method comprises the following steps: S1, generating a first memory model and a second memory model corresponding to a target memory; s2, setting the first memory model and the physical memory in a first operation path, and setting the second memory model in a second operation path; s3, generating i-th target result data based on the first operation path, storing the i-th target result data into the i-th address of the target memory, converting the i-th target result data into Ai, storing the Ai into the i-th address of the first memory model, generating Bi based on the second operation path, and storing the Bi into the i-th address of the second memory model; and S4, converting Bi into data Ci supported by the first description language, if all the data are equal, determining that the verification is passed, otherwise, determining that the verification is not passed. According to the invention, the data processing efficiency between the associative memories is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip technology, and in particular to a data processing method, electronic equipment and medium based on a shared memory. Background Art

[0002] In the chip development process, related processing of different languages ​​is usually involved. For example, chip design is generated based on hardware design language, chip reference model is generated based on high-level language, and data corresponding to different languages ​​are stored in different memories. However, in some scenarios, such as chip joint simulation, it is necessary to compare the data in memories of different languages ​​in an orderly manner. To compare the data in memories of different languages ​​in an orderly manner, a large number of conversion operations need to be performed, and a large number of operations need to be performed to ensure the consistency of data order, which makes the data processing efficiency between associated memories low. It can be seen that how to improve the data processing efficiency between associated memories has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] The present invention aims to provide a data processing method, electronic device and medium based on a shared memory, thereby improving the data processing efficiency between associated memories.

[0004] According to a first aspect of the present invention, there is provided a data processing method based on a shared memory, comprising:

[0005] Step S1, generating a first memory model corresponding to a target memory based on a preset first description language, and generating a second memory model corresponding to the target memory based on a second description language, wherein the target memory is a physical memory, and the first memory model and the second memory model are provided with the same address space as the target memory;

[0006] Step S2, setting the first memory model and the physical memory in a first operation path, setting the second memory model in a second operation path, and the second operation path is used to simulate the first operation path;

[0007] Step S3: Generate the i-th target result data based on the first operation path, where the value of i ranges from 1 to 1, and 1 is the total number of target result data; store the i-th target result data in the i-th address of the target memory, and convert the i-th target result data into data A supported by the first description language; i , A i The first memory model stores the first target result data in the i-th address, and generates the second description language supported data B corresponding to the i-th target result data based on the second operation path. i , B i Stored to the i-th address of the second memory model;

[0008] Step S4: Get B i , and B i Convert to data supported by the first description language C i , compared with C i and A i , if all are equal, the verification passes, otherwise, the verification fails.

[0009] According to a second aspect of the present invention, there is provided an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to execute the method described in the first aspect of the present invention.

[0010] According to a third aspect of the present invention, there is provided a computer-readable storage medium storing computer-executable instructions, wherein the computer instructions are used to execute the method described in the first aspect of the present invention.

[0011] Compared with the prior art, the present invention has obvious advantages and beneficial effects. By means of the above technical solution, the data processing method, electronic device and medium based on shared memory provided by the present invention can achieve considerable technical advancement and practicality, and have wide industrial utilization value, and at least have the following beneficial effects:

[0012] The present invention generates a first memory model and a second memory model with the same address space as a target memory based on different description languages, sets the first memory model and the second memory model in different operation paths, stores corresponding result data in the same address for comparison and verification, and improves the data processing efficiency between associated memories. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0014] Figure 1 A flow chart of a data processing method based on a shared memory provided in an embodiment of the present invention. DETAILED DESCRIPTION

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

[0016] The embodiment of the present invention provides a data processing method based on a shared memory, such as Figure 1 As shown, including:

[0017] Step S1, generating a first memory model corresponding to a target memory based on a preset first description language, and generating a second memory model corresponding to the target memory based on a second description language, wherein the target memory is a physical memory, and the first memory model and the second memory model are provided with the same address space as the target memory.

[0018] It can be understood that, through the above settings, the first memory model and the second memory model share the target memory.

[0019] Step S2: setting the first memory model and the physical memory in a first operation path, and setting the second memory model in a second operation path, wherein the second operation path is used to simulate the first operation path.

[0020] It should be noted that the second operation path simulates the first operation path, so the second operation path and the first operation path need to input the same input data, and store the corresponding target result data in the corresponding positions of the first memory model and the second memory model. The first operation path runs based on the hardware design language, and the second operation path runs based on the second description language.

[0021] Step S3: Generate the i-th target result data based on the first operation path, where the value of i ranges from 1 to 1, and 1 is the total number of target result data; store the i-th target result data in the i-th address of the target memory, and convert the i-th target result data into data A supported by the first description language; i , A i The first memory model stores the first target result data in the i-th address, and generates the second description language supported data B corresponding to the i-th target result data based on the second operation path. i , B i Stored to the i-th address of the second memory model.

[0022] It should be noted that the i-th target result data stored in the physical memory is entity data and cannot be compared with the abstract data in the second operation path. Therefore, in the process of storing the i-th target result data to the i-th address of the target memory, the i-th target result data is also directly abstracted into data supported by the first description language to facilitate subsequent data comparison.

[0023] Step S4: Get B i , and B i Convert to data supported by the first description language C i , compared with C i and A i , if all are equal, the verification passes, otherwise, the verification fails.

[0024] Because B i The corresponding description language is i Different, so it needs to be converted into data C supported by the first description language i , and then compare the data. i It is also an abstract language. Compared with directly reading and converting from physical memory, it saves a lot of processing time and improves the data processing efficiency between associated memories.

[0025] As an embodiment, a series of application programming interfaces (Application Programming Interface, referred to as: API) can be set to access the memory model, and a data conversion interface can be set to realize the conversion between data in different description languages.

[0026] As an embodiment, step S3 includes:

[0027] Step S31: Generate the i-th target result data based on the first operation path, and store the i-th target result data in the i-th address of the target memory.

[0028] Step S32: convert the i-th target result data into data A supported by the first description language through the preset first data conversion interface. i , call the preset first application programming interface to A i The target result data is stored in the i-th address of the first memory model, and the first data conversion interface is used to convert the target result data into data supported by the first description language.

[0029] There are multiple ways to call the preset first application programming interface to write data to the first memory model, which can be flexibly set according to specific application requirements. For example, in step S32, the preset first application programming interface is called to write A to the i-th address of the first memory model in a specified address manner. i, the i-th address is set to the corresponding address range. Among them, the specified address is the data A that needs to be written at present i For example, in step S32, the first application programming interface is called to write A to the i-th address of the first memory model in a manner of preset data width. i The preset data width is 8 bits, 16 bits, 32 bits or 64 bits, etc., and the i-th address is set to the corresponding first address.

[0030] Step S33: the second operation path generates data B supported by the second description language corresponding to the i-th target result data. i , call the preset second application programming interface to set B i Stored to the i-th address of the second memory model.

[0031] There are multiple ways to call the preset second application programming interface to write data to the second memory model, which can be flexibly set according to specific application requirements. For example, in step S33, the preset second application programming interface is called to write B to the i-th address of the second memory model in a specified address manner. i , the i-th address is set to the corresponding address range. Among them, the specified address is the data B that needs to be written at present i For example, in step S33, the preset second application programming interface is called to write B to the i-th address of the second memory model in a manner of a certain data width. i The preset data width is 8 bits, 16 bits, 32 bits or 64 bits, and the i-th address is set to the corresponding first address.

[0032] It should be noted that, during the operation, the progress of the first operation path and the second operation path may be different, but the output data for the same input data must be stored in the same address. Therefore, the first operation path or the second operation path that first outputs the i-th target result data determines the i-th address based on the i-th target result data, and sets the i-th address corresponding to the target memory, the first memory model and the second memory model of the first operation path or the second operation path that has not currently output the i-th target result data to the reserved address corresponding to the i-th target result data. This ensures that the storage of the output data in the target memory, the first memory model and the second memory model is always consistent.

[0033] As an embodiment, the method further includes setting a third application programming interface corresponding to the target memory, setting a fourth application programming interface corresponding to the first memory model, and setting a fifth application programming interface corresponding to the second memory model. The third application programming interface is used to set the reserved storage space in the target memory. The fourth application programming interface is used to set the reserved storage space in the first memory model. The fifth application programming interface is used to set the reserved storage space in the second memory model.

[0034] As an embodiment, the method further includes:

[0035] Step S10: If the first operation path first outputs the i-th target result data corresponding to the i-th input data, first determine the i-th address corresponding to the i-th target result data, store the i-th target result data corresponding to the i-th input data in the i-th address of the target memory, convert the i-th target result data into data that conforms to the SystemVerilog syntax and then store it in the i-th address corresponding to the first memory model, and generate a reserved storage space instruction based on the i-th address.

[0036] Step S20: Based on the reserved storage space instruction, the fifth application programming interface is called to set the i-th address in the second memory model to the reserved address corresponding to the i-th target result data;

[0037] Step S30: When the second operation path outputs the i-th target result data, directly convert the i-th target result data into data conforming to SystemVerilog syntax and then store it in the i-th address corresponding to the second memory model.

[0038] As an embodiment, the method further includes:

[0039] Step S100: If the second operation path first outputs the i-th target result data corresponding to the i-th input data, first determine the i-th address corresponding to the i-th target result data, convert the i-th target result data corresponding to the i-th input data into data that conforms to the SystemVerilog syntax, and then store it in the i-th address corresponding to the second memory model, and generate a reserved storage space instruction based on the i-th address.

[0040] Step S200, based on the reserved storage space instruction, calling the fourth application programming interface to set the i-th address in the first memory model to the reserved address corresponding to the i-th target result data, and based on the reserved storage space instruction, calling the third application programming interface to set the i-th address in the target memory to the reserved address corresponding to the i-th target result data.

[0041] Step S300: When the first operation path outputs the i-th target result data, directly store the i-th target result data corresponding to the i-th input data in the i-th address of the target memory, and convert the i-th target result data into data conforming to the SystemVerilog syntax and store it in the i-th address corresponding to the first memory model.

[0042] As an embodiment, step S4 includes:

[0043] Step S41: Get B i , and B i Based on the preset second data conversion interface, it is converted into data C supported by the first description language i , the second data conversion interface is used to convert the data supported by the second description language into data supported by the first description language;

[0044] Step S42: Compare C i and A i , if all are equal, the verification passes, otherwise, the verification fails.

[0045] As an embodiment, the method can be specifically used in the application scenario of chip joint simulation, the first operation path includes a test platform, a chip design to be tested, a first memory model and a target memory, and a third memory model, wherein the third memory model is also generated based on the first description language, the third memory model and the first memory model can be set in one memory model, the third memory model is used to store test stimulus data according to a preset stimulus sequence, the test platform is used to sequentially obtain test stimulus data from the third memory model and input it to the chip design to be tested, and the chip design to be tested outputs corresponding target result data, and the first description language is SystemVerilog language. The second operation path includes a chip reference model, a second memory model and a fourth memory model, the chip reference model is used to simulate the chip design to be tested, the fourth memory model is generated based on the second description language, the second memory model and the fourth memory model can be set in one memory model, the fourth memory model is used to store test stimulus data according to a preset stimulus sequence, the chip reference model sequentially obtains test stimulus data from the fourth memory model and outputs corresponding target result data, and the second description language is C++, SystemC or Python.

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

[0047] An embodiment of the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the method described in the embodiment of the present invention.

[0048] The embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer instructions are used to execute the method described in the embodiment of the present invention.

[0049] An embodiment of the present invention generates a first memory model and a second memory model with the same address space as a target memory based on different description languages, sets the first memory model and the second memory model in different operation paths, stores corresponding result data in the same address for comparison and verification, and improves the data processing efficiency between associated memories.

[0050] 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 data processing method based on a shared memory, characterized in that: include: Step S1, generating a first memory model corresponding to a target memory based on a preset first description language, and generating a second memory model corresponding to the target memory based on a second description language, wherein the target memory is a physical memory, and the first memory model and the second memory model are provided with the same address space as the target memory; Step S2, setting the first memory model and the physical memory in a first operation path, setting the second memory model in a second operation path, and the second operation path is used to simulate the first operation path; Step S3: Generate the i-th target result data based on the first operation path, where the value of i ranges from 1 to 1, and 1 is the total number of target result data; store the i-th target result data in the i-th address of the target memory, and convert the i-th target result data into data A supported by the first description language; i , A i The first memory model stores the first target result data in the i-th address, and generates the second description language supported data B corresponding to the i-th target result data based on the second operation path. i , B i Stored to the i-th address of the second memory model; Step S4: Get B i , and B i Convert to data supported by the first description language C i , compared with C i and A i , if all are equal, the verification passes, otherwise, the verification fails.

2. The method according to claim 1, characterized in that The step S3 comprises: Step S31, generating the i-th target result data based on the first operation path, and storing the i-th target result data in the i-th address of the target memory; Step S32: convert the i-th target result data into data A supported by the first description language through the preset first data conversion interface. i , call the preset first application programming interface to A i The first data conversion interface is used to convert the target result data into data supported by the first description language; Step S33: the second operation path generates data B supported by the second description language corresponding to the i-th target result data. i , call the preset second application programming interface to set B i Stored to the i-th address of the second memory model.

3. The method according to claim 2, characterized in that In step S32, the preset first application programming interface is called to write A to the i-th address of the first memory model in a manner of specifying the address. i , the i-th address is set to the corresponding address interval; Alternatively, in step S32, a preset first application programming interface is called to write A to the i-th address of the first memory model in a manner of preset data width. i , the i-th address is set to the corresponding first address.

4. The method according to claim 2, characterized in that: In step S33, the preset second application programming interface is called to write B into the i-th address of the second memory model in a manner of specifying the address. i , the i-th address is set to the corresponding address interval; Alternatively, in step S33, a preset second application programming interface is called to write B to the i-th address of the second memory model in a manner of a certain data width. i , the i-th address is set to the corresponding first address.

5. The method according to claim 3 or 4, characterized in that: The preset data width is 8 bits, 16 bits, 32 bits or 64 bits.

6. The method according to claim 1, characterized in that The step S4 comprises: Step S41: Get B i , and B i Based on the preset second data conversion interface, it is converted into data C supported by the first description language i , the second data conversion interface is used to convert the data supported by the second description language into data supported by the first description language; Step S42: Compare C i and A i , if all are equal, the verification passes, otherwise, the verification fails.

7. The method according to claim 1, characterized in that The first description language is SystemVerilog language.

8. The method according to claim 1, characterized in that The second description language is C++, SystemC or Python.

9. An electronic device, characterized in that: include: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions executable by the at least one processor, wherein the instructions are configured to execute the method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: Computer executable instructions are stored, and the computer executable instructions are used to execute the method of any one of the preceding claims 1-8.

Citation Information

Cited By

  • Data acquisition method and device, equipment, storage medium and program product

    CN119203627A

  • Data acquisition method, device, equipment, storage medium and program product

    CN119203627B