A method for verifying register coverage, a computer storage medium and a terminal

By determining the command line set of chip function points and calculating register coverage, the problem of inaccurate coverage testing in real-world environments for dedicated chips is solved, thus improving test controllability and efficiency.

CN115659907BActive Publication Date: 2025-11-04北京晟芯网络科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211379939.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-04
Publication Date
2025-11-04
Estimated Expiration
2042-11-04

AI Technical Summary

Technical Problem

In real-world environments, verifying register coverage of dedicated chips is difficult to test accurately, making it hard for test cases to cover all registers and making it difficult to control the test progress, which can easily cause the test time to exceed expectations.

Method used

By determining the first and second command line sets for each function point of the chip, the register coverage of the function point tests already performed is calculated. The command line is used to implement the statistics of register coverage, thereby improving the controllability of the test.

Benefits of technology

It enables accurate testing of register coverage of dedicated chips in a real-world environment, improving test controllability and efficiency, and ensuring that all registers are fully covered.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115659907B_ABST
    Figure CN115659907B_ABST
Patent Text Reader

Abstract

The application discloses a method for verifying register coverage, a computer storage medium and a terminal, and relates to the field of chip testing. The method comprises the following steps: determining a first command line set and a second command line set of each function point of a chip, wherein the first command line set is a set of command lines covering all register operations of the function point, and the second command line set is a set of command lines contained in a test instance of the function point; and determining register coverage of the test instance of the function point according to the first command line set and the second command line set of the function point in the chip. The embodiment of the application realizes the statistics of register coverage through command lines, and improves controllability of chip testing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present document relates to, but is not limited to, chip testing technology, in particular to a method for verifying register coverage, a computer storage medium and a terminal. BACKGROUND

[0002] Unlike registers of general-purpose computing chips, special-purpose chips (for example, communication chips) involve a large number of registers of different functions, and the operation of each function of the chip is controlled by configuring the combination of registers, and the running state of the chip is determined by the state register. When verifying the special-purpose chip, the functions of all registers of the chip need to be verified, that is, the verification process needs to cover all registers.

[0003] In the related art, register coverage verification is logic verification, which is implemented in a simulation environment. There are differences between the simulation environment and the real environment, and the simulation environment cannot simulate the abnormality in the real environment, such as interference between different functions. Therefore, the register coverage test based on the simulation environment is only effective in the local simulation environment. The test of the special-purpose chip in the real environment focuses on specific function points, and the test cases mainly involve single-point functions, which are difficult to cover all registers under the single-point function. With the deepening of the test, the test cases will be continuously supplemented, and the test of the special-purpose chip in the real environment can cover all registers. Other tests in the related art mainly test software logic or functions, and do not involve register coverage. The register coverage verification in the real environment is difficult to determine the register coverage of a test case by manual operation, because the register contains hundreds of tables, and the table may also contain dozens of fields. Therefore, it is difficult to determine the register coverage of a test case by manual operation. In addition, it is difficult to intuitively judge the gap between the actual test case and the test case that covers all registers. Therefore, the test is prone to register omission, which affects the test of the special-purpose chip. In addition, because the register coverage of the test case cannot be accurately calculated, the test progress is also difficult to control, and the test time of the special-purpose chip is likely to exceed the expectation.

[0004] In summary, how to accurately test the register coverage in the real environment has become a problem to be solved. SUMMARY

[0005] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.

[0006] The embodiments of the present application provide a method for verifying register coverage, a computer storage medium and a terminal, which can realize controllable register coverage verification.

[0007] The embodiment of the present application provides a method for verifying register coverage, comprising: determining a first command line set and a second command line set of each function point of a chip, wherein the first command line set is a set of command lines covering all register operations of the function point, and the second command line set is a set of command lines contained in a test instance of the function point which has been executed.

[0008] According to the first command line set and the second command line set of the function point in the chip, register coverage of the function point test which has been performed is determined.

[0009] In another aspect, the embodiment of the present application further provides a computer storage medium, wherein a computer program is stored in the computer storage medium, and the computer program is executed by a processor to implement the method for verifying register coverage.

[0010] In still another aspect, the embodiment of the present application further provides a terminal, comprising: a memory and a processor, wherein the memory stores a computer program; and

[0011] The processor is configured to execute the computer program in the memory.

[0012] The computer program is executed by the processor to implement the method for verifying register coverage.

