[go: up one dir, main page]

CN119623367A - Code model generation method, code model verification method and related devices - Google Patents

Code model generation method, code model verification method and related devices Download PDF

Info

Publication number
CN119623367A
CN119623367A CN202411654886.1A CN202411654886A CN119623367A CN 119623367 A CN119623367 A CN 119623367A CN 202411654886 A CN202411654886 A CN 202411654886A CN 119623367 A CN119623367 A CN 119623367A
Authority
CN
China
Prior art keywords
code model
attribute
model
original
called
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411654886.1A
Other languages
Chinese (zh)
Inventor
江源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Haiguang Integrated Circuit Design Beijing Co ltd
Original Assignee
Haiguang Integrated Circuit Design Beijing Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Haiguang Integrated Circuit Design Beijing Co ltd filed Critical Haiguang Integrated Circuit Design Beijing Co ltd
Priority to CN202411654886.1A priority Critical patent/CN119623367A/en
Publication of CN119623367A publication Critical patent/CN119623367A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design
    • G06F30/32Circuit design at the digital level
    • G06F30/33Design verification, e.g. functional simulation or model checking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2115/00Details relating to the type of the circuit
    • G06F2115/02System on chip [SoC] design

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请实施例提供一种代码模型生成方法、代码模型验证方法及相关装置,所述代码模型生成方法,包括:获取原始代码模型,所述原始代码模型包括至少一个属性;基于所述原始代码模型,确定所述原始代码模型在仿真验证过程中被调用的属性;根据所述被调用的属性,选择实现所述被调用的属性的代码组成目标代码模型。可以得到更加简洁的标代码模型。从而在仿真验证过程中若使用所述目标代码模型,减少对所述原目标代码模型仿真运算时的运算量,从而加快仿真验证过程中的仿真速度,提高了仿真验证效率。

The embodiment of the present application provides a code model generation method, a code model verification method and related devices, wherein the code model generation method comprises: obtaining an original code model, wherein the original code model comprises at least one attribute; based on the original code model, determining the attribute of the original code model to be called during the simulation verification process; and according to the called attribute, selecting a code to implement the called attribute to form a target code model. A more concise target code model can be obtained. Therefore, if the target code model is used during the simulation verification process, the amount of calculation for simulating the original target code model is reduced, thereby accelerating the simulation speed during the simulation verification process and improving the simulation verification efficiency.

Description

