Compiling method and device for chip verification and computing equipment

By generating compiled source files that support macro code groups and built-in functions in the chip verification environment, rendering and mapping compile sequences, the inefficiency problem caused by frequent modification of register values ​​is solved, and efficient register and identifier value modification is achieved, avoiding the The default value interferes, improving verification efficiency.

CN119047384AInactive Publication Date: 2024-11-29HUANLING (SHANGHAI) TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411524115.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2024-11-29
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

During the chip verification process, as the number of registers increases, the register value needs to be frequently modified, resulting in low verification efficiency. It is difficult for technicians who are not familiar with the verification platform to find and replace the original configuration value of the target register, which affects accuracy and efficiency.

Method used

By generating compiled source files in the verification environment, supporting the reuse of macro code groups and built-in functions, using script rendering to generate compiled sequences, and mapping them to target registers or identifiers, avoiding the overall compilation verification environment, and directly modifying registers and identifiers Character value, filter unassigned registers to assign random values ​​to avoid default value interference.

Benefits of technology

It reduces the amount of compiled source files, improves code reusability and verification efficiency, simplifies the process of designers to modify register values, and avoids interference failures caused by long-term use of default values ​​for registers in the verification environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119047384A_ABST
    Figure CN119047384A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of chip verification, and provides a compiling method and device for chip verification and computing device.The method comprises the steps that a corresponding compiling source file is generated based on a verification environment according to a configuration instruction from a user; rendering the compiling source file into a compiling basic file by adopting a corresponding script according to an identification result of the compiling source file; reading the compiling basic file to generate a compiling sequence, wherein the compiling sequence comprises target addressing and target content; and respectively mapping all the compilation sequences to target pieces corresponding to the target addressing in the verification environment, and endowing the target pieces with the target contents. According to the scheme, a designer is supported to compile the compiling source file, and after identification and rendering, the value of the target piece nested in the verification environment is modified by taking the compiling sequence as a unit and adopting a mapping method, so that the time of the whole compiling verification environment is saved, and the chip verification efficiency is accelerated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of chip verification, and in particular relates to a compilation method, device and computing equipment for chip verification. Background Art

[0002] In recent years, as the scale of chips has expanded, the design of chips has become more and more complex. In order to support diverse functions, chips often need to be configured with more and more registers. The conventional chip verification process is often to write the overall verification code, compile the overall verification code, and assign the compiled files to the registers in the verification environment in turn for simulation execution.

[0003] As the number of registers in the chip increases, the frequency of register value modification during chip verification increases, and each time the register value is modified, the verification environment needs to be recompiled and assigned, which reduces the verification efficiency. In addition, since the register configuration code is often nested in the verification environment (test sequence), it is difficult for technicians who are not familiar with the verification platform to find the original configuration value corresponding to the target register in the verification environment when modifying the register value, and replace the original configuration value with the configuration value.

[0004] Therefore, it is necessary to provide a compilation method and a computing device for chip verification to solve the above problems existing in the prior art. Summary of the invention

[0005] In order to solve the problem in the prior art that when technicians adjust the value of the target register, they need to recompile and assign the verification environment, resulting in poor change accuracy and low adaptation efficiency, the present application provides a compilation method, device and computing equipment for chip verification.

[0006] The chip verification compilation method, device and computing equipment provided in this application adopt the following technical solutions: A compilation method for chip verification, the method comprising: Based on the verification environment and configuration instructions from the user, the corresponding compilation source files are generated; Using a corresponding script according to the recognition result of the compilation source file, rendering the compilation source file into a compilation basic file; Reading the compilation basic file to generate a compilation sequence, the compilation sequence including target addressing and target content; All compilation sequences are respectively mapped to the target components corresponding to the target addressing in the verification environment, and the target content is assigned to the target components.

[0007] By adopting the above technical solution, in a verification environment, a compilation source file is generated according to the user's configuration instructions. The compilation source file supports reuse in the verification environment (for example, macro code groups or built-in functions, etc.), which reduces the editing threshold. Subsequently, the script corresponding to the compilation source file is used to run the compilation source file to obtain the compilation base file, thereby rendering the compilation source file. The compilation sequence in the compilation base file that has been rendered and compiled is then mapped sequentially to the verification environment to facilitate simulation execution in the verification environment. Designers are supported to write compilation source files. After identification and rendering, the mapping method is used to modify the values ​​of the target parts nested in the verification environment in units of compilation sequences, thereby omitting the time of the overall compilation and verification environment and speeding up the chip verification efficiency.