[0013] The technical scheme of the present application comprises: determining a first command line set and a second command line set of each function point of a chip, wherein the first command line set is a set of command lines covering all register operations of the function point, and the second command line set is a set of command lines contained in a test instance of the function point which has been executed; and according to the first command line set and the second command line set of the function point in the chip, register coverage of the function point test which has been performed is determined. The embodiment of the present application realizes the statistics of register coverage through command lines, and improves controllability of chip testing.

[0014] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent to those skilled in the art from the following description, or can be learned by practice of the present application. The objects and other advantages of the present application can be achieved and obtained by the structure particularly pointed out in the description, the claims and the drawings. BRIEF DESCRIPTION OF DRAWINGS

[0015] The accompanying drawings are included to provide a further understanding of the technical scheme of the present application, and constitute a part of the specification, and are used together with the embodiments of the present application to explain the technical scheme of the present application, and do not constitute a limitation on the technical scheme of the present application.

[0016] Figure 1 A flowchart of the method for verifying register coverage of the embodiment of the present application;

[0017] Figure 2 A processing schematic diagram of a command line of an embodiment of the present application. DETAILED DESCRIPTION

[0018] In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be explained that the embodiments in the present application and the features in the embodiments can be combined with each other in any manner without conflict.

[0019] The steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Moreover, although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown.

[0020] Figure 1 A flowchart of a method for verifying register coverage of an embodiment of the present application, as shown in FIG. 4, includes the following steps: Figure 1

[0021] Step 101, for each function point of a chip, determining a first command line set and a second command line set of the function point, wherein the first command line set is a set of command lines covering all register operations corresponding to the function point, and the second command line set is a set of command lines contained in a test instance of the function point that has been executed;

[0022] Step 102, according to the first command line set and the second command line set of the function point in the chip, determining the register coverage of the test of the function point that has been performed.

[0023] The embodiment of the present application realizes the statistics of register coverage through command lines, and improves the controllability of chip testing.

[0024] In an exemplary instance, the chip of the embodiment of the present application includes a special-purpose chip.

[0025] In an exemplary instance, the chip of the embodiment of the present application contains more than one function point. Based on the method for testing the register coverage of the function point described above, the embodiment of the present application can determine the register coverage of the test of all function points. Further, based on the register coverage of the test of each function point, the register coverage of the test of all function points of the chip can be determined.

[0026] In an exemplary instance, the embodiment of the present application can determine the first command line set described above according to the function point that needs to be tested before executing the test of the special-purpose chip.

[0027] ​In an example embodiment, the present application determines register coverage of the functional point test performed according to the first command line set and the second command line set of the functional point in the chip, including:

[0028] For each functional point of the chip, the present application determines register coverage of the functional point test performed according to the first command line set and the second command line set of the functional point.

[0029] In an example embodiment, the present application determines register coverage of the functional point test performed according to the first command line set and the second command line set of the functional point, including:

[0030] The present application divides all the command lines in the first command line set into single command lines to obtain a third command line set containing all the single command lines obtained by the division;

[0031] The present application compares all the single command lines (single command lines in the third command line set) obtained by the division and the command lines in the second command line set to determine register coverage of the functional point test performed.

[0032] The single command line refers to a command line performing the same type of operation on one or more addresses of one or more registers; and the command lines in the second command line set are all single command lines.

[0033] In an example embodiment, the present application divides all the command lines in the command line set into single command lines, including:

[0034] The present application combines all the multiple options of the command lines in the first command line set in any manner to generate a single command line based on each combination;

[0035] The multiple options include: optional character items, mandatory character items, and multiple value items.

[0036] The present application generates a single command line based on any combination of all the multiple options in each command line in the first command line set.

[0037] In an example embodiment, the present application can generate a single command line based on any combination of multiple multiple options; for example, the optional character items contain two options, the multiple value items contain four options, and eight single command lines can be obtained by combination.

[0038] In an example embodiment, the present application combines all the multiple options of the command lines in the first command line set in any manner to generate a single command line based on each combination, including: determining the single command lines contained in each command line in the first command line set by one or more of the following manners:

[0039] For the integer field contained in the predetermined multiple selection value item, a single command line for reading and writing the integer field in the table contained in the register is generated respectively;

[0040] According to the predetermined mandatory character item, one or more single command lines which must be run to execute the function point test are generated;

[0041] According to the predetermined optional character item, one or more single command lines for implementing register override are generated.