Code model generation method, code model verification method and related devices
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a code model generation method, a code model verification method and a related device.
Background
In designs of integrated circuits, socs (system on a chip), etc., it is necessary to use UVM verification (Universal Verification Methodology ) to functionally verify the design. The code model is an abstract model describing the behavior and functions of integrated circuits, soCs and other designs, such as a register abstraction layer (RAL, register Abstract Layer) model, and the like, wherein the register abstraction layer model is also called a register model, and is a code model describing the structure, behavior and functions of registers in the design.
When the code model is complex, the code model is simulated by utilizing UVM verification, so that a lot of resources are consumed, and the simulation speed is low. Therefore, how to provide a technical solution to provide a basis for improving the UVM verification efficiency is a problem to be solved by those skilled in the art.
Disclosure of Invention
In view of this, the embodiments of the present application provide a code model generating method, a code model verifying method and related devices, so as to provide a basis for improving UVM verification efficiency.
In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:
the embodiment of the application provides a code model generation method, which comprises the following steps:
acquiring an original code model, wherein the original code model comprises at least one attribute;
Determining the called attribute of the original code model in the simulation verification process based on the original code model;
And selecting codes for realizing the called attributes to form an object code model according to the called attributes.
Optionally, after the step of determining the attribute of the original code model, the method further includes:
Acquiring an attribute information file, wherein the attribute information file records a first corresponding relation, and the first corresponding relation is a corresponding relation between the original code model and the called attribute;
The step of composing an object code model according to the called attribute comprises the following steps:
and selecting code combinations for realizing the called attributes according to the attribute information file to obtain an object code model.
Optionally, the first correspondence includes an attribute of each original code model that is invoked during a simulation verification process.
Optionally, the step of selecting, according to the attribute information file, a code combination for implementing the invoked attribute to obtain an object code model includes:
Traversing the attribute information file, and searching and generating code fragments corresponding to the called attributes of each original code model;
and writing the code segment corresponding to the called attribute into the class of the target code model to obtain the target code model.
Optionally, the step of determining, based on the original code model, an attribute of the original code model that is invoked in a simulation verification process includes:
And running the test case once by using the original code model, and acquiring attribute codes of the attributes called by the original code model in the process of running the test case.
Optionally, before the step of selecting the function module corresponding to the simulation function to form the object code model according to the simulation function, the method further includes:
and disassembling the original code model based on the attribute to obtain a second corresponding relation, wherein the second corresponding relation is the corresponding relation between the attribute of the original code model and the code segment of the original code model.
Optionally, the second correspondence includes a one-to-one correspondence between an attribute of each of the original code models and a code segment of the original code model.
Optionally, the original code model and the target code model are RAL-based storage units;
the file type of the attribute information file includes a hash table file.
Optionally, the method further comprises the steps of obtaining an address which is not accessed in the process of running the test case;
Deleting the non-accessed address in a memory included in the object code model.
The embodiment of the application also provides a code model verification method, which comprises the following steps:
acquiring an original code model, wherein the original code model comprises at least one attribute;
Determining the called attribute of the original code model in the simulation verification process based on the original code model;
Selecting codes for realizing the called attributes to form an object code model according to the called attributes, and performing simulation verification on the code equipment to be verified by using the object code model.
Optionally, monitoring and outputting the invoked attribute in the simulation verification process of the original code model.
The embodiment of the application also provides a code model generating device, which comprises:
An original code model acquisition module for acquiring an original code model, the original code model includes at least one attribute;
the called attribute acquisition module is used for determining the called attribute of the original code model in the simulation verification process based on the original code model;
and the object code model generation module is used for selecting codes for realizing the called attributes to form an object code model according to the called attributes.
Optionally, the method further comprises:
the attribute information file acquisition module is used for acquiring an attribute information file, wherein the attribute information file records a first corresponding relation, and the first corresponding relation is a corresponding relation between the original code model and the called attribute;
And the object code model generating module is used for selecting the code combination for realizing the called attribute according to the attribute information file to obtain an object code model.
Optionally, the object code model generating module is configured to traverse the attribute information file, search and generate a code segment corresponding to the called attribute of each original code model, and write the code segment corresponding to the called attribute into a class of the object code model to obtain an object code model.
Optionally, the called attribute obtaining module is used for obtaining a test case, running the test case once by using the original code model, and obtaining attribute codes of the called attributes of the original code model in the process of running the test case.
Optionally, the method further comprises:
And the attribute disassembly module is used for disassembling the original code model based on the attribute to obtain a second corresponding relation, wherein the second corresponding relation is the corresponding relation between the attribute of the original code model and the code segment of the original code model.
Optionally, the method further comprises:
The non-accessed address acquisition module is used for acquiring the non-accessed address in the process of running the test case;
And the address deleting module is used for deleting the non-accessed address in a memory included in the object code model.
The embodiment of the application also provides a code model verification device, which comprises:
The system comprises an object code model acquisition module, a code composition module and a code generation module, wherein the object code model acquisition module is used for acquiring an original code model, the original code model comprises at least one attribute, determining the called attribute of the original code model in the simulation verification process based on the original code model, and selecting codes for realizing the called attribute according to the called attribute;
and the simulation verification module is used for performing simulation verification on the code equipment to be verified by using the original code model or the target code model.
Optionally, the system further comprises an attribute monitoring module for monitoring and outputting the invoked attribute of the original code model in the simulation verification process.
The embodiment of the application also provides a code model verification system which comprises the code model generation device and the code model verification device.
The embodiment of the application also provides a computing system for executing the code model generation method and the code model verification method.
Embodiments of the present application also provide a storage medium storing computer instructions that, when executed, implement the code model generation method as described above and the code model verification method as described above.
The code model generation method comprises the steps of obtaining an original code model, determining the called attribute of the original code model in the simulation verification process based on the original code model, and selecting codes for realizing the called attribute to form an object code model according to the called attribute.
In this way, an object code model is obtained by determining the called attributes in the UVM verification process based on the original code model after the original code model for simulation verification is obtained, and combining codes for realizing the called attributes in the original code model. So that there are no attributes within the object code model that are unused in the simulation verification process. And the composition of the object code model is simpler under the condition that the same attribute can be realized between the object code model and the original code model. Therefore, in the simulation verification process, the object code model is used for simulation, so that the purpose of reducing the operation amount in the process of simulating operation of the original code model is achieved, the simulation speed in the simulation verification process is increased, and the simulation verification efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a code model generating method according to an embodiment of the present application;
FIG. 2 is a block diagram of an original code model provided by an embodiment of the present application;
FIG. 3 is another flow chart of a code model generating method according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of a code model generating method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of an object code model according to an embodiment of the present application;
FIG. 6 is a schematic flow chart of a code model generating method according to an embodiment of the present application;
FIG. 7 is a flowchart of a code model verification method according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a code model generating device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a code model verification device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In the UVM verification environment, RAL is the most basic component and comprises the following functions of initializing a register and a memory, dynamically acquiring values of the register and the memory by a reference model, updating data contrast checking, and finally checking the values of the register and the memory before the simulation is finished. These functions of RAL offer great convenience to the UVM verification environment and also present problems in that each register and memory has a corresponding reference model and a large number of functions, which consume many resources when the number of registers is large, such as on the SoC level, reducing the speed of emulation, and in some special cases many functions are redundant, without any benefit other than affecting the speed of emulation.
In the simulation environment, in order to reduce the influence of the increased complexity caused by using the RAL, some verification environments choose to construct a code model to replace a register model in UVM, so that the simulation speed is increased. However, the built model is not a standard bottom-layer UVM register model, so that an upper-layer SoC user can generate ambiguity, and learning cost can be brought. The private register models constructed by different IP groups may have differences and are more difficult to use for upper-layer SoC users. Inside IP, the updating of the model can also be cumbersome if new requirements are introduced.
Based on the above description, there is a need for a SoC simulation method that not only simplifies the building of a register model inside an IP, but also facilitates the introduction and modification of an IP level by an upper layer at a SoC level.
In order to solve the above problems, an embodiment of the present application provides a code model generating method, in which an object code model is obtained by code combination of attributes used by an original code model, so that the size of the object code model running in a simulation process is simplified, and verification efficiency is improved. As an alternative implementation, fig. 1 shows a schematic flow chart of a code model generating method provided by an embodiment of the present application. As shown in fig. 1, the code model generating method provided by the embodiment of the application includes the following steps.
Step S10, an original code model is obtained, wherein the original code model comprises at least one attribute.
It should be noted that the original code model is the code model of the SoC system that needs to be verified in the UVM test. In the UVM test, a plurality of test cases are required to be run by using the original code model so as to simulate and verify the original code model.
Further, in an alternative implementation, the model of the original code model is a code model implemented based on RAL (Register Abstraction Layer ). The RAL code abstracts the hardware registers and memory into a software model that allows a verification engineer to operate on the registers without regard to underlying implementation details. In addition, the RAL employs an object-oriented programming (OOP) method, with each of the registers or memories' RALs corresponding to a class. And furthermore, based on the modularized design of codes, RAL classes are realized by encapsulating code modules with different attributes, so that the repeated use and maintenance are facilitated.
Specifically, in an alternative implementation, a schematic structural diagram of the original code model is shown in fig. 2. The plurality of raw code models shown in fig. 2 includes at least one register 11 and at least one memory 21. Wherein, the register 11 and the memory 21 are all RAL. At least 4 attributes are included in the register 11, respectively for initialization, mirroring, real-time monitoring and value checking, and at least 4 attributes are also included in the memory 21, respectively for initialization, mirroring, decoding and value checking. Furthermore, an object-oriented programming method is adopted based on the RAL, and each attribute in the register 11 and the memory 21 is an attribute code composition for realizing different attributes. Such as an initialization attribute code, a mirror attribute code, a decode attribute code, etc.
And step S20, determining the called attribute of the original code model in the simulation verification process based on the original code model.
As can be seen from the foregoing, not all the attributes of the original code model are called in the UVM verification process, and the codes of these non-called attributes are implemented, if the codes appear in the original code model, the complexity of the codes of the original code model is increased, resulting in lengthy codes and disordered structures of the original code model, and the readability and maintainability of the original code model are reduced. Second, redundant codes consume additional computing resources, increase simulation time, and reduce verification efficiency. Furthermore, unused attributes may contain potential errors or conflicts, increasing the difficulty of debugging and locating problems.
After the called attribute of the original code model in the UVM verification process is determined, the original code model can be simplified based on the called attribute, the attribute which is only called in the UVM verification process is reserved, the simplified original code model (namely the target code model) is enabled to be more simplified, the structure is clear, the understanding and the maintenance are easy, the development and the use efficiency are improved, the calculation resources required by simulation are reduced by redundant codes, the simulation speed is accelerated, and the verification efficiency is improved. The debugging difficulty can be reduced, and the reliability and stability of codes are improved.
Further, the attribute of the original code model, which is called in the UVM verification process, cannot be directly determined according to the original code model, and needs to be determined based on the specific running condition of the original code model in the UVM verification process. Specifically, as shown in fig. 3, in an alternative implementation, the step S20 includes a step S21 of obtaining a test case. And S22, running the test case once by using the original code model, and acquiring attribute codes of the attributes called by the original code model in the process of running the test case. In this way, by using one test case, the called properties can be easily determined, thereby facilitating the subsequent simplification of the original code model.
Further, in an optional implementation, the method for obtaining the attribute code of the attribute called by the original code model in the running process may include using a callback function in the RAL, or setting a monitoring module for the original code model, so that after the attribute is called, information of the attribute used may be output and recorded. Specifically, a callback function can be added in the code for realizing each attribute in the original code model, or a monitoring module is additionally configured for the original code model when the original code model is configured, and the monitoring module monitors which attributes are used and output in each read-write operation and records the output in log information of the monitoring module.
Further, after obtaining the attribute code of the called attribute, the attribute code of the called attribute needs to be sorted so as to determine the called attribute later. As shown in fig. 3, in an alternative implementation, the method further includes step S23 of obtaining an attribute information file, where a first correspondence is recorded in the attribute information file, where the first correspondence is a correspondence between the secondary model and the invoked attribute.
The attribute information file is a file obtained by sorting the attribute codes of the called attributes obtained in step S22. Specifically, in an optional implementation, the attribute codes of the called attributes are sorted through a preset script file, and the sorted result is saved as a specific file format, and the obtained file is the attribute information file. The preset script file can automatically compare the obtained called attribute codes with the attribute codes which are known in a pre-stored code library and can realize different attributes, so that the original code model calls and records the attributes. For example, for two original code models, its called properties may be recorded in the format of original code model 1, property { initialization }, original code model 2, property { mirror }. Further, to facilitate storage and use of the attribute information file, in an alternative implementation, the file type of the attribute information file is a hash table.
With continued reference to fig. 1, the code model generating method provided by the embodiment of the present application further includes step S30 of selecting, according to the called attribute, a code for implementing the called attribute to form an object code model.
It should be noted that, as can be seen from the foregoing, the implementation of the original code model is based on the RAL of the Object Oriented Programming (OOP) method, so that in the original code model, the codes implementing each attribute can be independently operated except for the attribute information to be processed transferred between the attribute codes implementing each attribute. And therefore, selecting the codes for realizing the called attributes, and using the codes for realizing the called attributes to reconstruct an object code model, namely removing redundant attributes in the original code model in the object code model, thereby obtaining a simplified object code model.
Further, after the attribute information file is obtained, the called attribute and the code of the called attribute can be easily determined according to the attribute information file, so, as shown in fig. 3, in an alternative implementation, the step S30 includes a step S31 of selecting, according to the attribute information file, a code combination implementing the called attribute to obtain an object code model.
Specifically, based on the use of the attribute information file, as shown in fig. 4, in an alternative implementation, the step S31 includes a step S311 of traversing the attribute information file to find and generate a code segment corresponding to the called attribute of each original code model. It should be noted that, in an alternative implementation, the processing of the attribute information file is continued through the script file to obtain the destination register. After the called attribute is found in the attribute information file, a code segment corresponding to the called attribute needs to be found in a pre-stored code library, and the code segment is generated.
And step S312, writing the code segment corresponding to the called attribute into the class of the target code model to obtain the target code model.
It should be noted that, the class of the object code model is the class representing the object code model in the code implementation process. A "class" is a code structure that provides a complete set of registers and memory modeling framework to facilitate modeling, accessing, and validating hardware registers or memory in a high level abstract manner. And writing the attribute codes of the called attributes into the classes of the object code model to obtain the required object code model.
At this time, the resulting reduced object code model is shown in fig. 5, with respect to the object code model as described in fig. 2 as an example. In these modified RALs, only the initialization attribute is left in the register 11, while the attributes of both registers 12 and 13 are reduced, relative to the registers, and also only the initialization attribute is left in the memory 21, and the attributes in the memory 22 and 23 are reduced, relative to the memories. Therefore, the code model generation method provided by the embodiment of the application can effectively simplify the complexity of the original code model.
In this way, an object code model is obtained by determining the called attributes in the UVM verification process based on the original code model after the original code model for simulation verification is obtained, and combining codes for realizing the called attributes in the original code model. So that there are no attributes within the object code model that are unused in the simulation verification process. And the composition of the object code model is simpler under the condition that the same attribute can be realized between the object code model and the original code model. Therefore, in the simulation verification process, the object code model is used for simulation, so that the purpose of reducing the operation amount in the process of simulating operation of the original code model is achieved, the simulation speed in the simulation verification process is increased, and the simulation verification efficiency is improved.
Further, for a strange original code model, there may not be a pre-stored code base storing the attributes and the attribute codes, so it is necessary to generate a pre-stored code base based on the original code model. Specifically, as shown in fig. 6, in an alternative implementation, before the step S20, a step S11 is further included of disassembling the original code model based on the attribute to obtain a second correspondence. The second corresponding relation is a corresponding relation between the attribute of the original code model and the code segment of the original code model. Specifically, in an optional implementation, the second correspondence includes a one-to-one correspondence between an attribute of each of the original code models and a code segment of the original code model.
Thus, after the second corresponding relation of the original code model is obtained, the attribute of the original code model and the code segments of the original code model can be stored to obtain a pre-stored code library, or the pre-stored code library can be directly recorded in a cache for subsequent use.
Further, if the original code model is a simulation model of the memory, during the initialization of the memory, all possible address spaces of the memory are usually simulated according to the design specification or the memory specification, and addresses that cannot be accessed in the current test scenario may exist in these address spaces, so that the addresses that cannot be accessed may be reduced.
Specifically, as shown in fig. 6, in an alternative implementation, the code model generating method provided by the embodiment of the present application further includes step S41, where an address that is not accessed in the process of running the test case is obtained. Specifically, in the running process of running the test, a coverage rate collection module can be additionally arranged in the original code model to monitor conditions of reading, writing, accessing bits and the like of the original code model so as to obtain a coverage rate analysis file of an address of the original code model. The coverage rate analysis file can display the accessed rate of the addresses, and the addresses with the accessed rate of zero are the addresses which are not accessed. Or using a log and report mechanism of the original code model to acquire the accessed addresses in the process of all the running test cases, and comparing the accessed addresses with all the addresses of the original code model to determine the non-accessed addresses.
And S42, deleting the non-accessed address in a memory included in the target code model. It should be noted that, since the address that is not accessed in the verification process, even if the address that is not accessed is deleted, the operation of the target register is not affected. After deleting the address which is not accessed, the object code model can be simplified, and the simulation efficiency is improved.
The embodiment of the application also provides a code model verification method, which uses the simplified object code model to verify the code model, thereby simplifying the size of the object code model operated in the simulation process and improving the verification efficiency. As an alternative implementation, fig. 7 shows a schematic flow chart of a code model verification method provided by an embodiment of the present application. As shown in fig. 7, the code model verification method provided by the embodiment of the application includes the following steps.
Step S51, an original code model is obtained, the original code model comprises at least one attribute, the attribute of the original code model which is called in the simulation verification process is determined based on the original code model, and codes for realizing the called attribute are selected to form an object code model according to the called attribute.
And S52, performing simulation verification on the code to be verified by using the target code model.
Further, in order to facilitate the determination of the attribute of the original code model that is invoked during the simulation verification process, in an optional implementation, the step S52 is performed while further including a step S53 of monitoring and outputting the attribute of the original code model that is invoked during the simulation verification process.
In this way, an object code model is obtained by determining the called attributes in the UVM verification process based on the original code model after the original code model for simulation verification is obtained, and combining codes for realizing the called attributes in the original code model. So that there are no attributes within the object code model that are unused in the simulation verification process. And the composition of the object code model is simpler under the condition that the same attribute can be realized between the object code model and the original code model. Furthermore, in the simulation verification process, the target code model is used, so that the operation amount of the target code model in the simulation operation can be reduced, the simulation speed in the simulation verification process is increased, and the simulation verification efficiency is improved.
The embodiment of the application also provides a code model generating device, which obtains the target code model through the code combination of the used attributes of the original code model, thereby simplifying the size of the target code model operated in the simulation process and improving the verification efficiency. As an alternative implementation, fig. 8 shows a schematic structural diagram of a code model generating apparatus provided by an embodiment of the present application. As shown in fig. 8, the code model generating apparatus provided by the embodiment of the present application includes the following structure.
An original code model acquisition module 100 for acquiring an original code model, the original code model including at least one attribute;
And the called attribute acquisition module 200 is used for determining the attribute of the original code model, which is called in the simulation verification process, based on the original code model.
And the object code model generating module 300 is used for selecting codes for realizing the called attributes to form an object code model according to the called attributes.
Further, in an optional implementation, as shown in fig. 8, the code model generating apparatus provided by the embodiment of the present application further includes:
The attribute information file obtaining module 400 is configured to obtain an attribute information file, where a first correspondence is recorded in the attribute information file, where the first correspondence is a correspondence between the original code model and the invoked attribute.
The object code model generating module 300 is configured to select, according to the attribute information file, a code combination for implementing the invoked attribute to obtain an object code model.
Further, in an optional implementation, the object code generation and acquisition module 300 is configured to traverse the attribute information file, find and generate a code segment corresponding to a called attribute of each original code model, and write the code segment corresponding to the called attribute into a class of the object code model to obtain an object code model.
Further, in an alternative implementation, the called attribute obtaining module 200 is configured to obtain a test case, run the test case once by using the original code model, and obtain an attribute code of an attribute called by the original code model in the process of running the test case.
Further, in an optional implementation, as shown in fig. 8, the code model generating apparatus provided by the embodiment of the present application further includes:
And the attribute disassembly module 500 is configured to disassemble the original code model based on attributes to obtain a second corresponding relationship, where the second corresponding relationship is a corresponding relationship between the attributes of the original code model and the code segments of the original code model.
Further, in an optional implementation, as shown in fig. 8, the code model generating apparatus provided by the embodiment of the present application further includes:
The non-accessed address obtaining module 610 is configured to obtain an address that is not accessed in the process of running the test case.
An address deleting module 620, configured to delete the non-accessed address in a memory included in the object code model.
The embodiment of the application also provides a code model verification device, which uses the simplified object code model to verify the code model, thereby simplifying the size of the object code model operated in the simulation process and improving the verification efficiency. As an alternative implementation, fig. 9 shows a schematic structural diagram of a code model verification device provided by an embodiment of the present application. As shown in fig. 9, the code model verification apparatus provided by the embodiment of the present application includes the following structure.
The object code model obtaining module 700 is configured to obtain the object code model generated by the code model generating device.
And the simulation verification module 800 is used for performing simulation verification on the code equipment to be verified by using the target code model.
The embodiment of the application also provides a code model verification system, which comprises an object code model acquisition module, a verification module and a verification module, wherein the object code model acquisition module is used for acquiring an original code model, the original code model comprises at least one attribute, the attribute of the original code model which is called in the simulation verification process is determined based on the original code model, and codes for realizing the called attribute are selected to form the object code model according to the called attribute.
Further, in an alternative implementation, the code model verification system further comprises an attribute monitoring module for monitoring and outputting the attributes of the original code model which are called in the simulation verification process.
The embodiment of the application also provides a computing system for executing the code model generation method and the code model verification method.
Embodiments of the present application also provide a storage medium storing computer instructions that, when executed, implement the code model generation method as described above and the code model verification method as described above.
Although the embodiments of the present application are disclosed above, the present application is not limited thereto. Various changes and modifications may be made by one skilled in the art without departing from the spirit and scope of the application, and the scope of the application should be assessed accordingly to that of the appended claims.

