Code model generation method, code model verification method and related apparatus
By generating a target code model and removing attributes that are not invoked in UVM verification, the problem of slow simulation speed caused by the complexity of the code model is solved, thereby improving simulation efficiency and code reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HAIGUANG INTEGRATED CIRCUIT DESIGN (BEIJING) CO LTD
- Filing Date
- 2024-11-18
- Publication Date
- 2026-04-21
AI Technical Summary
In integrated circuit and SoC design, the code model is relatively complex during UVM verification, resulting in slow simulation speed and high resource consumption. Furthermore, building a model yourself may lead to high learning costs and difficulties for upper-layer SoC users.
By obtaining the attribute information of the original code model, the attributes that are called during the simulation verification process are determined, the target code model is generated, redundant attributes that are not called are eliminated, and the code model structure is simplified.
It improves the efficiency of simulation verification, reduces the consumption of computing resources, simplifies the model structure, reduces the difficulty of debugging, and improves the reliability and stability of the code.
Smart Images

Figure CN119623367B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a code model generation method, a code model verification method, and related apparatus. Background Technology
[0002] In the design of integrated circuits and SoCs (System-on-a-Chip), UVM (Universal Verification Methodology) is required to verify the functionality of the design. A code model is an abstract model describing the behavior and functionality of integrated circuits and SoCs, such as the Register Abstract Layer (RAL) model. The RAL model, also known as the register model, is a code model that describes the structure, behavior, and function of registers in the design.
[0003] When the code model is complex, simulating it using UVM verification consumes significant resources, resulting in slow simulation speeds. Therefore, providing a technical solution to improve UVM verification efficiency has become a pressing issue for those skilled in the art. Summary of the Invention
[0004] In view of this, embodiments of this application provide a code model generation method, a code model verification method, and related apparatus to provide a foundation for improving UVM verification efficiency.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] This application provides a code model generation method, including:
[0007] Obtain the original code model, which includes at least one attribute;
[0008] Based on the original code model, determine the attributes of the original code model that are invoked during the simulation verification process;
[0009] Based on the invoked attribute, select the code that implements the invoked attribute to form the target code model.
[0010] Optionally, after determining the attributes of the original code model that are invoked during the simulation verification process based on the original code model, the method further includes:
[0011] Obtain an attribute information file, wherein the attribute information file records a first correspondence, the first correspondence being the correspondence between the original code model and the called attribute;
[0012] The step of selecting code to implement the invoked attribute to form the target code model includes:
[0013] Based on the attribute information file, the code combination that implements the called attribute is selected to obtain the target code model.
[0014] Optionally, the first correspondence includes: the attributes that are invoked by each of the original code models during the simulation verification process.
[0015] Optionally, the step of selecting the code combination that implements the invoked attribute based on the attribute information file to obtain the target code model includes:
[0016] Traverse the attribute information file to find and generate the code snippet corresponding to the attribute called by each original code model;
[0017] The target code model is obtained by writing the code snippet corresponding to the invoked attribute into the class of the target code model.
[0018] Optionally, the step of determining the attributes of the original code model that are invoked during the simulation verification process based on the original code model includes:
[0019] Run a test case once using the original code model, and obtain the attribute code of the attribute that was called in the original code model during the process of running the test case once.
[0020] Optionally, before the step of determining the attributes of the original code model that are invoked during the simulation verification process based on the original code model, the method further includes:
[0021] The original code model is decomposed based on attributes to obtain a second correspondence; wherein, the second correspondence is the correspondence between the attributes of the original code model and the code fragments of the original code model.
[0022] Optionally, the second correspondence includes a one-to-one correspondence between the attributes of each original code model and the code fragments of the original code model.
[0023] Optionally, the original code model and the target code model are RAL-based storage units;
[0024] The file type of the attribute information file includes hash table files.
[0025] Optionally, it also includes: obtaining addresses that are not accessed during the execution of a test case;
[0026] The unaccessed address is deleted from the memory included in the target code model.
[0027] This application also provides a code model verification method, including:
[0028] Obtain the original code model, which includes at least one attribute;
[0029] Based on the original code model, determine the attributes of the original code model that are invoked during the simulation verification process;
[0030] Based on the invoked attribute, select the code that implements the invoked attribute to form a target code model; use the target code model to perform simulation verification on the device to be verified.
[0031] Optionally, it also includes: monitoring and outputting the attributes invoked during the simulation verification of the original code model.
[0032] This application also provides a code model generation apparatus, including:
[0033] A raw code model acquisition module is used to acquire a raw code model, wherein the raw code model includes at least one attribute;
[0034] The invoked attribute acquisition module is used to determine the attributes of the original code model that are invoked during the simulation verification process, based on the original code model.
[0035] The target code model generation module is used to select code that implements the invoked attribute to form a target code model based on the invoked attribute.
[0036] Optional, also includes:
[0037] An attribute information file acquisition module is used to acquire an attribute information file, wherein the attribute information file records a first correspondence relationship, which is the correspondence between the original code model and the called attribute;
[0038] The target code model generation module is used to select the code combination that implements the called attribute based on the attribute information file to obtain the target code model.
[0039] Optionally, the target code model generation module is used to traverse the attribute information file, find and generate code fragments corresponding to the attributes called by each original code model; and write the code fragments corresponding to the called attributes into the class of the target code model to obtain the target code model.
[0040] Optionally, the invoked attribute acquisition module is used to acquire a test case; run the test case once using the original code model, and acquire the attribute code of the attribute that is invoked by the original code model during the execution of the test case.
[0041] Optional, also includes:
[0042] The attribute decomposition module is used to decompose the original code model based on attributes to obtain a second correspondence; wherein, the second correspondence is the correspondence between the attributes of the original code model and the code fragments of the original code model.
[0043] Optional, also includes:
[0044] The unaccessed address acquisition module is used to acquire addresses that have not been accessed during the execution of a test case.
[0045] The address deletion module is used to delete the unaccessed address in the memory included in the target code model.
[0046] This application also provides a code model verification device, including:
[0047] A target code model acquisition module is used to acquire an original code model, the original code model including at least one attribute; based on the original code model, determine the attribute of the original code model that is invoked during the simulation verification process; and select code that implements the invoked attribute to form a target code model according to the invoked attribute.
[0048] The simulation verification module is used to perform simulation verification on the device containing the code to be verified using the original code model or the target code model.
[0049] Optionally, it also includes: an attribute monitoring module, used to monitor and output the attributes of the original code model that are invoked during the simulation verification process.
[0050] This application also provides a code model verification system, including: the code model generation device as described above and the code model verification device as described above.
[0051] This application also provides a computing system that executes the code model generation method and the code model verification method described above.
[0052] This application embodiment also provides a storage medium that stores computer instructions, which, when executed, implement the code model generation method and the code model verification method described above.
[0053] The code model generation method provided in this application includes obtaining an original code model, the original code model including at least one attribute; determining the attribute of the original code model that is invoked during the simulation verification process based on the original code model; and selecting code that implements the invoked attribute to form a target code model according to the invoked attribute.
[0054] In this way, after obtaining the original code model for simulation verification, the attributes called during the UVM verification process are determined based on the original code model, and the code within the original code model used to implement the called attributes is combined to obtain the target code model. This ensures that the target code model does not contain any attributes not used during the simulation verification process. Furthermore, while the target code model and the original code model can achieve the same attributes, the composition of the target code model is more concise. Therefore, by using the target code model for simulation verification, the computational load during the simulation of the original code model is reduced, thereby accelerating the simulation verification process and improving its efficiency. Attached Figure Description
[0055] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0056] Figure 1 A flowchart illustrating the code model generation method provided in this application embodiment;
[0057] Figure 2 A structural diagram of the original code model provided in the embodiments of this application;
[0058] Figure 3 Another flowchart illustrating the code model generation method provided in this application embodiment;
[0059] Figure 4 Another flowchart illustrating the code model generation method provided in this application embodiment;
[0060] Figure 5 This is a schematic diagram of the structure of the target code model provided in the embodiments of this application;
[0061] Figure 6 Another flowchart illustrating the code model generation method provided in this application embodiment;
[0062] Figure 7A flowchart illustrating the code model verification method provided in this application embodiment;
[0063] Figure 8 This is a schematic diagram of the structure of the code model generation device provided in the embodiments of this application;
[0064] Figure 9 This is a schematic diagram of the structure of the code model verification device provided in the embodiments of this application. Detailed Implementation
[0065] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0066] In the UVM verification environment, the Reference Array (RAL) is the most fundamental component, containing the following functions: register and memory initialization, dynamic acquisition of register and memory values from the reference model, update data comparison and checking, and final checks of register and memory values before the simulation ends. While these functions greatly facilitate the UVM verification environment, they also introduce problems: each register and memory has a corresponding reference model and a large number of functions. When the number of registers becomes very large, such as at the SoC level, this code consumes significant resources, slowing down the simulation. In certain special cases, many functions are redundant, offering no benefit other than impacting simulation speed.
[0067] In simulation environments, to mitigate the increased complexity associated with using RAL, some verification environments opt to build their own code models to replace the built-in register models in UVM, thereby accelerating simulation. However, these custom-built models are not standard low-level UVM register models, which can lead to ambiguity for upper-layer SoC users and potentially increase learning costs. Different IP groups may build proprietary register models that differ, making them even more difficult for upper-layer SoC users to use. Furthermore, updating the model within the IP itself can cause problems if new requirements are introduced.
[0068] Based on the above description, there is an urgent need for a SoC simulation method that not only simplifies the construction of register models within the IP, but also facilitates the introduction and modification of IP-level features by upper layers at the SoC level.
[0069] To address the aforementioned issues, this application provides a code model generation method that obtains a target code model by combining the code of the attributes used in the original code model. This simplifies the size of the target code model during simulation and improves verification efficiency. As an optional implementation, Figure 1 A flowchart illustrating the code model generation method provided in an embodiment of this application is shown. Figure 1 As shown in the embodiments of this application, the code model generation method includes the following steps.
[0070] Step S10: Obtain the original code model, which includes at least one attribute.
[0071] It should be noted that the original code model is the code model of the SoC system that needs to be verified in UVM testing. In UVM testing, multiple test cases need to be run using this original code model to simulate and verify it.
[0072] Furthermore, in an optional implementation, the original code model is a code model based on a RAL (Register Abstraction Layer). The RAL code abstracts hardware registers and memory into a software model, allowing verification engineers to operate on registers without considering the underlying implementation details. In addition, the RAL employs object-oriented programming (OOP) methods, with each register or memory RAL corresponding to a class. Furthermore, based on modular code design, RAL classes are implemented by encapsulating code modules with different attributes, thereby facilitating reusability and maintenance.
[0073] Specifically, in one alternative implementation, a structural diagram of the original code model is as follows: Figure 2 As shown. Figure 2 The illustrated primitive code models include at least one register 11 and at least one memory 21. Both register 11 and memory 21 are RALs (Real-Time Access Arrays). Register 11 includes at least four attributes: initialization, mirroring, real-time monitoring, and value checking. Similarly, memory 21 also includes at least four attributes: initialization, mirroring, decoding, and value checking. Furthermore, based on the RAL and employing object-oriented programming, each attribute in register 11 and memory 21 is composed of attribute code implementing different attributes. Examples include initialization attribute code, mirroring attribute code, and decoding attribute code.
[0074] Step S20: Based on the original code model, determine the attributes of the original code model that are invoked during the simulation verification process.
[0075] As mentioned above, not all attributes of the original code model are invoked during UVM verification. The code implementing these uninvoked attributes, if present in the original code model, increases its complexity, leading to verbose and disorganized code, thus reducing readability and maintainability. Secondly, redundant code consumes additional computational resources, increasing simulation time and reducing verification efficiency. Furthermore, unused attributes may contain potential errors or conflicts, increasing the difficulty of debugging and troubleshooting.
[0076] After determining the attributes of the original code model that are invoked during UVM verification, the original code model can be simplified based on these attributes, retaining only those attributes invoked during UVM verification. This results in a more concise, clearer, and easier-to-understand and maintain original code model (i.e., target code model), improving development and usage efficiency, reducing redundant code, lowering computational resources required for simulation, accelerating simulation speed, and increasing verification efficiency. It also reduces debugging difficulty and improves code reliability and stability.
[0077] Furthermore, the attributes invoked by the original code model during UVM verification cannot be directly determined from the original code model itself, but need to be determined based on the specific operational status of the original code model during UVM verification. Specifically, such as... Figure 3 As shown, in one optional implementation, step S20 includes step S21: obtaining a test case. Step S22: running the test case once using the original code model, and obtaining the attribute codes of the attributes called by the original code model during the test case execution. In this way, by using a test case, the called attributes can be easily determined, thereby facilitating subsequent simplification of the original code model.
[0078] Furthermore, in an optional implementation, the method for obtaining the attribute code of the attribute called by the original code model during runtime may include using a callback function within the RAL, or setting up a monitoring module for the original code model, so that after the attribute is called, the information of the used attribute can be output and recorded. Specifically, a callback function can be added to the code of each attribute within the original code model, or a monitoring module can be additionally configured for the original code model when configuring it. The monitoring module monitors which attributes are used and output during each read / write operation and records them in the log information of the monitoring module.
[0079] Furthermore, after obtaining the attribute code of the invoked attribute, it is necessary to organize the attribute code to facilitate subsequent determination of the invoked attribute. For example... Figure 3As shown, in an optional implementation, step S23 is further included: obtaining an attribute information file, wherein the attribute information file records a first correspondence relationship, the first correspondence relationship being the correspondence between the secondary model and the invoked attribute.
[0080] It should be noted that the attribute information file is obtained by organizing the attribute codes of the invoked attributes obtained in step S22. Specifically, in an optional implementation, the attribute codes of the invoked attributes are organized using a preset script file, and the organized result is saved in a specific file format; the resulting file is the attribute information file. The preset script file can automatically compare the obtained invoked attribute codes with known attribute codes in a pre-stored code library that can implement different attributes, thereby determining which attributes the original code model invoked and recording them. For example, for two original code models, their invoked attributes can be recorded in the following format: Original code model 1, attribute: {initialization}, Original code model 2, attribute: {mirror}. Furthermore, to facilitate the storage and use of the attribute information file, in an optional implementation, the file type of the attribute information file is a hash table.
[0081] Please continue to refer to this. Figure 1 The code model generation method provided in this application embodiment further includes step S30: selecting code that implements the invoked attribute to form a target code model based on the invoked attribute.
[0082] It should be noted that, as described above, the implementation of the original code model is based on the RAL (Real-Agent Programming) method of object-oriented programming (OOP). Therefore, within the original code model, the attribute code implementing each attribute can run independently, except for passing the attribute information to be processed. Thus, by selecting the code implementing the called attribute and reassembling it into the target code model, redundant attributes in the original code model can be removed, resulting in a simplified target code model.
[0083] Furthermore, after obtaining the attribute information file, the attribute being called and its code can be easily determined based on the attribute information file. Therefore, as... Figure 3 As shown, in an optional implementation, step S30 includes step S31: selecting the code combination that implements the called attribute according to the attribute information file to obtain the target code model.
[0084] Specifically, based on the use of the attribute information file, such as Figure 4As shown, in an optional implementation, step S31 includes step S311: traversing the attribute information file, finding and generating the code snippet corresponding to the attribute called for each original code model. It should be noted that, in an optional implementation, the attribute information file is further processed through the aforementioned script file to obtain the target register. After finding the called attribute in the attribute information file, the code snippet corresponding to the called attribute needs to be found in the pre-stored code library and generated.
[0085] Step S312: Write the code snippet corresponding to the invoked attribute into the class of the target code model to obtain the target code model.
[0086] It should be noted that the class of the target code model is the class that represents the target code model during the code implementation process. A "class" is a code structure that provides a complete framework for modeling registers and memory, facilitating the modeling, access, and verification of hardware registers or memory in a high-level abstract manner. The desired target code model can be obtained by writing the attribute code of the invoked attribute into the class of the target code model.
[0087] At this time, relative to, Figure 2 Taking the target code model as an example, the simplified target code model obtained is as follows: Figure 5 As shown in the diagram. In these improved RALs, relative to the registers, register 11 only has initialization attributes remaining, while the attributes of registers 12 and 13 are also reduced; relative to the memory, memory 21 also only has initialization attributes remaining, while the attributes in memory 22 and memory 23 are also reduced. It is evident that the code model generation method provided in this application embodiment can effectively simplify the complexity of the original code model.
[0088] In this way, after obtaining the original code model for simulation verification, the attributes called during the UVM verification process are determined based on the original code model, and the code within the original code model used to implement the called attributes is combined to obtain the target code model. This ensures that the target code model does not contain any attributes not used during the simulation verification process. Furthermore, while the target code model and the original code model can achieve the same attributes, the composition of the target code model is more concise. Therefore, by using the target code model for simulation verification, the computational load during the simulation of the original code model is reduced, thereby accelerating the simulation verification process and improving its efficiency.
[0089] Furthermore, for an unfamiliar original code model, there may not be a pre-existing code library storing attributes and attribute codes. Therefore, it is necessary to generate a pre-existing code library based on the original code model. Specifically, such as... Figure 6 As shown, in an optional implementation, before step S20, step S11 is further included: decomposing the original code model based on attributes to obtain a second correspondence. The second correspondence is the correspondence between the attributes of the original code model and the code segments of the original code model. Specifically, in an optional implementation, the second correspondence includes a one-to-one correspondence between each attribute of the original code model and the code segments of the original code model.
[0090] In this way, after obtaining the second correspondence of the original code model, the attributes of the original code model and the code fragments of the original code model can be stored to obtain a pre-stored code library, or directly recorded in the cache for later use.
[0091] Furthermore, if the original code model is a simulation model of the memory, during memory initialization, all possible memory address spaces are usually simulated according to the design specifications or memory specifications. Within these address spaces, there may be addresses that will not be accessed in the current test scenario. Therefore, addresses that will not be accessed can also be simplified.
[0092] Specifically, such as Figure 6 As shown, in an optional implementation, the code model generation method provided in this application embodiment further includes step S41: obtaining addresses that were not accessed during the execution of the test cases. Specifically, during the execution of the test cases, a coverage collection module can be added to the original code model to monitor the read, write, and access bits of the original code model to obtain a coverage analysis file of the addresses of the original code model. The coverage analysis file can display the access rate of addresses, and addresses with an access rate of zero are unaccessed addresses. Alternatively, the log and reporting mechanism of the original code model can be used to obtain all addresses accessed during the execution of the test cases and compared with all addresses of the original code model to determine unaccessed addresses.
[0093] Step S42: Delete the unaccessed addresses from the memory included in the target code model. It should be noted that since the unaccessed addresses will not be accessed during the verification process, deleting them will not affect the operation of the target registers. Deleting the unaccessed addresses simplifies the target code model and improves simulation efficiency.
[0094] This application also provides a code model verification method, which simplifies the size of the target code model running during simulation and improves verification efficiency by using a simplified target code model for code model verification. As an optional implementation, Figure 7 A flowchart illustrating the code model verification method provided in an embodiment of this application is shown. Figure 7 As shown in the embodiments of this application, the code model verification method includes the following steps.
[0095] Step S51: Obtain the original code model, which includes at least one attribute; based on the original code model, determine the attribute that is invoked during the simulation verification process; according to the invoked attribute, select the code that implements the invoked attribute to form the target code model.
[0096] Step S52: Use the target code model to perform simulation verification on the code to be verified.
[0097] Furthermore, in order to facilitate the determination of the attributes called by the original code model during the simulation verification process, in an optional implementation, step S52 is performed simultaneously with step S53: monitoring and outputting the attributes called by the original code model during the simulation verification process.
[0098] In this way, after obtaining the original code model for simulation verification, the attributes called during the UVM verification process are determined based on the original code model, and the code within the original code model used to implement the called attributes is combined to obtain the target code model. This ensures that the target code model does not contain any attributes not used during the simulation verification process. Furthermore, while the target code model and the original code model can achieve the same attributes, the composition of the target code model is more concise. Therefore, by using the target code model during simulation verification, the computational load during simulation operations on the target code model can be reduced, thereby accelerating the simulation verification process and improving simulation verification efficiency.
[0099] This application also provides a code model generation apparatus that obtains a target code model by combining the code of the attributes used in the original code model, thereby simplifying the size of the target code model running during simulation and improving verification efficiency. As an optional implementation, Figure 8 A schematic diagram of the structure of the code model generation apparatus provided in an embodiment of this application is shown. Figure 8 As shown in the embodiments of this application, the code model generation apparatus includes the following structure.
[0100] The original code model acquisition module 100 is used to acquire the original code model, which includes at least one attribute.
[0101] The invoked attribute acquisition module 200 is used to determine the attributes of the original code model that are invoked during the simulation verification process, based on the original code model.
[0102] The target code model generation module 300 is used to select code that implements the called attribute to form a target code model based on the called attribute.
[0103] Furthermore, in an alternative implementation, such as Figure 8 As shown, the code model generation apparatus provided in this application embodiment further includes:
[0104] The attribute information file acquisition module 400 is used to acquire an attribute information file, wherein the attribute information file records a first correspondence relationship, which is the correspondence between the original code model and the invoked attribute.
[0105] The target code model generation module 300 is used to select the code combination that implements the called attribute based on the attribute information file to obtain the target code model.
[0106] Furthermore, in an optional implementation, the target code generation and acquisition module 300 is used to traverse the attribute information file, find and generate code fragments corresponding to the attributes called by each original code model; and write the code fragments corresponding to the called attributes into the class of the target code model to obtain the target code model.
[0107] Furthermore, in an optional implementation, the called attribute acquisition module 200 is used to acquire a test case; run the test case once using the original code model, and acquire the attribute code of the attribute that is called by the original code model during the test case execution.
[0108] Furthermore, in an alternative implementation, such as Figure 8 As shown, the code model generation apparatus provided in this application embodiment further includes:
[0109] The attribute decomposition module 500 is used to decompose the original code model based on attributes to obtain a second correspondence; wherein, the second correspondence is the correspondence between the attributes of the original code model and the code fragments of the original code model.
[0110] Furthermore, in an alternative implementation, such as Figure 8 As shown, the code model generation apparatus provided in this application embodiment further includes:
[0111] The unaccessed address acquisition module 610 is used to acquire addresses that have not been accessed during the execution of the test cases.
[0112] Address deletion module 620 is used to delete the unaccessed address in the memory included in the target code model.
[0113] This application also provides a code model verification device, which uses a simplified target code model for code model verification, thereby reducing the size of the target code model running during simulation and improving verification efficiency. As an optional implementation, Figure 9 A schematic diagram of the structure of the code model verification device provided in an embodiment of this application is shown. Figure 9 As shown in the embodiments of this application, the code model verification device includes the following structure.
[0114] The target code model acquisition module 700 is used to acquire the target code model generated by the code model generation device described above.
[0115] The simulation verification module 800 is used to perform simulation verification on the device with the target code model.
[0116] This application embodiment also provides a code model verification system, including: a target code model acquisition module, used to acquire an original code model, the original code model including at least one attribute; based on the original code model, determining the attribute that is invoked in the simulation verification process of the original code model; and selecting code that implements the invoked attribute to form a target code model according to the invoked attribute.
[0117] Furthermore, in an optional implementation, the code model verification system further includes: an attribute monitoring module, used to monitor and output the attributes of the original code model that are invoked during the simulation verification process.
[0118] This application also provides a computing system that executes the code model generation method and the code model verification method described above.
[0119] This application embodiment also provides a storage medium that stores computer instructions, which, when executed, implement the code model generation method and the code model verification method described above.
[0120] While the embodiments disclosed above are described in this application, this application is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of this application; therefore, the scope of protection of this application should be determined by the scope defined in the claims.
Claims
1. A code model generation method, characterized in that, include: Obtain the original code model, which includes at least one attribute and is a RAL-based storage unit; Based on the original code model, determine the attributes of the original code model that are invoked during the simulation verification process; Based on the invoked attribute, select the code that implements the invoked attribute to form the target code model; The step of determining the attributes of the original code model that are invoked during the simulation verification process, based on the original code model, includes: Run a test case once using the original code model, and obtain the attribute code of the attribute that was called in the original code model during the process of running the test case once.
2. The code model generation method as described in claim 1, characterized in that, After determining the attributes of the original code model that are invoked during the simulation verification process based on the original code model, the method further includes: Obtain an attribute information file, wherein the attribute information file records a first correspondence, the first correspondence being the correspondence between the original code model and the called attribute; The step of selecting code to implement the invoked attribute to form the target code model includes: Based on the attribute information file, the code combination that implements the called attribute is selected to obtain the target code model.
3. The code model generation method as described in claim 2, characterized in that, The first correspondence includes: the attributes that are invoked by each of the original code models during the simulation verification process.
4. The code model generation method as described in claim 3, characterized in that, The step of selecting the code combination that implements the called attribute based on the attribute information file to obtain the target code model includes: Traverse the attribute information file to find and generate the code snippet corresponding to the attribute called by each original code model; The code snippet corresponding to the invoked attribute is written into the class corresponding to the target code model to obtain the target code model.
5. The code model generation method as described in claim 1, characterized in that, Before the step of determining the attributes of the original code model that are invoked during the simulation verification process based on the original code model, the method further includes: The original code model is decomposed based on attributes to obtain a second correspondence; wherein, the second correspondence is the correspondence between the attributes of the original code model and the code fragments of the original code model.
6. The code model generation method as described in claim 5, characterized in that, The second correspondence includes a one-to-one correspondence between the attributes of each original code model and the code fragments of the original code model.
7. The code model generation method as described in claim 3, characterized in that, The target code model is a storage unit based on RAL; The file type of the attribute information file includes hash table files.
8. The code model generation method as described in claim 1, characterized in that, Also includes: Obtain the address that was not accessed during the execution of the test case once; The unaccessed address is deleted from the memory included in the target code model.
9. A code model verification method, characterized in that, include: Obtain the original code model, which includes at least one attribute and is a RAL-based storage unit; Based on the original code model, determine the attributes of the original code model that are invoked during the simulation verification process; Based on the invoked attribute, select the code that implements the invoked attribute to form the target code model; The original code model or the target code model is used to perform simulation verification on the device containing the code to be verified. The step of determining the attributes of the original code model that are invoked during the simulation verification process, based on the original code model, includes: Run a test case once using the original code model, and obtain the attribute code of the attribute that was called in the original code model during the process of running the test case once.
10. The code model verification method as described in claim 9, characterized in that, Also includes: Monitor and output the attributes that are invoked during the simulation verification of the original code model.
11. A code model generation device, characterized in that, include: A raw code model acquisition module is used to acquire a raw code model, wherein the raw code model includes at least one attribute and the raw code model is a RAL-based storage unit; The invoked attribute acquisition module is used to determine the attributes of the original code model that are invoked during the simulation verification process, based on the original code model. The target code model generation module is used to select code that implements the invoked attribute to form a target code model based on the invoked attribute. The called attribute acquisition module is further used to acquire a test case; run the test case once using the original code model, and acquire the attribute code of the attribute that is called by the original code model during the execution of the test case.
12. The code model generation apparatus as described in claim 11, characterized in that, Also includes: An attribute information file acquisition module is used to acquire an attribute information file, wherein the attribute information file records a first correspondence relationship, which is the correspondence between the original code model and the called attribute; The target code model generation module is used to select the code combination that implements the called attribute based on the attribute information file to obtain the target code model.
13. The code model generation apparatus as described in claim 12, characterized in that, The target code model generation module is used to traverse the attribute information file, find and generate code fragments corresponding to the attributes called by each original code model; and write the code fragments corresponding to the called attributes into the class of the target code model to obtain the target code model.
14. The code model generation apparatus as described in claim 11, characterized in that, Also includes: The attribute decomposition module is used to decompose the original code model based on attributes to obtain a second correspondence; wherein, the second correspondence is the correspondence between the attributes of the original code model and the code fragments of the original code model.
15. The code model generation apparatus as described in claim 12, characterized in that, Also includes: The unaccessed address acquisition module is used to acquire addresses that have not been accessed during the execution of a test case. The address deletion module is used to delete the unaccessed address in the memory included in the target code model.
16. A code model verification device, characterized in that, include: A target code model acquisition module is used to acquire the original code model, wherein the original code model includes at least one attribute and the original code model is a RAL-based storage unit; Based on the original code model, determine the attributes of the original code model that are invoked during the simulation verification process; according to the invoked attributes, select the code that implements the invoked attributes to form the target code model; The simulation verification module is used to perform simulation verification on the device containing the code to be verified using the original code model or the target code model. The step of determining the attributes of the original code model that are invoked during the simulation verification process, based on the original code model, includes: Run a test case once using the original code model, and obtain the attribute code of the attribute that was called in the original code model during the process of running the test case once.
17. The code model verification device as described in claim 16, characterized in that, Also includes: The attribute monitoring module is used to monitor and output the attributes of the original code model that are invoked during the simulation verification process.
18. A code model verification system, characterized in that, include: The code model generation apparatus as described in any one of claims 11-15 and the code model verification apparatus as described in any one of claims 16-17.
19. A computing system, characterized in that, Perform the code model generation method as described in any one of claims 1-8 and the code model verification method as described in any one of claims 9-10.
20. A storage medium, characterized in that, The storage medium stores computer instructions, which, when executed, implement the code model generation method as described in any one of claims 1-8 and the code model verification method as described in any one of claims 9-10.
Citation Information
Patent Citations
Simulation verification method and device and computing equipment
CN113792522A
Simulation model code generation method and device
CN117971192A