[0008] Optionally, before generating a corresponding compilation source file based on the verification environment and according to a configuration instruction from a user, the method further includes: The SV general file library is imported into the verification environment so that the compiled source file generated in the verification environment can call the built-in functions in the SV general file library.

[0009] By adopting the above technical solution, the SV general file library is imported into the verification environment, so that when the user generates the compilation source file in the verification environment, the built-in functions in the SV general file library can be directly called to ensure that the compilation source file supports various forms of code and function reuse, which greatly reduces the difficulty for users to edit the compilation source files in the verification environment through configuration instructions.

[0010] Optionally, generating a corresponding compilation source file according to a configuration instruction from a user includes: A corresponding engine template is selected according to the configuration instruction, and a compilation source file is generated according to the code instruction and the calling instruction in the configuration instruction, wherein the calling instruction is used to call the macro code group in the engine template and the built-in function of the verification environment.

[0011] By adopting the above technical solution, after the user selects the engine template through the configuration instruction, the native code corresponding to the code instruction in the configuration instruction is filled into the engine template, and the macro code group and built-in function called by the call instruction are also filled into the engine template. This case supports the compilation source file to reference the macro code group and built-in function, which reduces the writing amount of the compilation source file dom and increases the reusability of the code.

[0012] Optionally, when the engine template is a Python engine template, the compiled source file is generated according to the jinjia2 language.

[0013] By adopting the above technical solution, jinja2 language is a special engine in Python engine template. When generating compiled source files, it can utilize the characteristics of jinja2 language to write register configuration into compiled source files in a three-segment manner (for example, register level-register name-register value) so as to assign target content to corresponding target parts according to target addressing.

[0014] Optionally, using a corresponding script according to the recognition result of the compilation source file to render the compilation source file into a compilation basic file includes: An engine template of the compiled source file is identified, and a script corresponding to the engine template is used to render the compiled source file to obtain a compiled basic file composed of basic elements.

[0015] By adopting the above technical solution, the script corresponding to the engine template is used to run the compilation source file to obtain the compilation basic file. The macro code group and built-in function in the compilation source file are run by the script, and the running result is used as part of the compilation basic file.

[0016] Optionally, reading the compilation basic file to generate a compilation sequence includes: The compilation basic file is read line by line to generate a compilation sequence corresponding to each line, wherein the compilation sequence includes mutually related register levels, register names and register values, or mutually related identifier addresses, identifier names and identifier values.

[0017] By adopting the above technical solution, each line of code read from the compilation basic file is used as a compilation sequence. The compilation sequence consisting of the register level, register name and register value indicates that the mapping assignment is updated to the register in the verification environment. The compilation sequence consisting of the identifier address, identifier name and identifier value indicates that the mapping assignment is updated to the identifier in the verification environment.

[0018] Optionally, mapping all compilation sequences to target components corresponding to the target addressing in the verification environment, and assigning the target content to the target components, includes: When the compilation sequence includes a register hierarchy, a register name, and a register value, According to the register level and the register name, the corresponding target register in the string pool in the verification environment is matched; when the target register does not exist, the compilation sequence read this time is discarded, and the next compilation sequence is read; when the target register exists, the register value is assigned to the target register.

[0019] By adopting the above technical solution, when mapping and assigning values ​​to the register levels, register names and register values ​​that are interrelated in the compilation sequence, if the target register in the verification environment can be locked according to the register level and the register name, the register value is directly mapped to the target register as the value; if the target register in the verification environment cannot be locked according to the register level and the register name, the group of compilation sequences is directly discarded and the compilation sequence in the next line of the compilation base file is read instead.

[0020] Optionally, after all compilation sequences are mapped to the target components corresponding to the target addressing in the verification environment, the method further includes: Unassigned registers in the string pool are screened as pending registers, and unique random values ​​are assigned to the pending registers in sequence.

[0021] By adopting the above technical solution, after all compilation sequences are mapped to the verification environment, check whether there are unassigned registers in the string pool, use these unassigned registers as pending registers, generate random numbers, and assign these random numbers to the pending registers. Ensure that each register is assigned a new value, avoid the registers in the string pool using the default value for a long time, and prevent interference failures in the verification environment during simulation operation.

