Method and system for generating function coverage rate file, electronic equipment and storage medium

By analyzing the test design file to be extracted, the inefficiency problem in traditional methods is solved, and the automatic generation and accuracy of functional coverage files are achieved.

CN120449777APending Publication Date: 2025-08-08HYGON INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510502283.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The traditional functional coverage generation method relies on manual operation, is inefficient and easy to miss, making it difficult to meet the actual needs of integrated circuit verification.

Method used

By analyzing the test design file, the signal characteristic information is extracted, including the signal name, bit width attribute and logical association relationship between signals, the table file is generated, and the functional coverage file is converted based on the signal name field and the corresponding coverage point field.

Benefits of technology

The automatic generation of functional coverage files is realized, which improves the generation efficiency and accuracy, and avoids inefficiency and omissions in manual operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120449777A_ABST
    Figure CN120449777A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a method and system for generating a function coverage file, electronic equipment and a storage medium, relates to the technical field of semiconductor verification, and can effectively improve the efficiency and accuracy of generating the function coverage file. The method comprises the steps that a tested design file is analyzed, and signal feature information in the tested design file is extracted; the signal feature information comprises a signal name, a bit width attribute and a logic association relationship between signals; generating a table file based on the signal feature information, wherein the table file comprises a signal name field and a corresponding coverage point field; and analyzing the table file, and converting and generating a function coverage rate file according to the signal name field and the corresponding coverage point field. The method is suitable for verification scenes of semiconductors such as chips and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of semiconductor verification technology, and in particular to a method, system, electronic device and storage medium for generating a functional coverage file. Background Art

[0002] In integrated circuit verification, functional coverage is a key metric for measuring verification completeness. Traditional functional coverage generation methods typically extract signals, calculate function points, and analyze coverage, ultimately generating a functional coverage file for integration into the testbench. However, this method often relies on manual labor, resulting in low efficiency and prone to omissions. As design complexity increases, it becomes difficult to meet practical requirements. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a method, system, electronic device, and storage medium for generating a functional coverage file, which can effectively improve the efficiency and accuracy of generating a functional coverage file.

[0004] In a first aspect, an embodiment of the present invention provides a method for generating a functional coverage file, comprising: parsing a design file under test, and extracting signal feature information in the design file under test; the signal feature information comprises: signal name, bit width attribute, and logical association relationship between signals; generating a table file based on the signal feature information, the table file comprising a signal name field and a corresponding coverage point field; parsing the table file, and generating a functional coverage file according to conversion of the signal name field and the corresponding coverage point field.

[0005] According to a specific implementation method of an embodiment of the present application, the table file is generated based on the signal characteristic information, including: importing the signal name into the signal name field; calculating the functional points that need to be covered corresponding to each signal name according to the bit width attribute; and importing the functional points into the coverage point field.

[0006] According to a specific implementation method of an embodiment of the present application, the function points that need to be covered corresponding to each signal name are calculated based on the bit width attribute, including: when the bit width value carried by the bit width attribute is less than a predetermined bit width threshold, generating function points covering the entire value range; when the bit width value carried by the bit width attribute is greater than the predetermined bit width threshold, generating function points covering the boundary values at both ends and each segmented interval.

[0007] According to a specific implementation method of an embodiment of the present application, the table file generated based on the signal characteristic information also includes: generating a signal combination with a cross relationship based on the signal name and the logical association relationship between the signals; importing the signal combination into the signal name field; calculating based on the signal bit width attributes of the signals constituting the signal combination, determining the corresponding functional points that need to be covered, and importing them into the coverage point field.

[0008] According to a specific implementation method of an embodiment of the present application, the corresponding functional points that need to be covered are determined based on the calculation of the signal bit width attributes constituting the signal combination, including: performing a Cartesian product calculation based on the bit width values carried by the signal bit width attributes constituting the signal combination to obtain the functional points that need to be covered by the cross-combination signal.

[0009] According to a specific implementation method of an embodiment of the present application, the parsing of the table file and the conversion to generate a functional coverage file based on the signal name field and the corresponding coverage point field include: parsing the structure of the table file and the values of the corresponding fields; mapping the values corresponding to the signal name field and the corresponding coverage point field to a preset coverage model to generate a functional coverage file.