[0042] Each command line in the first command line set of the embodiment of the present application overrides one or more registers; in an exemplary instance, one command line in the first command line set of the embodiment of the present application can contain n single command lines, and the n values corresponding to different command lines can be different; in an exemplary instance, each single command line in the embodiment of the present application overrides one register, and by setting the command line containing n single command lines, one command line in the first command line set can implement verification of overriding n registers; in an exemplary instance, the n single command lines contained in the command line in the first command line set of the embodiment of the present application override a number of registers less than or equal to n, that is, part of the single command lines override the same registers; in an exemplary instance, the single command line is a command line for performing the same kind of operation on one or more addresses of one or more registers, in other words, one single command line can perform the same kind of operation on one or more addresses of one or more registers, for example, one single command line can simultaneously perform a write operation on address 1 of register 1 and address 2 of register 2; in an exemplary instance, the contents of the above write operation can be the same or different, for example, 0 is written in the above address 1 and 1 is written in the above address 2; in an exemplary instance, the override register includes: the register is determined as the override register when the command line in the test command accesses the register once; in an exemplary instance, the override register includes: the corresponding values are set for different positions of the register, and when the command line in the test command accesses all positions of the register, the register is determined as the override register.

[0043] In the embodiment of the present application, <0-n> represents the range of the digital field of the multiple selection value item which can be configured, < > is used as the digital identifier, and the value in the middle identifies the configurable range; [option-name] represents the optional character item, [] is used as the optional character item identifier, and the content in the middle is the name of the optional character item; (option1|option2|option3) represents the mandatory character item, () is used as the mandatory character item identifier, and option1 or option2 or option3 can be selected to be filled in the middle; according to the above rules, one command line A in the first command line set is obtained, and a set B composed of single command lines contained in the command line A, the command line A and the set B are as follows:

[0044] Command line A: xc-sdh port client <0-3> stm-mode (stm1 | stm4) ;

[0045] Set B:

[0046] xc-sdh port client 0 stm-mode stm1;

[0047] xc-sdh port client 1 stm-mode stm1;

[0048] xc-sdh port client 2 stm-mode stm1;

[0049] xc-sdh port client 3 stm-mode stm1;

[0050] xc-sdh port client 0 stm-mode stm4;

[0051] xc-sdh port client 1 stm-mode stm4;

[0052] xc-sdh port client 2 stm-mode stm4;

[0053] xc-sdh port client 3 stm-mode stm4.

[0054] In an exemplary instance, the command lines in the first command line set and the third command line set in the embodiment of the present application can be recorded and stored by including TXT, table and the like files, as long as the command lines can be sorted and arranged; in an exemplary instance, the embodiment of the present application can store one first command line set through one file, that is, one function point corresponds to one file storing the first command line set of the function point; for example, through an Excel named “register override of function point A”, all the first command line sets of the register override of function point A are recorded.

[0055] In an exemplary instance, the embodiment of the present application compares all the single command lines obtained by the decomposition and the command lines in the second command line set, to determine the register coverage rate of the function point test that has been performed on the function point, including:

[0056] Filtering processing is performed on the second command line set;

[0057] The number of single command lines in the second command line set after the deduplication processing is calculated, and the quotient of the number of all single command lines contained in the third command line set is determined as the register coverage.

[0058] The filtering processing includes deduplication processing and / or deleting command lines that do not operate registers.

[0059] In an exemplary instance, the embodiment of the present application determines the register coverage of the function point test that has been performed on the function point by comparing all single command lines obtained by the decomposition and the command lines in the second command line set, including:

[0060] The deduplication processing is performed on the command lines in the second command line set.

[0061] The number of same command lines in the second command line set and the third command line set after the deduplication processing is determined by comparison.

[0062] The number of same command lines is divided by the number of single command lines in the third command line set to obtain the register coverage of the function point test that has been performed on the function point.

[0063] The second command lines in the test case of the embodiment of the present application are single command lines, and the register coverage of the function point test can be determined by comparing the second command line set and all single command lines contained in the third command line set.

[0064] In an exemplary instance, before determining the register coverage of the function point test that has been performed on the function point, the embodiment of the present application further includes:

[0065] The deduplication processing is performed on the single command lines contained in the third command line set.

[0066] In an exemplary instance, before comparing the second command line with all single command lines contained in the command line set, the embodiment of the present application further includes:

[0067] All single command lines contained in the second command line set and the third command line set are sorted according to the same sorting rule.

[0068] The embodiment of the present application can improve the comparison efficiency of the second command line set and the third command line set by sorting the single command lines.

[0069] In an exemplary instance, when the register coverage is less than 1, the embodiment of the present application further includes: removing the same command lines in the third command line set and the second command line set to obtain command lines that need to be executed to cover all register operations.

[0070] Taking command line 1 in the first command line set corresponding to the function point 1 as an example, a single command line contained in the command line 1 is described: assuming that the command line 1 is xc-sdh port client<0-3>stm-mode(stm1|stm4), the n single command lines contained in the command line 1 are as follows:

[0071] xc-sdh port client 0 stm-mode stm1;

[0072] xc-sdh port client 1 stm-mode stm1;

[0073] xc-sdh port client 2 stm-mode stm1;

[0074] xc-sdh port client 3 stm-mode stm1;

[0075] xc-sdh port client 0 stm-mode stm4;

[0076] xc-sdh port client 1 stm-mode stm4;

[0077] xc-sdh port client 2 stm-mode stm4;

[0078] xc-sdh port client 3 stm-mode stm4。

[0079] assuming that the single command lines contained in the second command line set of the test case are as follows:

[0080] xc-sdh port client 0 stm-mode stm1;

[0081] xc-sdh port client 1 stm-mode stm1;

[0082] xc-sdh port client 0 stm-mode stm4;

[0083] xc-sdh port client 1 stm-mode stm4;

[0084] xc-sdh port client 2 stm-mode stm4;

[0085] xc-sdh port client 3 stm-mode stm4.

[0086] The 6 single command line records in the second command line set match the contents of the single command lines (8 in total) decomposed from the command line 1, and the register coverage is 6 / 8=0.75. It can be determined through comparison that the second command line set does not contain xc-sys dpll port 0 reset and xc-sys dpll port 1 reset in the third command line set corresponding to the command line 1; and thus it is obtained that the command lines to be executed to cover all register operations include xc-sys dpll port 0 reset and xc-sys dpll port 1 reset. In an exemplary example, the command lines to be executed to cover all register operations can be implemented by a file such as a table, a TXT, and the like.

[0087] In an exemplary example, after obtaining the command lines to be executed to cover all register operations, the method of the embodiment of the present application further includes:

[0088] According to the obtained command lines to be executed to cover all register operations, the test case of the test function point is edited to obtain a test case with a register coverage equal to 1.

[0089] In an exemplary example, the embodiment of the present application continuously determines the register coverage for the test case of the same function point based on the above method; and based on the obtained command lines to be executed to cover all register operations, the test case can be continuously edited to make the test case achieve a register coverage equal to 1.

[0090] In an exemplary example, assuming that the first command line set of the function point 1 is A, the third command line set composed of all single command lines decomposed from the command lines included in the first command line set A is B, the second command line set included in the test case is C, and the command lines to be executed to cover all register operations are D, the register coverage and the command lines D to be executed to cover all register operations can be obtained by the following processing of the embodiment of the present application:

[0091] Step 201, determining B composed of all single command lines decomposed from the command lines included in the first command line set A;

[0092] Step 202, obtaining the second command line set C included in the test case;

[0093] Step 203, sorting B and C according to the same rule;

[0094] Step 204, register coverage is obtained by sorting B and C.

[0095] Step 205, when the register coverage is less than 1, the same command line contained in B and C is removed, and the remaining single command line is combined to form D.

[0096] Figure 2 The processing schematic diagram of the command line of the embodiment of the application is shown in the figure. Figure 2 According to the table of the register involved by the function point, the embodiment of the application determines the first command line set corresponding to the function point, records the second command line set contained in the test case, and obtains the analysis result based on the first command line set and the recorded second command line set. The analysis result of the embodiment of the application includes the register coverage and the command line still needed to be executed to cover all register operations.

[0097] The embodiment of the application establishes the relationship between the register coverage and the command line, calculates the register coverage through the relationship between the command line and the register coverage, and the calculation process does not need human intervention. After the first command line set of the function point is determined, the second command line set of the test case is obtained when the test of the function point is performed, and the corresponding register coverage is obtained through calculation. Further, when the register coverage is obtained, the embodiment of the application can determine the command line still needed to be executed to cover all register operations in the test case based on the comparison between the first command line set and the second command line set. The test case can be edited and improved through the determined command line still needed to be executed to cover all register operations, and the editing efficiency of the test case and the test timeliness of the chip are improved.

[0098] The embodiment of the application further provides a computer storage medium, and the computer storage medium stores a computer program. The computer program is executed by a processor to implement the above-mentioned method for verifying the register coverage.

[0099] The embodiment of the application further provides a terminal, which includes a memory and a processor. The memory stores a computer program.

[0100] The processor is configured to execute the computer program in the memory.

[0101] The computer program is executed by the processor to implement the above-mentioned method for verifying the register coverage.

[0102] Those of ordinary skill in the art will realize and understand that all or some of the steps in the methods disclosed above and the functional modules / units in the systems and devices can be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component can have multiple functions, or one function or step can be performed by several physical components in cooperation. Some or all of the components can be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on computer-readable media, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, it is common and well understood by those of ordinary skill in the art that communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and can include any information delivery media.

Claims

1. A method for verifying register coverage, comprising: determining, for each function point of a chip, a first command line set and a second command line set of the function point, wherein the first command line set is a set of command lines covering all register operations of the function point, and the second command line set is a set of command lines contained in a test instance of the function point that has been executed; determining register coverage of the function point test that has been performed according to the first command line set and the second command line set of the function point in the chip, wherein the determining of the register coverage of the function point test that has been performed according to the first command line set and the second command line set of the function point in the chip comprises, for each function point of the chip, decomposing all command lines in the first command line set into single command lines to obtain a third command line set containing all single command lines decomposed, and comparing all single command lines decomposed with command lines in the second command line set to determine register coverage of the function point test that has been performed for the function point, wherein the single command line refers to a command line performing the same type of operation on one or more registers at one or more addresses, and the command lines in the second command line set are all single command lines.

2. The method of claim 1, wherein, The decomposing all command lines in the first command line set into single command lines comprises: arbitrarily combining all multiple selection items of the command lines in the first command line set to generate a single command line based on each combination, wherein the multiple selection items include optional character items, mandatory character items and multiple value items. The generating a single command line based on each combination by arbitrarily combining all multiple selection items of the command lines in the first command line set comprises determining single command lines contained in each command line in the first command line set by one or more of the following ways:

3. The method of claim 2, wherein, generating single command lines performing read-write operation on integer fields in a table contained in a register respectively for the integer fields in the predetermined multiple value items; generating one or more single command lines that must be run to perform the function point test according to the mandatory character items set in advance; generating one or more single command lines for realizing register coverage according to the optional character items set in advance. The comparing all single command lines decomposed with command lines in the second command line set to determine register coverage of the function point test that has been performed for the function point comprises:

4. The method of claim 1, wherein, performing filtering processing on the second command line set; calculating a quotient of a number of single command lines in the second command line set after the deduplication processing and a number of all single command lines contained in the third command line set, and determining the quotient as the register coverage, wherein the filtering processing includes deduplication processing and / or deleting command lines that do not operate on registers. The comparing all single command lines decomposed with command lines in the second command line set to determine register coverage of the function point test that has been performed for the function point comprises: performing deduplication processing on the command lines in the second command line set.

5. The method of claim 1, wherein, ​ ​ By comparison, determine the number of same command lines in the second command line set and the third command line set after deduplication processing; Divide the number of same command lines by the number of single command lines in the third command line set to obtain the register coverage of the function point test that has been performed on the function point.

6. The method according to any one of claims 1 to 5, characterized in that, Before the register coverage of the function point test that has been performed on the function point is determined, the method further comprises: Deduplicate single command lines contained in the third command line set.

7. The method according to any one of claims 1 to 5, characterized in that, When the register coverage is less than 1, the method further comprises: Eliminate the same command lines in the third command line set and the second command line set to obtain command lines that need to be executed to cover all register operations.

8. The method of claim 7, wherein, After the command lines that need to be executed to cover all register operations are obtained, the method further comprises: According to the obtained command lines that need to be executed to cover all register operations, edit the test case of the test function point to obtain a test case with a register coverage equal to 1. 9.A computer storage medium, the computer storage medium storing a computer program, the computer program being executed by a processor to implement the method for verifying register coverage according to any one of claims 1-8.

10. A terminal comprising: A memory and a processor, the memory storing a computer program; wherein, The processor is configured to execute the computer program in the memory; The computer program is executed by the processor to implement the method for verifying register coverage according to any one of claims 1-8.

Citation Information

Patent Citations

  • Test case generating method and device

    CN106330601A

  • Verification method and device and computer readable storage medium

    CN114564383A