[0022] Optionally, mapping all compilation sequences to target components corresponding to the target addressing in the verification environment, and assigning the target content to the target components, includes: When the compilation sequence includes an identifier address, an identifier name, and an identifier value, The target identifier in the verification environment is matched according to the identifier address and the identifier name, and the identifier value is assigned to the target identifier.

[0023] By adopting the above technical solution, the compilation sequence can also perform assignment mapping on identifiers in the verification environment to improve the application scope.

[0024] The present invention also provides a compiling device for chip verification, comprising an instruction acquisition unit, a writing unit, a recognition unit, a rendering unit, a reading unit and a mapping matching unit; The instruction acquisition unit is used to acquire configuration instructions from the user; The writing unit is used to generate a corresponding compilation source file in a verification environment according to the configuration instruction; The identification unit is used to identify the compiled source file and specify a corresponding script; The rendering unit is used to render the compilation source file according to the script to obtain a compilation basic file; The reading unit is used to read the compilation basic file and generate a compilation sequence, wherein the compilation sequence includes target addressing and target content; The mapping and matching unit is used to map all compilation sequences to the target components corresponding to the target addressing in the verification environment, and assign the target content to the target components.

[0025] Optionally, the compiling device further includes a register value supplement unit; The register complement unit is used to screen unassigned registers in the string pool in the verification environment as pending registers after mapping all compilation sequences to the target parts corresponding to the target addressing in the verification environment respectively, and assign a unique random value to the pending registers.

[0026] A computing device comprises: a processor; and a memory storing a computer program, wherein when the computer program is executed by the processor, the processor executes the compilation method for chip verification as described above.

[0027] In summary, the present application includes at least one of the following beneficial technical effects: 1. This case generates a compiled source file in a verification environment. It is easy to write, supports referencing macro code groups, and also supports directly calling built-in functions in a verification environment, which reduces the amount of writing of the compiled source file DOM and increases the reusability of the code.

[0028] 2. Designers can automatically generate compilation source files by editing configuration instructions, render and parse them into compilation basic files, and then perform register mapping according to the compilation sequence of each line, saving the time of recompiling the verification environment, speeding up verification efficiency, and facilitating designers to directly modify register values.

[0029] 3. This solution can not only modify the mapping of register values, but also modify the mapping of identifier values ​​in the verification environment.

[0030] 4. After all compilation sequences in the compilation base file are mapped, the pending registers that have not been assigned values ​​in the string pool in the verification environment will be further screened out, and random numbers will be assigned to these pending registers to avoid the registers in the string pool using default values ​​for a long time, causing interference failures in the verification environment during simulation operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 is a flowchart of a compilation method for chip verification provided by a first embodiment of the present invention; Figure 2 for Figure 1 Schematic diagram of the verification environment; Figure 3A schematic diagram of modules of a compiling device for chip verification provided by a second embodiment of the present invention; Figure 4 A schematic diagram of the structure of a computing device provided for the third embodiment of the present invention. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be understood by people with general skills in the field to which the present invention belongs. "Including" and similar words used in this article mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.

[0033] First embodiment: The first embodiment of the present invention provides a compilation method for chip verification, which is applied to a chip verification environment. Figure 1 , the compilation method for chip verification includes the following steps: Based on the verification environment, according to the configuration instructions from the user, the corresponding compilation source file is generated; according to the recognition result of the compilation source file, the corresponding script is used to render the compilation source file into a compilation base file; the compilation base file is read to generate a compilation sequence, and the compilation sequence includes target addressing and target content; all compilation sequences are mapped to the target parts corresponding to the target addressing in the verification environment, and the target content is assigned to the target parts. According to the user's configuration instructions, a compilation source file is generated in the verification environment. The compilation source file supports reuse in the verification environment (for example, macro code groups or built-in functions, etc.), which reduces the editing threshold. The compilation sequences in the compilation base file that has been rendered and compiled are mapped to the verification environment in sequence, so that the verification environment can perform the simulation process.

[0034] The following is a detailed description of the implementation details of the compilation method for chip verification in this embodiment. The following content is only for the convenience of understanding the implementation details, which are not necessary for the implementation of this solution. The specific process is as follows: Figure 1 As shown, the following steps are included: Step 101 : Based on the verification environment and according to the configuration instructions from the user, a corresponding compilation source file is generated.