Claims (22)

1. A code model generation method, comprising:
acquiring an original code model, wherein the original code model comprises at least one attribute;
Determining the called attribute of the original code model in the simulation verification process based on the original code model;
And selecting codes for realizing the called attributes to form an object code model according to the called attributes.
2. The code model generation method of claim 1, wherein after the step of determining the properties of the original code model that are invoked during the simulation verification based on the original code model, further comprising:
Acquiring an attribute information file, wherein the attribute information file records a first corresponding relation, and the first corresponding relation is a corresponding relation between the original code model and the called attribute;
The step of composing an object code model according to the called attribute comprises the following steps:
and selecting code combinations for realizing the called attributes according to the attribute information file to obtain an object code model.
3. The code model generation method of claim 2, wherein the first correspondence includes an attribute of each of the original code models that is invoked during a simulation verification process.
4. The code model generation method of claim 3, wherein the step of selecting a code combination implementing the called attribute to obtain an object code model based on the attribute information file comprises:
Traversing the attribute information file, and searching and generating code fragments corresponding to the called attributes of each original code model;
and writing the code segment corresponding to the called attribute into the class corresponding to the target code model to obtain the target code model.
5. The code model generation method of claim 2, wherein the step of determining the properties of the original code model that are invoked during the simulation verification process based on the original code model comprises:
And running the test case once by using the original code model, and acquiring attribute codes of the attributes called by the original code model in the process of running the test case.
6. The code model generation method according to claim 1, wherein before the step of selecting a function module corresponding to the simulation function to compose an object code model according to the simulation function, further comprising:
and disassembling the original code model based on the attribute to obtain a second corresponding relation, wherein the second corresponding relation is the corresponding relation between the attribute of the original code model and the code segment of the original code model.
7. The code model generation method of claim 6, wherein the second correspondence includes a one-to-one correspondence of an attribute of each of the original code models to a code segment of the original code model.
8. The code model generation method of claim 3, wherein the original code model and the object code model are RAL-based storage units;
the file type of the attribute information file includes a hash table file.
9. The code model generation method of claim 5, further comprising obtaining addresses that are not accessed during the running test case;
Deleting the non-accessed address in a memory included in the object code model.
10. A code model verification method, comprising:
acquiring an original code model, wherein the original code model comprises at least one attribute;
Determining the called attribute of the original code model in the simulation verification process based on the original code model;
Selecting codes for realizing the called attributes to form an object code model according to the called attributes;
And performing simulation verification on the code equipment to be verified by using the original code model or the target code model.
11. The code model verification method of claim 10, further comprising:
and monitoring and outputting the called attribute in the simulation verification process of the original code model.
12. A code model generating apparatus, comprising:
An original code model acquisition module for acquiring an original code model, the original code model includes at least one attribute;
the called attribute acquisition module is used for determining the called attribute of the original code model in the simulation verification process based on the original code model;
and the object code model generation module is used for selecting codes for realizing the called attributes to form an object code model according to the called attributes.
13. The code model generating apparatus of claim 12, further comprising:
the attribute information file acquisition module is used for acquiring an attribute information file, wherein the attribute information file records a first corresponding relation, and the first corresponding relation is a corresponding relation between the original code model and the called attribute;
And the object code model generating module is used for selecting the code combination for realizing the called attribute according to the attribute information file to obtain an object code model.
14. The code model generating apparatus of claim 13, wherein the object code model generating module is configured to traverse the attribute information file, find and generate code fragments corresponding to the called attributes of each original code model, and write the code fragments corresponding to the called attributes into a class of the object code model to obtain an object code model.
15. The code model generating apparatus as set forth in claim 12, wherein said called attribute obtaining module is configured to obtain a test case, run a test case using said original code model, and obtain an attribute code of an attribute called by said original code model in the process of running the test case.
16. The code model generating apparatus of claim 12, further comprising:
And the attribute disassembly module is used for disassembling the original code model based on the attribute to obtain a second corresponding relation, wherein the second corresponding relation is the corresponding relation between the attribute of the original code model and the code segment of the original code model.
17. The code model generating apparatus of claim 13, further comprising:
The non-accessed address acquisition module is used for acquiring the non-accessed address in the process of running the test case;
And the address deleting module is used for deleting the non-accessed address in a memory included in the object code model.
18. A code model verification apparatus, comprising:
The system comprises an object code model acquisition module, a code composition module and a code generation module, wherein the object code model acquisition module is used for acquiring an original code model, the original code model comprises at least one attribute, determining the called attribute of the original code model in the simulation verification process based on the original code model, and selecting codes for realizing the called attribute according to the called attribute;
And the simulation verification module is used for performing simulation verification on the code equipment to be verified by using the original code model or the target code model.
19. The code model verification device of claim 18, further comprising:
And the attribute monitoring module is used for monitoring and outputting the attribute of the original code model which is called in the simulation verification process.
20. A code model verification system comprising code model generating means as claimed in any one of claims 12 to 17 and code model verification means as claimed in any one of claims 18 to 19.
21. A computing system, characterized in that the code model generating method according to any one of claims 1-9 and the code model verification method according to any one of claims 10-11 are performed.
22. A storage medium storing computer instructions which, when executed, implement the code model generation method of any one of claims 1-9 and the code model verification method of any one of claims 10-11.
CN202411654886.1A 2024-11-18 2024-11-18 Code model generation method, code model verification method and related devices Pending CN119623367A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411654886.1A CN119623367A (en) 2024-11-18 2024-11-18 Code model generation method, code model verification method and related devices

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411654886.1A CN119623367A (en) 2024-11-18 2024-11-18 Code model generation method, code model verification method and related devices