[0010] According to a specific implementation of the embodiment of the present application, the table file is an Excel table with a preset structure.

[0011] According to a specific implementation of an embodiment of the present application, the design file under test includes multiple source files such as RTL code, UVM register model file, etc.

[0012] In the second aspect, an embodiment of the present application provides a system for generating a functional coverage file, including: a first parsing unit, used to parse the design file under test and extract signal feature information in the design file under test; the signal feature information includes: signal name, bit width attribute and logical association relationship between signals; a generation unit, used to generate a table file based on the signal feature information, the table file including a signal name field and a corresponding coverage point field; a second parsing unit, used to parse the table file, and generate a functional coverage file according to the conversion of the signal name field and the corresponding coverage point field.

[0013] According to a specific implementation method of an embodiment of the present application, the generation unit includes: a first import module, used to import the signal name into the signal name field; a calculation module, used to calculate the functional points that need to be covered corresponding to each signal name based on the bit width attribute; a second import module, used to import the functional points into the coverage point field.

[0014] According to a specific implementation method of an embodiment of the present application, the calculation module includes: a first generation sub-module, which is used to generate function points covering the entire value range when the bit width value carried by the bit width attribute is less than a predetermined bit width threshold; and a second generation sub-module, which is used to generate function points covering the boundary values at both ends and each segmented interval when the bit width value carried by the bit width attribute is greater than the predetermined bit width threshold.

[0015] According to a specific implementation method of an embodiment of the present application, the generation unit includes: a first generation module, which is used to generate a signal combination with a cross relationship based on the signal name and the logical association relationship between the signals; a third import module, which is used to import the signal combination into the signal name field; and a determination module, which is used to calculate based on the signal bit width attributes of the signals constituting the signal combination, determine the corresponding functional points that need to be covered, and import them into the coverage point field.

[0016] According to a specific implementation method of an embodiment of the present application, the determination module includes: a calculation submodule, which is used to perform Cartesian product calculation based on the bit width values carried by the signal bit width attributes constituting the signal combination to obtain the functional points that need to be covered by the cross-combination signal.

[0017] According to a specific implementation method of an embodiment of the present application, the second parsing unit includes: a parsing module for parsing the structure of the table file and the values of the corresponding fields; a second generation module for mapping the values corresponding to the signal name field and the corresponding coverage point field to a preset coverage model to generate a functional coverage file.

[0018] According to a specific implementation of the embodiment of the present application, the table file is an Excel table with a preset structure.

[0019] According to a specific implementation of an embodiment of the present application, the design file under test includes multiple source files such as RTL code, UVM register model file, etc.

[0020] In a third aspect, an embodiment of the present invention provides an electronic device, characterized in that it comprises a memory and a processor, wherein the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, and is used to execute any method of generating a functional coverage file described in the first aspect.

[0021] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores one or more computer programs. When the one or more computer programs are executed by one or more processors, the method for generating a functional coverage file as described in any one of the first aspects is implemented.

[0022] The method, system, electronic device and storage medium for generating a functional coverage file provided in the embodiment of the present application no longer manually extract signals, calculate function points and analyze coverage, but instead parse the design file under test to extract signal feature information in the design file under test; the signal feature information includes: signal name, bit width attribute and logical association relationship between signals; a table file is generated based on the signal feature information, the table file includes a signal name field and a corresponding coverage point field; the table file is parsed, and a functional coverage file is generated according to the signal name field and the corresponding coverage point field conversion. In this way, by parsing the table file and generating a functional coverage file according to the signal name field and the corresponding coverage point field, the coverage definition process of functional verification can be automated, avoiding the problem of low efficiency and easy omissions in manually generating functional coverage files, and effectively improving the efficiency and accuracy of generating functional coverage files. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0024] Figure 1 A flow chart of a method for generating a function coverage file provided by an embodiment of the present invention; Figure 2 A schematic diagram of a process for generating a function coverage file in an embodiment of the present invention; Figure 3 A schematic diagram of the basic structure of the verification environment in an embodiment of the present invention; Figure 4 A schematic structural diagram of a file system for generating functional coverage provided by an embodiment of the present invention; Figure 5 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0025] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0026] It should be understood that the embodiments described are only a portion of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative work are within the scope of protection of the present invention.