[0035] Specifically, the verification environment usually refers to a test sequence. Usually, the verification environment includes multiple string pools (each string pool corresponds to a functional module) and identifiers, and each string pool includes at least one register.

[0036] Before step 101 is executed, the verification environment is configured: the SV general file library is imported into the verification environment so that the compiled source file generated in the verification environment can call the built-in functions in the SV general file library.

[0037] Before editing the compiled source file (i.e., editing the configuration instructions for generating the compiled source file in the verification environment), the staff adds the SV general file library to the file list of the compiled file, and imports the SV general file library in the verification environment. When editing the compiled source file, the staff inputs the configuration instructions to the execution body of step 101 through the SV general database in the file list of the compiled file. The configuration instructions include code instructions and call instructions, wherein the staff checks the SV general file library in the file list of the compiled file, thereby writing the corresponding call instructions for calling the code group in the SV general file library, and writes the call instructions for the built-in functions in the verification environment through their own understanding of the verification environment. For this reason, the execution body of this step 101, after receiving the configuration instructions from the user, can accurately find the corresponding code group in the referenced SV general file library and the built-in function in the verification environment according to the configuration instructions.

[0038] Specifically, in step 101, according to the configuration instructions from the user, the corresponding compilation source file is generated, including: S1-1, selecting the corresponding engine template according to the configuration instructions; S1-2, generating the compilation source file according to the code instructions and calling instructions in the configuration instructions, and the calling instructions are used to call the macro code group in the engine template and the built-in functions of the verification environment.

[0039] There are multiple engine templates in the SV general file library. The configuration instructions edited by the user include three parts: the first is the engine template selection instruction, the second is the calling instruction of the macro code group and the built-in function, and the third is the conventional manually written code instruction. Among them, the engine template selection instruction is necessary, and at least one of the calling instruction and the code instruction is required.

[0040] To this end, this case selects the corresponding engine template from the SV general file library through step S1-1 to implement the designation of the engine template. Through step S1-2, the corresponding native code is generated according to the code instruction in the configuration instruction, and the calling code for calling the macro code group in the engine template and the built-in function in the verification environment is generated according to the calling instruction in the configuration instruction. The native code and the calling code are filled into the engine template to generate a compiled source file. This case supports the compilation source file to reference the macro code group and built-in function, which reduces the amount of writing of the compiled source file and increases the reusability of the code. Figure 2In , compiled source files are also called dom files.

[0041] Preferably, the engine template is a Python engine template, and the compiled source file is generated according to the jinjia2 language. The jinjia2 language is a special engine in the Python engine template, which has the characteristics of a tree structure; the nodes of the tree structure have three basic forms, namely: mapping, whose value corresponds to the location of the target component that needs to be configured in the verification environment (such as register level, identifier position); sequence, whose value corresponds to the target component name in the ordered list (such as register subscript, identifier name); scalar, whose value corresponds to the target content (such as register value, identifier value).

[0042] For example, the compiled source file generated using the jinjia2 language is: module_a_reg_ral->register_b->random_randrange (0,3,1).

[0043] module_a_reg_ral->register_c->5.

[0044] "module_a_reg_ral-" represents the register level, "register_b-" and "register_c-" represent the register names, and "random_randrange (0,3,1)" and "5" represent the register values, where "5" belongs to the native code and "random_randrange (0,3,1)" belongs to the calling code.

[0045] In some examples, the macro code group is implemented using an automated macro that can directly copy a portion of an existing compiled source file (dom file), perform various syntax and semantic checks, and then use the portion of the compiled source file (dom file) as the source referenced by the macro code group.

[0046] Therefore, each time a macro code group is referenced, a syntax and semantic check is performed to ensure that the generated compiled source file does not have semantic problems. The DOM file corresponding to the unrecognizable macro code group is partially displayed to the user for correction.

[0047] Step 102: using a corresponding script according to the recognition result of the compilation source file, the compilation source file is rendered into a compilation basic file.

[0048] Specifically, the implementation of step 102 includes: identifying the engine template of the compilation source file, rendering the compilation source file using the script corresponding to the engine template, and obtaining a compilation basic file composed of basic elements.

[0049] Since each engine template has a specific style, the engine template can be accurately identified based on the style of the compiled source file. When the engine template is a Python engine template, the corresponding script in this step is a python script. The python script identifies the macro code group and built-in function based on the specific style of the Python engine template, identifies the macro code group based on {{}}, and identifies the built-in function based on a specific string. For example, random_randrange(0,3,1) is identified as a random value function in the built-in function.