Publications (1)

Publication Number Publication Date
CN119623367A true CN119623367A (en) 2025-03-14

Family

ID=94889615

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411654886.1A Pending CN119623367A (en) 2024-11-18 2024-11-18 Code model generation method, code model verification method and related devices

Country Status (1)

Country Link
CN (1) CN119623367A (en)

Similar Documents

Publication Publication Date Title
US11263150B2 (en) Testing address translation cache
CN109508178A (en) program development method and device
CN113255258B (en) Logic synthesis method and device, electronic equipment and storage medium
CN113486625A (en) Chip verification method and verification system
US8271252B2 (en) Automatic verification of device models
US8245164B2 (en) Method of verification of address translation mechanisms
US7072820B1 (en) Accessing state information in a hardware/software co-simulation
CN116089275A (en) Database testing method, database system, electronic equipment and storage medium
CN111159040A (en) Test data generation method, device, equipment and storage medium
CN116795728A (en) Multi-core cache consistency verification module and method based on UVM
US6847927B2 (en) Efficient array tracing in a logic simulator machine
CN116049014A (en) AMBA bus verification platform generation method and device
CN114818598B (en) VCD vector compression method and device based on circuit overturning behavior
CN112380127B (en) Test case regression method, device, equipment and storage medium
CN115482869A (en) Error injection testing method and device, electronic equipment and storage medium
CN118536445B (en) Method and computing device for chip simulation
CN116048952A (en) A method and device for instantiating module simulation verification based on tailorable IP
CN119598519A (en) Request comparison method applied to UVM verification
CN119088631A (en) A chip register verification method, device, equipment and medium
CN112363875B (en) System defect detection method, device, electronic device and storage medium
CN118503106A (en) Chip verification method and system
CN119623367A (en) Code model generation method, code model verification method and related devices
CN115599618B (en) Register dynamic change-allocation verification method and device, storage medium and processor
CN113760696B (en) A program problem locating method, device, electronic device and storage medium
CN116841838A (en) Non-volatile memory storage device simulation platform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination