Method and application of reference model data flow recording and analysis

By performing grammatical lexical analysis of the standard reference model, the target reference model is generated to record and analyze the data flow, and define functional state points and state space, the debugging difficulties and functional coverage collection difficulties caused by opacity in reference model in chip verification are solved. , realizes efficient debugging and completeness verification.

CN114327614BActive Publication Date: 2024-12-27SUZHOU CENTEC COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111645134.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2024-12-27
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

In chip verification, the opacity of the reference model leads to debugging difficulties and functional coverage collection difficulties, existing methods are inefficient and cannot fully verify the completeness of the design specification.

Method used

By performing grammatical lexical analysis of the standard reference model, a target reference model is generated to record and analyze data flows, and a functional state point and state space are defined, and functional coverage is counted to generate coverage reports.

Benefits of technology

Improve debugging efficiency and problem positioning efficiency, ensure verification completeness, through high readability data flow reports and measurement of functional coverage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114327614B_ABST
    Figure CN114327614B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and application for recording and analyzing reference model data flow, the method comprising the following steps: performing grammatical lexical analysis and syntax analysis on a standard reference model to obtain a target reference model, wherein the target reference model comprises source code and print code of the standard reference model, the print code being used to record the source code operation information and status of the standard reference model; and recording and analyzing the reference model data flow according to the data output by the target reference model. The method can convert the standard reference model into a target reference model capable of recording internal data and status, so that the data record output by the target reference model simulation can be used to generate a highly readable data flow report, facilitating data tracking and detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip verification, and in particular to a method and application for recording and analyzing reference model data streams. Background Art

[0002] As designs become more complex, the reference models written according to the design specifications will also become complex. In addition, for complex designs, it is impossible to write test cases for all functions one by one and predict their behaviors. Using constrained random testing methods is an effective way to fully verify complex designs.

[0003] For random testing, since its execution sequence in the design state space is unpredictable, on the one hand, when the output of the design to be tested is inconsistent with the output of the reference model, there may be an error in the design to be tested or the input stimulus configuration is illegal. Because we can only see the final output result of the reference model, but do not know the execution trajectory and data flow of the corresponding test case, it often takes a lot of time to trace and locate the source of the problem.

[0004] The existing solutions are: 1. Manually add some print statements to the reference model to observe the values ​​of the corresponding signals. The disadvantage is that only the specified signals can be observed each time, and the simulation needs to be compiled and simulated repeatedly, which consumes a lot of time, is inefficient and has poor readability. 2. Use software debugging tools to set breakpoints to observe the changes in the internal signals of the reference model. It has good versatility, but the disadvantage is that it is necessary to reverse the intermediate state from the final running result of the model, and execute it step by step repeatedly, which is inefficient.

[0005] On the other hand, when all test cases have passed, the completeness of the verification needs to be measured. The most direct way is to use code coverage, which measures how much code in the design has been executed, but this is the test completeness of the "implementation" of the design specification, not the completeness of the test of the design specification itself. If the design to be tested misses some functional points in the design specification and the random test happens not to cover them, then even if the final code coverage is 100%, this vulnerability cannot be found. Therefore, it is necessary to collect functional coverage to measure the test completeness of the design specification itself.

[0006] The existing implementation scheme is to construct coverage points or coverage groups to sample data for random stimuli at specific moments. It is impossible to exhaust all signal combinations to construct various coverage groups for sampling, which will cause a lot of simulation overhead, and insufficient sampling may miss the functional points corresponding to certain complex signal combinations, making it difficult to achieve relatively complete functional coverage. The reference model is a golden model that reflects the functional description of the design specification. Every line of code and every condition combination in it are important functional points. If the detailed operation information of the reference model is collected to measure the functional coverage, the completeness of the verification can be further guaranteed.

[0007] The information disclosed in this background technology section is only intended to enhance the understanding of the overall background of the invention and should not be regarded as an acknowledgment or any form of suggestion that the information constitutes the prior art already known to a person skilled in the art. Summary of the invention