[0050] Use the script corresponding to the engine template to render the compiled source file: call the script corresponding to the engine template to run the compiled source file, update the running result of the calling code in the compiled source file (calling the macro code group in the engine template and the built-in function in the verification environment) to the corresponding target content, keep the native code (code instruction generation) in the compiled source file, and obtain the compilation basic file of the corresponding compiled source file. For example, run the calling code "module_a_reg_ral->register_b->random_randrange (0,3,1)" in the compiled source file using the script, and randomly generate a value of 1 between 0-3 with a step length of 1, then "module_a_reg_ral->register_b->random_randrange (0,3,1)" is rendered as "module_a_reg_ral->register_b->1"; for another example, the native code "module_a_reg_ral->register_c->5" in the compiled source file is still "module_a_reg_ral->register_c->5" after running the script.

[0051] This step uses the script corresponding to the engine template to run the compilation source file to obtain the compilation basic file. The macro code group and built-in functions in the compilation source file are run using the script, and the running results are used as part of the compilation basic file. Figure 2 In the compilation, the basic file is generated by parsing the compilation source file (dom file) and is represented by the dom.out file.

[0052] Step 103, read the compilation basic file to generate a compilation sequence, the compilation sequence includes target addressing and target content.

[0053] Specifically, the implementation of step 103 includes: reading the compilation basic file line by line, generating a compilation sequence corresponding to each line, wherein the compilation sequence includes mutually related register levels, register names and register values, or mutually related identifier addresses, identifier names and identifier values.

[0054] The rendered compilation base file is read line by line, where "line" refers to the code line, not the natural line. Each line of code read from the compilation base file is used as a compilation sequence. The compilation sequence consisting of the register hierarchy, register name, and register value indicates the mapping assignment update to the register in the verification environment. The compilation sequence consisting of the identifier address, identifier name, and identifier value indicates the mapping assignment update to the identifier in the verification environment.

[0055] For example, the compilation base file is: module_a_reg_ral->register_b->1; module_a_reg_ral->register_c->5.

[0056] There are two compilation sequences generated by reading the compilation basic file. The first compilation sequence is "module_a_reg_ral, register_b, 1", and the second compilation sequence is "module_a_reg_ral, register_c, 5".

[0057] Step 104, mapping all compilation sequences to the target components corresponding to the target addressing in the verification environment, and assigning the target content to the target components.

[0058] Specifically, since there are two types of compilation sequences, the first type is composed of register hierarchy, register name and register value, and indicates mapping assignment update to registers in the verification environment; the second type is composed of identifier address, identifier name and identifier value, and indicates mapping assignment update to identifiers in the verification environment.

[0059] If the compilation sequence is the first type, step 104 includes: when the compilation sequence includes a register level, a register name and a register value, matching the corresponding target register in the string pool in the verification environment according to the register level and the register name; when the target register does not exist, discarding the compilation sequence read this time and reading the next compilation sequence; when the target register exists, assigning the register value to the target register.

[0060] When mapping and assigning values ​​to the interrelated register levels, register names, and register values ​​in the compilation sequence, if the target register in the verification environment can be locked based on the register level and register name, the register value is directly mapped to the target register as the value; if the target register in the verification environment cannot be locked based on the register level and register name, the group of compilation sequences is directly discarded and the compilation sequence in the next line of the compilation base file is read instead.

[0061] For example, refer to Figure 2, the compilation sequence is "module_a_reg_ral, register_b, 1", find the corresponding string pool A according to the register level "module_a_reg_ral", find the target register b from the string pool A according to the register name "register_b", and assign the register value "1" to the target register b through mapping. The compilation sequence is "module_a_reg_ral, register_c, 5", find the corresponding string pool A according to the register level "module_a_reg_ral", find the target register c from the string pool A according to the register name "register_c", and assign the register value "1" to the target register c through mapping.

[0062] If the compilation sequence is the second type, step 104 includes: when the compilation sequence includes an identifier address, an identifier name, and an identifier value, matching the target identifier in the verification environment according to the identifier address and the identifier name, and assigning the identifier value to the target identifier. For this reason, this case also supports the assignment and mapping of identifiers in the verification environment. When running, this case is not limited to the mapping of register values. For some identifiers in the verification environment, after being declared using a macro code group, this method can also be used to map values.

[0063] Step 105 , filter unassigned registers in the string pool as pending registers, and assign unique random values ​​to the pending registers in sequence.

[0064] Specifically, after all compilation sequences generated by reading the compilation basic file in step 103 are executed in step 104, it is checked whether there are any unassigned registers in the string pool corresponding to the register level, and these unassigned registers are used as pending registers. Random numbers are generated and assigned to the pending registers.

[0065] 0065 For example, reference Figure 2 , the string pool corresponding to the register level "module_a_reg_ral" is A, and A includes registers b, registers c, and registers d. After step 104 is executed, register b is assigned a value of 1, register c is assigned a value of 5, and register d is assigned a value, and register d is used as a pending register. Generate a random number of 9, and assign 9 to register d. This ensures that all registers in string pool A are assigned values. Ensure that in the string pools corresponding to all register levels in the compilation base file, each register in the string pool is assigned a new value to avoid the registers in the string pool using the default value for a long time and interfering with each other during simulation operation in the verification environment.

[0066] The step division of the above-mentioned methods is only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. Adding insignificant modifications or introducing insignificant designs to the algorithm or process without changing the core design of the algorithm and process are all within the scope of protection of this patent.

[0067] Second embodiment: The second embodiment of the present invention provides a compilation device for chip verification. Figure 3 , a compilation device for chip verification, including an instruction acquisition unit 301, a writing unit 302, an identification unit 303, a rendering unit 304, a reading unit 305, a mapping matching unit 306 and a register value supplement unit 307; An instruction acquisition unit 301 is used to acquire configuration instructions from a user; The writing unit 302 is connected to the instruction acquisition unit 301 and is used to generate a corresponding compilation source file in a verification environment according to the configuration instruction; The identification unit 303 is connected to the writing unit 302 and is used to identify the compilation source file and specify the corresponding script; The rendering unit 304 is connected to the writing unit 302 and the identification unit 303, and is used to render the compilation source file according to the script to obtain a compilation basic file; The reading unit 305 is connected to the rendering unit 304 and is used to read the compilation basic file and generate a compilation sequence, wherein the compilation sequence includes target addressing and target content; A mapping matching unit 306 is connected to the reading unit 305 and the target component, and is used to map all compilation sequences to the target components corresponding to the target addressing in the verification environment, and assign the target content to the target component; The register value complement unit 307 is connected to the target location and is used to screen unassigned registers in the string pool in the verification environment as pending registers and assign unique random values ​​to the pending registers.

[0068] This case generates a compiled source file in a verification environment, supports referencing macro code groups and calling built-in functions, reduces the amount of compilation source file dom writing, and increases the reusability of the code. When editing a compiled source file, this case only needs to write a compiled source file for the target device, and does not need to rewrite the entire text, omitting the time for recompiling the verification environment, improving verification efficiency, and facilitating designers to directly modify register values. Random numbers are assigned to these pending registers to avoid the long-term use of default values ​​for registers in the string pool, which causes interference failures in the verification environment during simulation operation.

[0069] Other implementation details and working methods of the compilation device for chip verification disclosed in this application are the same as or similar to the compilation method for chip verification described above, and are not repeated here.

[0070] Third embodiment: A third embodiment of the present invention provides a computing device, referring to Figure 4 , including: a processor 401; and a memory 402, storing a computer program, when the computer program is executed by the processor 401, the processor 401 executes the compilation method for chip verification as described above.

[0071] Although the embodiments of the present invention are described in detail above, it is obvious to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations are within the scope and spirit of the present invention as described in the claims. Moreover, the present invention described herein may have other embodiments and may be implemented or realized in a variety of ways.

Claims

1. Compilation method for chip verification, It is characterized in that The method comprises: Based on the verification environment and configuration instructions from the user, the corresponding compilation source files are generated; Using a corresponding script according to the recognition result of the compilation source file, rendering the compilation source file into a compilation basic file; Reading the compilation basic file to generate a compilation sequence, the compilation sequence including target addressing and target content; Mapping all compilation sequences to the target components corresponding to the target addressing in the verification environment, and assigning the target content to the target components; The step of reading the compilation basic file to generate a compilation sequence includes: Reading the compilation basic file line by line to generate a compilation sequence corresponding to each line; the compilation sequence includes interrelated register levels, register names and register values ​​to indicate mapping assignment updates to registers in the verification environment, or, An identifier address, an identifier name, and an identifier value that are associated with each other to indicate a mapping assignment update to an identifier in a verification environment.