[0027] In a first aspect, an embodiment of the present invention provides a method for generating a function coverage file, which can effectively improve the efficiency and accuracy of generating the function coverage file.

[0028] like Figure 1 As shown, an embodiment of the present invention provides a method for generating a function coverage file, comprising: S11, parsing the design file under test and extracting signal feature information from the design file under test; the signal feature information includes: signal name, bit width attribute and logical relationship between signals; Parsing the design file under test and extracting signal characteristic information is a key step in digital circuit design and verification. The design file under test is typically a hardware description language file, such as an HDL file. In one embodiment, common types of design files under test may be Verilog, VHDL, and SystemVerilog. The signal characteristic information extracted from the design file includes signal name, bit width attribute, and logical association relationship. The signal name is the unique identifier of the signal; the bit width attribute refers to the bit width of the signal, such as 1 bit, 8 bits, 32 bits, etc.; the logical association relationship is the connection relationship between signals. In one embodiment, the connection relationship includes input, output, internal connection, etc.

[0029] When parsing a design file, the design file is first read and the design file contents are read using a file reading tool. In one embodiment, Python's open function can be used to read the contents. The file contents are then stored as a string or list for subsequent parsing. Signal declarations are then parsed, signal declaration statements are searched, and signal names and bit width attributes are extracted. In one embodiment, for example, when the design file is a Verilog file, signal declarations typically begin with keywords such as input, output, wire, and reg. When parsing logical associations, it is necessary to search for connection relationships between signals, which typically appear in assignment statements or module instantiations. Finally, signal feature information is constructed, and the extracted signal names, bit width attributes, and logical associations are stored as structured data. In one embodiment, the structured data is a dictionary, list, or class object.

[0030] S12, generating a table file based on the signal characteristic information, wherein the table file includes a signal name field and a corresponding coverage point field; The structured data is written into a table file using a file writing tool to write the signal feature information. In some embodiments, the file writing tool is Python's csv module or pandas library. The table file includes a signal name field and a corresponding coverpoint field, where a coverpoint refers to a key information point that can fully describe the operating state or value range of the signal. For example, for a discrete signal with a limited value range, the coverpoints may be all its possible values; for a continuously changing analog signal, the coverpoints may be its maximum value, minimum value, and some key intermediate value points, or characteristic values under different operating modes. If the signal has a logical or timing relationship with other signals, the relevant cross-coverpoints must also be considered, that is, the key states that reflect the interaction between the signals.

[0031] Based on actual needs, the content and generation logic of the table file can also be expanded. In some embodiments, the table file can support more fields, such as signal type, clock domain, reset signal, etc.; support complex coverage points. In one embodiment, complex coverage points include range coverage, cross coverage, etc.; support multiple file formats, such as Excel and JSON.

[0032] By using the above method of generating table files based on signal feature information, the table files required for the functional coverage model can be automatically generated, thereby improving verification efficiency and ensuring the accuracy of coverage definition.

[0033] S13, parsing the table file, and generating a function coverage file according to the signal name field and the corresponding coverage point field conversion.

[0034] When parsing a table file, the table file is first read using a file reading tool. In some embodiments, the table file can be read using the Python csv module or the pandas library. The file contents are then stored as structured data. Signal names and coverpoints are parsed by iterating through each row in the table file and extracting the signal name and coverpoint fields. Corresponding coverpoint definitions are generated based on the coverpoint fields. A functional coverage file is then generated. The parsed signal names and coverpoints are converted into SystemVerilog code and written to the functional coverage file.

[0035] By parsing table files and generating functional coverage files based on signal names and coverpoint fields, the coverage definition process for functional verification can be automated. This approach improves verification efficiency and ensures the completeness and consistency of coverage points. In practical applications, the sources for generating functional coverage can be further expanded, and the parsing logic and generation rules can be extended to meet specific needs, supporting more complex coverpoint definitions and cross-coverage.

[0036] The method for generating a functional coverage file provided by the embodiment of the present application no longer involves manually extracting signals, calculating functional points, and analyzing coverage. Instead, the method extracts signal feature information from the tested design file by parsing the tested design file; the signal feature information includes: signal name, bit width attribute, and logical association between signals; a table file is generated based on the signal feature information, the table file includes a signal name field and a corresponding coverage point field; the table file is parsed, and a functional coverage file is generated based on the signal name field and the corresponding coverage point field. In this way, by parsing the table file and generating a functional coverage file based on the signal name field and the corresponding coverage point field, the coverage definition process of functional verification can be automated, avoiding the problem of low efficiency and easy omissions in manually generating functional coverage files, and effectively improving the efficiency and accuracy of generating functional coverage files.

[0037] In some embodiments, generating a table file based on the signal characteristic information includes: importing the signal name into the signal name field; calculating the functional points that need to be covered corresponding to each signal name according to the bit width attribute; and importing the functional points into the coverage point field.

[0038] Based on the bit width properties of the signal, calculate the functional points that need to be covered. For example, for a 1-bit signal, the coverage points are 0 and 1; for a multi-bit signal, the coverage points can include minimum value, maximum value and typical value, where typical values include 0x00, 0xFF, etc.

[0039] In some embodiments, the function points that need to be covered corresponding to each signal name are calculated based on the bit width attribute, including: when the bit width value carried by the bit width attribute is less than a predetermined bit width threshold, generating function points covering the entire value range; when the bit width value carried by the bit width attribute is greater than the predetermined bit width threshold, generating function points covering the boundary values at both ends and each segmented interval.

[0040] When calculating the function coverage points corresponding to the signal name based on the bit width attribute, the following strategy can be adopted: when the bit width value is less than the predetermined bit width threshold, generate function points covering the full value range, that is, covering all possible values; When the bit width value exceeds the predetermined bit width threshold, function points covering both end boundary values and each segmented interval are generated, reducing the number of coverage points and improving the efficiency of coverage analysis. This method can efficiently generate the coverage points required for the functional coverage model while balancing the accuracy and computational complexity of the coverage analysis.

[0041] For example, when calculating function points, a bit width threshold is first predetermined. The predetermined bit width threshold is a user-defined parameter used to distinguish between full range coverage and segmented interval coverage. For example, when the threshold is set to 6, it is full range coverage; when the threshold is set to 16, it is segmented interval coverage. At the same time, the function point generation rules can be set according to the bit width. When the bit width is less than or equal to the predetermined bit width threshold, function points with full range coverage are generated, that is, all possible values are covered. For example: when the bit width is set to 2, the function points are [0, 1, 2, 3]; when the bit width is set to 8, the function points are [0, 1, 2, ..., 255]. When the bit width is greater than the predetermined bit width threshold, function points with boundary values at both ends and segmented intervals are generated, where the boundary values at both ends are the minimum value 0 and the maximum value max, and the maximum value max is , where n is the bit width and is greater than or equal to 1. The segmentation interval is to evenly divide the range into several intervals, taking the start and end points of each interval. For example, assuming a bit width of 16 and divided into two intervals, the function points can be [0, 32767] and [32767, 65535].

[0042] In some embodiments, the table file generated based on the signal characteristic information also includes: generating a signal combination with a cross relationship based on the signal name and the logical association relationship between the signals; importing the signal combination into the signal name field; calculating based on the signal bit width attributes of the signals constituting the signal combination, determining the corresponding functional points that need to be covered, and importing them into the coverage point field.

[0043] Correlation analysis is performed on the extracted signals to identify signal combinations with cross-relationships. Signal names and the logical relationships between signals are determined based on their logical relationships, timing relationships, and data dependencies. Logical relationships include logical operations such as AND, OR, and NOT. Timing relationships can include signal triggering sequences and synchronization relationships. Data dependencies mean that the value of one signal depends on the value of another. Based on the signal names and the logical relationships between signals, signal combinations with cross-relationships are generated. Cross-relationship signal combinations refer to combinations between multiple signals and are typically used for cross coverage in functional coverage analysis. When generating signal combinations with cross-relationships based on the logical relationships between signals, if signal A is connected to signal B, a combination of signals A and B is generated. If signals A and B are not connected but both are connected to signal C, a combination of signals A and B is generated.

[0044] Import signal combinations into the Signal Name field; determine the corresponding function points to be covered based on the bit width properties of the signals that make up the signal combination, and import them into the Coverage Point field. This generates a table file containing information such as signal name, signal combination, and function point. This method efficiently generates the required coverage points for the functional coverage model while supporting cross-coverage analysis, improving the completeness and accuracy of verification.

[0045] In some embodiments, the corresponding functional points that need to be covered are determined based on the calculation of the signal bit width attributes constituting the signal combination, including: performing a Cartesian product calculation based on the bit width values carried by the signal bit width attributes constituting the signal combination to obtain the functional points that need to be covered by the cross-combination signal.

[0046] When generating functional coverage points for cross-relationship signal combinations, the Cartesian product calculation can be used to determine the function points that need to be covered. The Cartesian product refers to combining elements from multiple sets to generate all possible combinations. For signal combinations, the Cartesian product calculation combines the function points of each signal to generate the function points that need to be covered for the cross-relationship signal. The core idea of the Cartesian product calculation is to combine the function points of multiple signals to generate all possible combinations. For example, the function points of signal A are [0, 1]. The function points of signal B are [0, 255], and the Cartesian product result is [(0, 0), (0, 255), (1, 0), (1, 255)]. For each signal combination, the Cartesian product of the function points of the signals constituting the combination is calculated. When the function points of signal A are [31:0] and the function points of signal B are 0, 255, [0:63], [64:128], the Cartesian product result is {0×[31:0], 255×[31:0], [0:63]×[31:0], [64:128]×[31:0]}. The function points that need to be covered by the cross-combination signal are {0×[31:0], 255×[31:0], [0:63]×[31:0], [64:128]×[31:0]}. Finally, the Cartesian product result is converted into a function point format, such as a string or a list.

[0047] In some embodiments, the parsing of the table file and generating a functional coverage file based on the conversion of the signal name field and the corresponding coverage point field include: parsing the structure of the table file and the values of the corresponding fields; mapping the values corresponding to the signal name field and the corresponding coverage point field to a preset coverage model to generate a functional coverage file.

[0048] The functional coverage file is usually a hardware verification language file. In some embodiments, the functional coverage file includes a covergroup, a coverpoint, and a cross coverage. The covergroup is a set of defined coverpoints, the coverpoint is a definition of specific coverage conditions, and the cross coverage is a definition of cross conditions between multiple coverpoints.

[0049] Use a file reading tool to read the contents of the table file, which includes information such as signal names, signal combinations, and functional points. The file contents are stored as structured data. The signal name and coverpoint field values are then mapped to the preset coverage model. The corresponding coverpoint definition is generated based on the coverpoint field, and the mapped coverage model is written to the functional coverage file. The tool for generating functional coverage can use scripts or other programming languages. By parsing the table file and generating the functional coverage file based on the signal name field and the corresponding coverpoint field, the coverage definition process for functional verification can be automated. This method can improve verification efficiency and ensure the completeness and consistency of the coverpoints. In actual applications, the parsing logic and generation rules can be expanded according to specific needs to support more complex coverpoint definitions and cross-coverage.

[0050] In some embodiments, the table file is an Excel table with a preset structure.

[0051] When generating a table file based on signal feature information, a script can be used to create an Excel table using a professional table processing library, such as the pandas library in Python. In one embodiment, the Excel table is shown in Table 1, which contains two columns: signal name and covered function points. The table file is not limited to Table 1 and can also be in other formats. For the signal name column, the extracted signal name will be filled in completely and accurately; for the covered function point column, the calculated function point information will be organized and filled in according to a unified format. In one embodiment, the format can be [minimum value: maximum value] to represent the value range, and individual values can be listed directly. At the same time, the functional coverage information of the signal intersection can also be recorded in the appropriate location of the table for subsequent review and analysis. The appropriate location of the table can be the last row.

[0052]

[0053] Figure 2 A flow chart showing the process of generating functional coverage files for this application is shown below: Figure 2 As shown in the figure, after generating the Excel file, you can manually add functional coverage points through the table file, and then use the script to generate the functional coverage file; you can also parse the table file and automatically generate the functional coverage file based on the signal name field and the corresponding coverage point field in the table file.

[0054] In some embodiments, the design file under test includes multiple source files such as RTL code, UVM register model file, etc.

[0055] When parsing the design files under test, they can be RTL (Register Transfer Level) code files or various files with specific naming conventions within the verification environment. These files include, but are not limited to: module input / output port definition files written in hardware description languages such as Verilog and VHDL; signal configuration files for each register field; and register model files built using UVM (Universal Verification Methodology). The module input / output port definition files detail the interface signals for data exchange between the module and the external world; the signal configuration files for each register field contain the functions and signals represented by the different bit fields within the register; and the register model files built using UVM abstractly model register behavior and access rules.

[0056] In some embodiments, based on actual needs, the generation logic of the functional coverage file can be expanded to cyclically parse all modules in a design to expand the scope of automatically generated functional coverage.

[0057] In some embodiments, after the functional coverage file is generated, the functional coverage file is integrated into the verification environment to check whether the functional coverage file is correctly integrated and whether the verification process is performed in accordance with the functional coverage requirements. Figure 3 This is a schematic diagram of the basic structure of a typical verification environment, such as Figure 3 As shown in the figure, the system mainly consists of three parts: stimulus generator, comparator (checker), and functional coverage. Functional coverage files are added to the verification environment and covergroups are instantiated in the testbench. Correct integration of the functional coverage files is verified through compilation, simulation, and coverage reports. Test cases are designed to ensure that all coverage points are covered, and the coverage results are analyzed.

[0058] In a second aspect, an embodiment of the present invention provides a system for generating a function coverage file, which can effectively improve the efficiency and accuracy of generating the function coverage file.

[0059] like Figure 4 As shown, an embodiment of the present invention further provides a system for generating a function coverage file, comprising: The first parsing unit 31 is used to parse the design file under test and extract signal feature information from the design file under test; the signal feature information includes: signal name, bit width attribute and logical relationship between signals; A generating unit 32, configured to generate a table file based on the signal characteristic information, wherein the table file includes a signal name field and a corresponding coverage point field; The second parsing unit 33 is configured to parse the table file and convert and generate a function coverage file according to the signal name field and the corresponding coverage point field.

[0060] The system for generating a functional coverage file provided by an embodiment of the present invention no longer manually extracts signals, calculates function points, and analyzes coverage. Instead, it extracts signal feature information from the tested design file by parsing the tested design file; the signal feature information includes: signal name, bit width attribute, and logical association between signals; a table file is generated based on the signal feature information, the table file includes a signal name field and a corresponding coverage point field; the table file is parsed, and a functional coverage file is generated according to the signal name field and the corresponding coverage point field. In this way, by parsing the table file and generating a functional coverage file according to the signal name field and the corresponding coverage point field, the coverage definition process of functional verification can be automated, avoiding the problem of low efficiency and easy omissions in manually generating functional coverage files, and effectively improving the efficiency and accuracy of generating functional coverage files.

[0061] In some embodiments, the generation unit includes: a first import module for importing the signal name into the signal name field; a calculation module for calculating the functional points that need to be covered corresponding to each signal name based on the bit width attribute; and a second import module for importing the functional points into the coverage point field.

[0062] In some embodiments, the calculation module includes: a first generation submodule, which is used to generate function points covering the entire value range when the bit width value carried by the bit width attribute is less than a predetermined bit width threshold; and a second generation submodule, which is used to generate function points covering the boundary values at both ends and each segmented interval when the bit width value carried by the bit width attribute is greater than the predetermined bit width threshold.

[0063] In some embodiments, the generation unit includes: a first generation module, used to generate a signal combination with a cross relationship based on the signal name and the logical association relationship between the signals; a third import module, used to import the signal combination into the signal name field; a determination module, used to calculate based on the signal bit width attributes of the signal combination, determine the corresponding functional points that need to be covered, and import them into the coverage point field.

[0064] In some embodiments, the determination module includes: a calculation submodule, configured to perform Cartesian product calculation based on the bit width values carried by the signal bit width attributes constituting the signal combination to obtain the functional points that need to be covered by the cross-combination signal.

[0065] In some embodiments, the second parsing unit includes: a parsing module for parsing the structure of the table file and the values of corresponding fields; a second generation module for mapping the values corresponding to the signal name field and the corresponding coverage point field to a preset coverage model to generate a functional coverage file.

[0066] In some embodiments, the table file is an Excel table with a preset structure.

[0067] In some embodiments, the design file under test includes multiple source files such as RTL code, UVM register model file, etc.

[0068] In a third aspect, an embodiment of the present invention further provides an electronic device that can effectively improve the efficiency and accuracy of generating function coverage files.

[0069] like Figure 5 As shown, the electronic device provided by an embodiment of the present invention may include: a memory 41 and a processor 42; the memory 41 is used to store executable program code; the processor 42 runs the program corresponding to the executable program code by reading the executable program code stored in the memory 41, and is used to execute the method for generating a functional coverage file provided by any of the aforementioned embodiments.

[0070] The specific execution process of the above steps by the processor 42 and the steps further executed by the processor 42 by running the executable program code can be found in the description of the above embodiment and will not be repeated here.

[0071] In the fourth aspect, an embodiment of the present invention also provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement any method of generating a functional coverage file provided in the aforementioned embodiments, thereby also achieving the corresponding technical effects, which have been described in detail above and will not be repeated here.

[0072] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0073] Each embodiment in this specification is described in a related manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.

[0074] In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0075] For the convenience of description, the above device is described as being divided into various units / modules based on their functions. Of course, when implementing the present invention, the functions of each unit / module can be implemented in the same or multiple software and / or hardware.

[0076] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0077] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A method for generating a function coverage file, characterized in that: include: Parsing the design file under test and extracting signal feature information from the design file under test; The signal characteristic information includes: signal name, bit width attribute and logical association relationship between signals; Generate a table file based on the signal feature information, wherein the table file includes a signal name field and a corresponding coverage point field; The table file is parsed, and a function coverage file is generated according to the signal name field and the corresponding coverage point field conversion.

2. The method according to claim 1, characterized in that The generating a table file based on the signal characteristic information includes: Importing the signal name into the signal name field; Calculating, according to the bit width attribute, the function points that need to be covered corresponding to each of the signal names; Import the function point into the coverage point field.

3. The method according to claim 2, characterized in that Calculating the function points that need to be covered corresponding to each signal name according to the bit width attribute includes: When the bit width value carried by the bit width attribute is less than a predetermined bit width threshold, generating a function point covering the full value range; When the bit width value carried by the bit width attribute is greater than a predetermined bit width threshold, a function point covering both end boundary values and each segment interval is generated.

4. The method according to claim 1, wherein The generating table file based on the signal characteristic information further includes: Generate a signal combination with a cross relationship according to the signal names and the logical association relationship between the signals; Importing the signal combination into the signal name field; The corresponding function points that need to be covered are determined based on the calculation of the signal bit width attributes constituting the signal combination, and are imported into the coverage point field.

5. The method according to claim 4, characterized in that The function points that need to be covered are determined based on the signal bit width attributes constituting the signal combination, including: performing Cartesian product calculation based on the bit width values carried by the signal bit width attributes constituting the signal combination to obtain the function points that need to be covered by the cross-combination signal.

6. The method according to claim 1, characterized in that The parsing of the table file and converting and generating a function coverage file according to the signal name field and the corresponding coverage point field includes: Parsing the structure of the table file and the values of the corresponding fields; The values corresponding to the signal name field and the corresponding cover point field are mapped to a preset coverage model to generate a functional coverage file.

7. The method according to claim 1, characterized in that The table file is an Excel table with a preset structure.

8. The method according to claim 1, characterized in that The tested design files include RTL codes, UVM register model files and other source files.

9. A system for generating a functional coverage file, characterized in that: include: A first parsing unit, configured to parse the design file under test and extract signal feature information from the design file under test; The signal characteristic information includes: signal name, bit width attribute and logical association relationship between signals; A generating unit, configured to generate a table file based on the signal characteristic information, wherein the table file includes a signal name field and a corresponding coverage point field; The second parsing unit is used to parse the table file and generate a function coverage file according to the signal name field and the corresponding coverage point field.

10. An electronic device, characterized in that: The electronic device includes: a memory and a processor, the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, and is used to execute the method for generating a functional coverage file as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores one or more computer programs, and when the one or more computer programs are executed by one or more processors, the method for generating a functional coverage file according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Chip verification code unified generation method and system

    CN121809357A