[0008] The purpose of the present invention is to provide a method and application for recording and analyzing reference model data flows, so as to solve the problems of difficulty in debugging and difficulty in collecting functional coverage caused by the opacity of the reference model.

[0009] To achieve the above objectives, an embodiment of the present invention provides a method for recording and analyzing a reference model data stream.

[0010] In one or more embodiments of the present invention, the method includes: performing lexical analysis and syntax analysis on a standard reference model to obtain a target reference model, wherein the target reference model includes source code and print code of the standard reference model, and the print code is used to record source code running information and status of the standard reference model; and recording and analyzing the reference model data flow based on data output by the target reference model.

[0011] In one or more embodiments of the present invention, the method further includes: defining functional state points and functional state spaces according to the standard reference model, and generating a functional coverage report according to the functional state points and the target reference model.

[0012] In one or more embodiments of the present invention, the lexical analysis and syntax analysis of the standard reference model to obtain the target reference model includes: reading the source code of the standard reference model according to the character stream; converting the source code into corresponding lexical units according to preset conversion rules; performing syntax analysis on the lexical units according to a preset grammar to generate a syntax analysis tree; and performing corresponding semantic actions on the syntax analysis tree according to a preset syntax guidance definition to generate a target reference model.

[0013] In one or more embodiments of the present invention, the data flow of the reference model is recorded and analyzed based on the data output by the target reference model, including: identifying variables in the source code of the standard reference model according to a preset format; and inserting the variables into the corresponding positions of the print code in a preset format to generate print statements, and executing the print statements to obtain a data flow report.

[0014] In one or more embodiments of the present invention, functional status points and functional status spaces are defined according to the standard reference model, and a functional coverage report is generated according to the functional status points and the target reference model, including: defining functional status points and functional status spaces according to the standard reference model, wherein the functional status point is an entry in the printed code; and counting the functional status points and the number of times the functional status points are covered, and generating a functional coverage report.

[0015] In one or more embodiments of the present invention, the function coverage report includes at least one of: the status of uncovered function status points, the status and distribution of covered function status points, and the coverage rate.

[0016] In another aspect of the present invention, a device for recording and analyzing reference model data flows is provided, which includes a conversion module, a data flow recording processing module and a functional coverage analysis module.

[0017] A conversion module is used to perform grammatical lexical analysis and syntax analysis on the standard reference model to obtain a target reference model, wherein the target reference model includes the source code and print code of the standard reference model, and the print code is used to record the source code running information and status of the standard reference model.

[0018] The data stream recording and processing module is used to record and analyze the reference model data stream according to the data output by the target reference model.

[0019] The function coverage analysis module is used to define function state points and function state spaces according to the standard reference model, and generate a function coverage report according to the function state points and the target reference model.

[0020] In one or more embodiments of the present invention, the conversion module is also used to: read the source code of the standard reference model according to the character stream; convert the source code into corresponding lexical units according to preset conversion rules; perform syntax analysis on the lexical units according to a preset grammar to generate a syntax analysis tree; and perform corresponding semantic actions on the syntax analysis tree according to a preset syntax guidance definition to generate a target reference model.

[0021] In one or more embodiments of the present invention, the data flow record processing module is also used to: identify variables in the source code of the standard reference model according to a preset format; and insert the variables into the corresponding positions of the printing code in a preset format to generate print statements, and execute the print statements to obtain a data flow report.

[0022] In one or more embodiments of the present invention, the functional coverage analysis module is also used to: define functional status points and functional status space according to the standard reference model, wherein the functional status point is an entry in the printing code; and count the functional status points and the number of times the functional status points are covered, and generate a functional coverage report.

[0023] In one or more embodiments of the present invention, the function coverage report includes at least one of: the status of uncovered function status points, the status and distribution of covered function status points, and the coverage rate.

[0024] In another aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory, wherein the memory stores instructions, and when the instructions are executed by the at least one processor, the at least one processor executes the method for recording and analyzing the reference model data flow as described above.

[0025] In another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method for recording and analyzing reference model data flows are implemented.

[0026] Compared with the prior art, the method and application of reference model data flow recording and analysis according to the embodiment of the present invention can convert the standard reference model into a target reference model that can record internal data and status, so that the data records of the target reference model simulation output can be used to generate highly readable data flow reports, facilitate data tracking and detection, and improve the efficiency of environment debugging and problem location; it can also define the functional state space through the reference model, count the data record entries, and calculate the functional coverage, thereby measuring and improving the completeness of verification. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 is a flow chart of a method for recording and analyzing reference model data streams according to an embodiment of the present invention;

[0028] Figure 2 is a specific flow chart of a method for recording and analyzing reference model data streams according to an embodiment of the present invention;

[0029] Figure 3 is a grammar example diagram of a method for recording and analyzing a reference model data flow according to an embodiment of the present invention;

[0030] Figure 4 is an example diagram of a syntax analysis tree of a method for recording and analyzing a reference model data stream according to an embodiment of the present invention;

[0031] Figure 5 is a diagram showing an example of a syntax-guided definition of a method for recording and analyzing a reference model data stream according to an embodiment of the present invention;

[0032] Figure 6 is an example diagram of annotated syntax analysis tree of a method for recording and analyzing reference model data flow according to an embodiment of the present invention;

[0033] Figure 7 is an exemplary flow chart of a method for recording and analyzing reference model data streams according to an embodiment of the present invention;

[0034] Figure 8 is a structural diagram of an apparatus for recording and analyzing reference model data streams according to an embodiment of the present invention;

[0035] Fig. 9 4 is a hardware structure diagram of a computing device for recording and analyzing reference model data streams according to an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific implementation modes.

[0037] Unless explicitly stated otherwise, throughout the specification and claims, the term “comprise” or variations such as “include” or “comprising”, etc., will be understood to include the stated elements or components but not to exclude other elements or components.

[0038] The technical solutions provided by various embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.

[0039] Example 1

[0040] like Figure 1 As shown, a method for recording and analyzing reference model data streams in an embodiment of the present invention is introduced, and the method includes the following steps.

[0041] In step S101, lexical analysis and syntax analysis are performed on the standard reference model to obtain a target reference model.

[0042] The standard reference model is processed through lexical analysis and syntax analysis to construct a print code that can record the source code running information and status, and then the target reference model is obtained. The data records obtained by the target reference model during the simulation process are associated with the standard reference model source code to obtain a specific form of data flow record.

[0043] Lexical analysis and syntax analysis not only include using compilation technology to construct lexical analyzers and syntax analyzers and define syntax-directed translation schemes to process reference models, but also include directly processing source code through general methods of lexical analysis and syntax analysis, such as defining regular expressions representing various statements to parse source code. Specific forms of data flow records can be generated by combining data records with source code, or they can be described in the print format of the target reference model and directly output through simulation.

[0044] Converting the standard reference model into the target reference model is essentially the process of translating one code into another. Through lexical analysis and syntactic analysis, a grammar analysis tree can be constructed, and the attributes corresponding to the grammar analysis tree nodes can be defined. That is, some attributes are attached to the grammar symbols representing the language structure, thereby linking information to a language structure.

[0045] Syntax-Directed Definition describes the value of an attribute through semantic rules related to grammar productions. Syntax-Directed Translation scheme embeds program fragments called semantic actions in the body of the production, and executes the program fragments during the syntax analysis process to achieve translation. Syntax-Directed Definition is easier to read and is suitable as a specification for translation. Syntax-Directed Translation scheme can be used as an implementation of translation. For simple translation, you can also directly define lexical units or regular expressions of various statements through a scripting language, and manually construct a translator that can perform lexical analysis, syntax analysis, and complete the translation process.

[0046] In step S102, the reference model data stream is recorded and analyzed according to the data output by the target reference model.

[0047] The data flow record (printed code) obtained from the simulation output of the target reference model reflects the complete operation trajectory and status of the reference model. However, it is not convenient to read if only the data values ​​are recorded. By backfilling the source code of the standard reference model and associating the recorded data values ​​with the corresponding variables and codes, a highly readable data flow report is obtained.

[0048] Example 2

[0049] like Figures 2 to 7 As shown, a method for recording and analyzing reference model data streams in an embodiment of the present invention is introduced, and the method includes the following steps.

[0050] In step S201, the source code of the standard reference model is read according to the character stream, and the source code is converted into corresponding lexical units according to a preset conversion rule.

[0051] The source code of the standard reference model is read according to the character stream, and blank characters, comments and line breaks (line breaks are used to calculate the current line number) are filtered out according to predefined conversion rules, and meaningful lexical units such as keywords, operators, separators, identifiers, etc. are returned, where the identifier can be at least one of a variable identifier, an array identifier and a function identifier.

[0052] The conversion rules include patterns and actions. Each pattern is a regular expression used to identify input characters. The action is a code snippet corresponding to the pattern, which is used to implement behaviors such as filtering characters or returning lexical units, editing attributes, etc. The relevant attributes of lexical units are stored in a data structure called a symbol table. Each lexical unit contains a morpheme attribute that represents its own character sequence. The variable identifier lexical unit also contains a line number attribute that represents the appearance position, a variable attribute that represents the variable name, and a format attribute that represents the printing format.

[0053] In step S202, the lexical unit is parsed according to a preset grammar to generate a grammar analysis tree.

[0054] Read in the lexical unit stream and derive the grammar parse tree according to the grammar of the language. The grammar parse tree is a graphical representation of the derivation. Each internal node of the grammar parse tree represents the application of a grammar production rule. The child nodes of this node form the production rule body applied in this derivation process from left to right. The top-level root node represents the start symbol, and the bottom-level leaf nodes represent the terminal symbols of the lexical units. The leaf nodes form the sentence of this grammatical analysis from left to right.

[0055] Figure 3 The grammar in defines an assignment statement for an arithmetic expression involving an array variable, where varid is a variable identifier and arrid is an array identifier. It is assumed that varid and arrid are both composed of alphanumeric characters and underscores and start with a letter. The difference lies in whether the character "[" is followed immediately.

[0056] Assume that there is statement 1 in the source code: "zzz=xxx+yyy[uuu-vvv];". zzz, xxx, uuu, vvv are all variable names, yyy is the array name, and the calculation result of uuu-vvv is used as the subscript of array yyy.

[0057] After lexical analysis, lexical units are obtained.<token-name,attribute-value> The form is as follows:

[0058] <varid,1> <=><varid,2> <+><arrid,3> <[><varid,4> <-><varid,5> <]><;>

[0059] The variable zzz is mapped to a token<varid,1> , varid is an abstract symbol for a variable identifier, 1 points to the entry corresponding to zzz in the symbol table, which stores the name of the identifier zzz, the line number, and other information. Figure 3 The grammar shown in the figure can be parsed to obtain Figure 4 The syntax parse tree of .

[0060] In step S203, corresponding semantic actions are performed on the syntax analysis tree according to the preset syntax guidance definition to generate a target reference model.

[0061] The code of the target reference model is generated through the grammar-directed translation scheme. Some attributes are attached to the grammar symbols representing the language constructs, so as to associate information with a language construct. The grammar-directed definition describes the value of the attribute through the semantic rules related to the grammar production.

[0062] like Figure 5 As shown in the figure, three attributes are defined: code is the connection of the morphemes of the lexical units, that is, the source code, vars is the sequence of variables, and format is the print format of the corresponding variables. These attributes are comprehensive attributes, that is, the attributes of all node symbols only depend on themselves and their child nodes. When constructing a syntax analysis tree from the bottom up, the attributes of all node symbols can be obtained.

[0063] Taking the vars attribute as an example, according to Figure 5 The syntax-guided definition shown can obtain the annotated syntax analysis tree of statement 1 marked with the vars attribute value, such as Figure 6 As shown:

[0064] Add the following semantic actions to the production start—>stmt corresponding to the start symbol start:

[0065] {print("start.code\n");

[0066] print("print(line number,) printf("start.format\n", start.vars);\n");}

[0067] The semantic actions corresponding to other productions calculate the corresponding attribute values ​​according to the description of the grammar-directed definition.

[0068] Assume that the format attribute value of the lexical unit is "%h", which means printing in hexadecimal format. Assume that the code line number corresponding to sentence 1 is 10.

[0069] According to the above translation scheme, sentence 1 is analyzed grammatically, and we can get:

[0070] start.code="zzz=xxx+yyy[uuu-vvv];"

[0071] start.vars="zzz,xxx,uuu,vvv,yyy[uuu-vvv]"

[0072] start.format="%h,%h,%h,%h,%h"

[0073] Perform semantic actions:

[0074] print("zzz=xxx+yyy[uuu-vvv];\n");

[0075] print("print(\"10,\");

[0076] printf(\"%h,%h,%h,%h,%h\\n\",zzz,xxx,uuu,vvv,yyy[uuu-vvv]);\n");

[0077] Finally, the output code is:

[0078] Statement 2: zzz=xxx+yyy[uuu-vvv];

[0079] Statement 3: print("10,"); printf("%h, %h, %h, %h, %h\n", zzz, xxx, uuu, vvv, yyy[uuu-vvv]);

[0080] Statement 1 in the source code of the standard reference model is processed to obtain statement 2 (source code) and statement 3 (print statement) in the target reference model. Statement 2 is equivalent to statement 1, and statement 3 follows statement 2 (print statements can be placed after or before the source code. The purpose is to obtain print code that can record source code execution information without destroying the grammatical structure and source code semantics, and to record and store all information when the source code is executed). When statement 2 is executed, statement 3 will be executed later, thereby obtaining a data record entry containing the line number of statement 2 and all variable values. The sequential output of all data record entries constitutes the running track and data flow of the model.

[0081] In step S204, variables in the source code of the standard reference model are identified according to a preset format; and the variables are inserted into corresponding positions of the print code in the preset format to generate print statements, and the print statements are executed to obtain a data flow report.

[0082] The data flow record (printed code) obtained from the simulation output of the target reference model reflects the complete operation trajectory and status of the reference model. However, it is not convenient to read if only the data values ​​are recorded. By backfilling the source code of the standard reference model and associating the recorded data values ​​with the corresponding variables and codes, a highly readable data flow report is obtained.

[0083] Assume that after executing statement 1, the corresponding values ​​of variables zzz, xxx, uuu, vvv, yyy[uuu-vvv] are 5, 2, 1, 1, 3, and the line number of statement 1 is 10. Statement 3 is executed to output a data record entry "10, 5, 2, 1, 1, 3". The data stream record processing module reads the data stream records one by one. When the entry "10, 5, 2, 1, 1, 3" is read, the 10th line of source code of the standard reference model is read according to the first component "10" in the entry. Through lexical analysis and syntax analysis, the corresponding variable names are identified from left to right. Each time a variable is identified, the next component in the data record entry is inserted in a predetermined form. Finally, the output in the following form can be obtained:

[0084] 10: zzz <5> =xxx <2> +yyy[uuu <1> -vvv <1> ] <3> ;

[0085] Furthermore, the unexecuted code between two lines of executed code can also be backfilled and marked as unexecuted. After all data flow record entries are processed, a visual report reflecting the running track and status of the standard reference model can be obtained.

[0086] In step S205, functional state points and functional state spaces are defined according to the standard reference model, and a functional coverage report is generated according to the functional state points and the target reference model.

[0087] The target reference model is obtained by parsing the standard reference model through lexical analysis and syntax analysis, and the function state point and function state space are defined. A state point represents a specific event. Whether a statement is executed can be defined as a state point. Various variable value combinations of a condition can also be defined as different state points. In this embodiment, a function state point represents a data record in the print code, and the state space represents the set of all possible covered events. The data records are collected and counted, and the distribution of function coverage points and function coverage are calculated to generate a function coverage report.

[0088] Perform lexical analysis and syntax analysis on the source code of the standard reference model, and calculate all state points and state spaces according to the definition. A state point represents a specific event. Whether a statement is executed can be defined as a state point. Various variable value combinations of a condition can also be defined as different state points. For example, for the conditional statement if(a||b), four different state points "0,0", "0,1", "1,0", and "1,1" can be defined. The set of all state points constitutes the state space. The state space represents the set of all possible covered events.

[0089] Each entry in the reference model data flow record corresponds to a state point. The state coverage information can be stored in a hash data structure, where the hash key is a different state point and the corresponding value is the number of times the corresponding state point is covered. In this embodiment, the values ​​corresponding to all keys of the initialized hash are 0, and each time a data record entry is accepted, the corresponding value of the corresponding key is increased by 1. The information stored in the hash can be analyzed to obtain a reference model functional coverage report, including at least one of the state of uncovered state points, the state of covered state points and their distribution, and the total coverage.

[0090] like Figure 8 As shown, a device for recording and analyzing reference model data stream according to a specific embodiment of the present invention is introduced.

[0091] In an embodiment of the present invention, the apparatus for recording and analyzing reference model data flow includes a conversion module 801 , a data flow recording processing module 802 and a function coverage analysis module 803 .

[0092] The conversion module 801 is used to perform lexical analysis and syntax analysis on the standard reference model to obtain a target reference model, wherein the target reference model includes the source code and print code of the standard reference model, and the print code is used to record the source code running information and status of the standard reference model.

[0093] The data stream recording and processing module 802 is used to record and analyze the reference model data stream according to the data output by the target reference model.

[0094] The function coverage analysis module 803 is used to define function state points and function state spaces according to the standard reference model, and generate a function coverage report according to the function state points and the target reference model.

[0095] The conversion module 801 is also used to: read the source code of the standard reference model according to the character stream; convert the source code into corresponding lexical units according to the preset conversion rules; perform syntax analysis on the lexical units according to the preset grammar to generate a syntax analysis tree; and perform corresponding semantic actions on the syntax analysis tree according to the preset syntax guidance definition to generate a target reference model.

[0096] The data flow record processing module 802 is also used to: identify variables in the source code of the standard reference model according to a preset format; and insert the variables into the corresponding positions of the print code in the preset format to generate print statements, and execute the print statements to obtain a data flow report.

[0097] The functional coverage analysis module 803 is also used to: define functional status points and functional status spaces according to the standard reference model, where a functional status point is an entry in the print code; and count the functional status points and the number of times the functional status points are covered, and generate a functional coverage report.

[0098] In this embodiment, the function coverage report includes at least one of: the status of uncovered function status points, the status and distribution of covered function status points, and the coverage rate.

[0099] Fig. 9 FIG. 1 shows a hardware structure diagram of a computing device 90 for recording and analyzing reference model data streams according to an embodiment of the present specification. Fig. 9 As shown, the computing device 90 may include at least one processor 901, a memory 902 (e.g., a non-volatile memory), a memory 903, and a communication interface 904, and the at least one processor 901, the memory 902, the memory 903, and the communication interface 904 are connected together via a bus 905. The at least one processor 901 executes at least one computer-readable instruction stored or encoded in the memory 902.

[0100] It should be understood that the computer executable instructions stored in the memory 902, when executed, cause at least one processor 901 to perform the above combined operations in various embodiments of this specification. Figure 1-9 Describes the various operations and functions.

[0101] In the embodiments of the present specification, the computing device 90 may include, but is not limited to, a personal computer, a server computer, a workstation, a desktop computer, a laptop computer, a notebook computer, a mobile computing device, a smart phone, a tablet computer, a cellular phone, a personal digital assistant (PDA), a handheld device, a messaging device, a wearable computing device, a consumer electronic device, and the like.

[0102] According to one embodiment, a program product such as a machine-readable medium is provided. The machine-readable medium may have instructions (i.e., the above-mentioned elements implemented in the form of software), which, when executed by a machine, causes the machine to perform the above-mentioned combination of various embodiments of this specification. Figure 1-9Specifically, a system or device equipped with a readable storage medium may be provided, on which a software program code implementing the functions of any of the above-mentioned embodiments is stored, and a computer or processor of the system or device reads and executes the instructions stored in the readable storage medium.

[0103] According to the method and application of reference model data flow recording and analysis of the embodiment of the present invention, it is possible to convert the standard reference model into a target reference model that can record internal data and status, so that the data records of the simulation output of the target reference model can be used to generate highly readable data flow reports, facilitate data tracking and detection, and improve the efficiency of environmental debugging and problem location; it is also possible to define the functional state space through the reference model, count the data record entries, and calculate the functional coverage, thereby measuring and improving the completeness of verification.

[0104] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0105] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0106] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0108] The foregoing description of specific exemplary embodiments of the present invention is for the purpose of illustration and demonstration. These descriptions are not intended to limit the present invention to the precise form disclosed, and it is clear that many changes and variations can be made based on the above teachings. The purpose of selecting and describing the exemplary embodiments is to explain the specific principles of the present invention and its practical application, so that those skilled in the art can realize and utilize various different exemplary embodiments of the present invention and various different selections and changes. The scope of the present invention is intended to be limited by the claims and their equivalents.

Claims

1. A method for recording and analyzing reference model data streams, characterized in that: The method comprises: Performing lexical analysis and syntax analysis on the standard reference model to obtain a target reference model, wherein the target reference model includes a source code and a print code of the standard reference model, and the print code is used to record source code running information and status of the standard reference model; and According to the data output by the target reference model, recording and analyzing the reference model data stream; defining a functional state point and a functional state space according to the standard reference model, and generating a functional coverage report according to the functional state point and the target reference model; The step of performing grammatical lexical analysis and syntax analysis on the standard reference model to obtain the target reference model includes: Read the source code of the standard reference model according to the character stream; Convert the source code into corresponding lexical units according to preset conversion rules; Performing grammatical analysis on the lexical unit according to a preset grammar to generate a grammatical analysis tree; and Execute corresponding semantic actions on the grammar analysis tree according to a preset grammar guidance definition to generate a target reference model; According to the data output by the target reference model, recording and analyzing the reference model data stream is realized, including: identifying variables in the source code of the standard reference model according to a preset format; and Inserting the variable into the corresponding position of the print code in a preset format to generate a print statement, and executing the print statement to obtain a data flow report; Defining a functional state point and a functional state space according to the standard reference model, and generating a functional coverage report according to the functional state point and the target reference model, including: Defining a function state point and a function state space according to the standard reference model, wherein the function state point is an entry in the printing code; and The function status points and the number of times the function status points are covered are counted, and a function coverage report is generated.

2. The method for recording and analyzing reference model data streams according to claim 1, characterized in that: The function coverage report includes at least one of: status of uncovered function status points, status and distribution of covered function status points, and coverage.

3. A device for recording and analyzing reference model data streams, characterized in that: The device comprises: a conversion module, configured to perform lexical analysis and syntax analysis on the standard reference model to obtain a target reference model, wherein the target reference model includes a source code and a print code of the standard reference model, and the print code is used to record the source code running information and status of the standard reference model; The conversion module reads the source code of the standard reference model according to the character stream; The conversion module converts the source code into corresponding lexical units according to preset conversion rules; The conversion module performs syntax analysis on the lexical unit according to a preset grammar to generate a syntax analysis tree; and Execute corresponding semantic actions on the grammar analysis tree according to a preset grammar guidance definition to generate a target reference model; A data stream recording and processing module, used for recording and analyzing the reference model data stream according to the data output by the target reference model; The data stream record processing module identifies variables in the source code of the standard reference model according to a preset format; and Inserting the variable into the corresponding position of the print code in a preset format to generate a print statement, and executing the print statement to obtain a data flow report; The device also includes: A function coverage analysis module, used to define function state points and function state spaces according to the standard reference model, and generate a function coverage report according to the function state points and the target reference model; The function coverage analysis module defines a function state point and a function state space according to the standard reference model, wherein the function state point is an entry in the printing code; and The function status points and the number of times the function status points are covered are counted, and a function coverage report is generated.

4. An electronic device, characterized in that: include: at least one processor; as well as A memory storing instructions, which, when executed by the at least one processor, causes the at least one processor to perform the method for recording and analyzing reference model data flows according to any one of claims 1 to 2.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for recording and analyzing reference model data flows as described in any one of claims 1 to 2 are implemented.