2. The compilation method for chip verification according to claim 1, It is characterized in that Before generating a corresponding compilation source file based on the verification environment and according to a configuration instruction from a user, the method further includes: The SV general file library is imported into the verification environment so that the compiled source file generated in the verification environment can call the built-in functions in the SV general file library.

3. The compilation method for chip verification according to claim 1, It is characterized in that The generating of the corresponding compilation source file according to the configuration instruction from the user includes: A corresponding engine template is selected according to the configuration instruction, and a compilation source file is generated according to the code instruction and the calling instruction in the configuration instruction, wherein the calling instruction is used to call the macro code group in the engine template and the built-in function of the verification environment.

4. The compilation method for chip verification according to claim 3, It is characterized in that When the engine template is a Python engine template, the compiled source file is generated according to the jinjia2 language.

5. The compilation method for chip verification according to claim 3, It is characterized in that According to the recognition result of the compilation source file, a corresponding script is used to render the compilation source file into a compilation basic file, including: An engine template of the compiled source file is identified, and a script corresponding to the engine template is used to render the compiled source file to obtain a compiled basic file composed of basic elements.

6. The compilation method for chip verification according to claim 1, It is characterized in that Mapping all compilation sequences to the target components corresponding to the target addressing in the verification environment, and assigning the target content to the target components, including: When the compilation sequence includes a register level, a register name and a register value, the corresponding target register in the string pool in the verification environment is matched according to the register level and the register name; when the target register does not exist, the compilation sequence read this time is discarded and the next compilation sequence is read; when the target register exists, the register value is assigned to the target register.

7. The compilation method for chip verification according to claim 6, It is characterized in that After all compilation sequences are mapped to the target components corresponding to the target addressing in the verification environment, the method further includes: Unassigned registers in the string pool are screened as pending registers, and unique random values ​​are assigned to the pending registers in sequence.

8. The compilation method for chip verification according to claim 1, It is characterized in that Mapping all compilation sequences to the target components corresponding to the target addressing in the verification environment, and assigning the target content to the target components, including: When the compilation sequence includes an identifier address, an identifier name, and an identifier value, the target identifier in the verification environment is matched according to the identifier address and the identifier name, and the identifier value is assigned to the target identifier.

9. Compiler for chip verification, It is characterized in that It includes an instruction acquisition unit, a writing unit, a recognition unit, a rendering unit, a reading unit and a mapping matching unit; The instruction acquisition unit is used to acquire configuration instructions from the user; The writing unit is used to generate a corresponding compilation source file in a verification environment according to the configuration instruction; The identification unit is used to identify the compiled source file and specify a corresponding script; The rendering unit is used to render the compilation source file according to the script to obtain a compilation basic file; The reading unit is used to read the compilation basis file and generate a compilation sequence, wherein the compilation sequence includes target addressing and target content, and specifically includes reading the compilation basis file line by line to generate a compilation sequence corresponding to each line; the compilation sequence includes mutually related register levels, register names and register values ​​to indicate mapping assignment updates to registers in the verification environment, or mutually related identifier addresses, identifier names and identifier values ​​to indicate mapping assignment updates to identifiers in the verification environment; The mapping and matching unit is used to map all compilation sequences to the target components corresponding to the target addressing in the verification environment, and assign the target content to the target components.

10. The compiling device for chip verification according to claim 9, It is characterized in that The compiling device also includes a register value supplement unit; The register complement unit is used to screen unassigned registers in the string pool in the verification environment as pending registers after mapping all compilation sequences to the target parts corresponding to the target addressing in the verification environment respectively, and assign unique random values ​​to the pending registers in turn.

11. A computing device, It is characterized in that include: processor; as well as, A memory storing a computer program, which, when executed by the processor, enables the processor to execute the compilation method for chip verification as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Verification platform automatic integration method and system, electronic equipment and storage medium

    CN112270149A

  • Chip verification method, device and chip verification platform

    CN113722163A

  • Register mapping method and device based on system-level verification scene

    CN117034816A

  • Test case generation method, chip verification method, chip verification system and medium

    CN117290209A

  • Bit-reduced verification for memory arrays

    US11062077B1

Cited By

  • Firmware upgrading method and device, equipment, storage medium and program product

    CN119847557A