CN114443028A - Method, computer readable medium for implementing coverage collection code reuse - Google Patents

Method, computer readable medium for implementing coverage collection code reuse Download PDF

Info

Publication number
CN114443028A
CN114443028A CN202210085225.6A CN202210085225A CN114443028A CN 114443028 A CN114443028 A CN 114443028A CN 202210085225 A CN202210085225 A CN 202210085225A CN 114443028 A CN114443028 A CN 114443028A
Authority
CN
China
Prior art keywords
coverage
collection
base class
class
coverage rate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210085225.6A
Other languages
Chinese (zh)
Inventor
马骁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Clounix Technology Ltd
Original Assignee
Hangzhou Clounix Technology Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Clounix Technology Ltd filed Critical Hangzhou Clounix Technology Ltd
Priority to CN202210085225.6A priority Critical patent/CN114443028A/en
Publication of CN114443028A publication Critical patent/CN114443028A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method for realizing reuse of coverage rate collection codes, which comprises the following steps: creating a covering warehouse class; according to the requirement, the covering bin base class is used for deriving the covering bin subclass, and the function of the covering bin base class is reloaded; creating a coverage rate collection object, wherein the coverage rate collection object comprises a static array variable of a statement static, and the static array variable is used for acquiring coverage rate collection needing to be ignored; declaring and instantiating a coverage collection object for creating test cases; in the test case, the actually needed class objects in the coverage bin base class used by default in the test case are reloaded for reusing the coverage collection code. The invention reduces the system complexity of the chip verification platform, the whole chip verification method is more concise, meanwhile, the coverage rate collection component object required by the heavy-load project is directly overloaded to neglect the coverage rate collection of some performance characteristics which are no longer supported, the heavy-load process is more visual and convenient to understand, and the maintenance of the verification environment code at the later stage is convenient.

Description

Method, computer readable medium for implementing coverage collection code reuse
Technical Field
The present invention relates to the field of chip verification technologies, and in particular, to a method and a computer-readable medium for realizing reuse of coverage collection codes.
Background
Fig. 1 is an example diagram obtained by abstracting functional logic of a chip.
The port signals are as follows:
op: operation instructions, including addition ADD, subtraction SUB, multiplication MUL, division DIV operations;
a: an operation operand operated and registered using the register group; b: an operation operand operated and registered using the register group; rslt: and an operation result, which is operated and registered by using the register group.
Generally, in order to face different market needs, different product strategies are formulated, corresponding product plans are performed, a plurality of chips of the same type with different performances are formulated, and then performance parameters supported by the chips can be abstracted as follows:
support _ mode: the supported working MODEs comprise HIGH _ MODE, MEDIUM _ MODE and LOW _ MODE, and the higher the performance is, the more MODEs are supported;
support _ op: the higher the performance of the supported operation instructions, including ADD, SUB, MUL and DIV, the more types of the supported operation instructions are, and the operation instructions are dependent on the supported work mode support _ mode;
support _ reg: the higher the performance of the supported register group comprising the registers R0-R7 is, the more registers are used by the operand and the result after the operation when the operation instruction is operated, the faster the operation speed is, and the same depends on the supported working mode support _ mode.
Its operation instructions are simply abstracted and represented in the verification platform with enumerated variables. The method specifically comprises the following steps:
mode: a working mode;
op: an operation instruction;
a _ reg: a register set used for operating the operand A;
b _ reg: a register set used for operating the operand B;
rst _ reg: register sets used for the operation result rlt.
Generally, a coverage component coverage needs to be written to perform coverage collection statistics on some important coverage points of the chip, and the component acquires transaction data monitored by a monitor, and the acquisition can be realized through a subscriber mode or through TLM communication port connection.
The coverage component generally includes coverage points including at least:
mode: collecting coverage to supported modes of operation;
op: collecting the operation instructions covered to the support;
a _ reg: collecting a register group used by the covered operation operand A;
b _ reg: collecting a register group used by the covered operation operand B;
rst _ reg: and collecting a register group used by the covered operation result rlt.
Some crossing coverage points, such as other kernel coverage points like register sets used by the operation instructions and the operation operands A.
In the foregoing, in order to face different market needs, different product strategies are made, corresponding product planning is performed, and a plurality of chips of the same type with different properties are planned, so that a plurality of coverage rate collection codes may need to be maintained in order to verify the plurality of chips of the same type with different properties. For example, the same type of chip designed for the middle and low end markets no longer supports the HIGH _ MODE operation MODE, at this time, the chip no longer supports the operation instructions of multiplication MUL and division DIV, and the operation speed of the chip is also reduced, that is, at this time, the operation operands and operation results of the chip can no longer use all the register sets R0 to R7, but only the register sets R0 to R3, so that the coverage collection code coverage needs to be rewritten and some ignores the coverage collection of some performance characteristics that are no longer supported at present.
In this regard, although only some align _ bins need to be added, the previous coverage collection code needs to be completely copied, and if there are other performance chips of the same type, there will be a large number of duplicate codes, and it will be necessary to maintain multiple sets of almost identical coverage collection codes at the same time. In addition, if modification is needed later, multiple places may need to be modified synchronously, which is troublesome and easy to miss errors.
Disclosure of Invention
According to the embodiment of the invention, the method for realizing the reuse of the coverage rate collecting codes is provided, which comprises the following steps:
creating a covering warehouse class;
according to the requirement, the covering bin base class is used for deriving the covering bin subclass, and the function of the covering bin base class is reloaded;
creating a coverage rate collection object, wherein the coverage rate collection object comprises a static array variable of a statement static, and the static array variable is used for acquiring coverage rate collection needing to be ignored;
declaring and instantiating a coverage collection object for creating test cases;
in the test case, the actually needed class objects in the coverage bin base class used by default in the test case are reloaded for reusing the coverage collection code.
Preferably, in the initial state, there is no coverage collection in the coverage bin base class that needs to be ignored.
Preferably, the functions in the overlay bin base class and the overlay bin subclass are abstracted by a keyword virtual for code reloading.
Preferably, the static array variable acquires the coverage collection characteristic needing to be ignored by calling a function method covering the bin base class.
Preferably, when the overlay bin base class is declared and instantiated, the this parameter derived from the UVM object is passed for generating a scope domain that covers the bin base class.
According to yet another embodiment of the present invention, there is provided a computer readable medium having non-volatile program code executable by a processor, the program code causing the processor to execute any of the above methods for implementing coverage collection code reuse.
According to the method and the computer readable medium for realizing reuse of the coverage rate collection codes, the system complexity of a chip verification platform is reduced, the whole chip verification method is simpler, meanwhile, coverage rate collection component objects required by heavy-load projects are directly overloaded to omit coverage rate collection of some performance characteristics which are not supported any more, the heavy-load process is more visual and convenient to understand, and maintenance of verification environment codes in the later period is facilitated.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and are intended to provide further explanation of the claimed technology.
Drawings
FIG. 1 is a diagram illustrating an example of a prior art chip with abstracted functional logic;
FIG. 2 is a flow diagram of a method for implementing reuse of coverage collection codes according to an embodiment of the present invention;
fig. 3 is a schematic view of the method according to fig. 2.
Detailed Description
The present invention will be further explained by describing preferred embodiments of the present invention in detail with reference to the accompanying drawings.
First, a method for realizing reuse of coverage rate collection codes according to an embodiment of the present invention will be described with reference to fig. 2 to 3, which is used for chip verification with different performances and different modes, and has a wide application range.
As shown in fig. 2 to 3, the method for implementing reuse of coverage rate collection codes according to the embodiment of the present invention includes the following steps:
specifically, as shown in fig. 2 to 3, in step S1, a cg _ align _ bins _ default covering the bin base class is created for derivation in the subsequent steps.
Further, in the initial state, there is no align _ bins in the coverage bin base class cg _ align _ bins _ default, i.e. there is no coverage collection in the coverage bin base class cg _ align _ bins _ default that needs to be ignored.
Specifically, as shown in fig. 2 to 3, in step S2, the overlay bin base class derives the overlay bin subclass according to the requirement, and the function of the overlay bin base class cg _ align _ bins _ default is reloaded; in this embodiment, the functions in the overlay bin base class and the overlay bin subclass are abstracted by the keyword virtual for code reloading.
Specifically, as shown in fig. 2 to 3, in step S3, a coverage collection object coverage is created, where the coverage collection object coverage includes a static array variable of a statement static for obtaining a coverage collection characteristic of some performance characteristics that need to be ignored. In this embodiment, the static array variable obtains the coverage collection characteristic that needs to be ignored by calling a function method that covers the cg _ align _ bins _ default of the bin base class.
Specifically, as shown in fig. 2 to 3, in step S4, a coverage collection object is declared and instantiated to create a test case, in this embodiment, a this parameter is passed when declaring and instantiating, and although the this parameter is derived from the UVM object UVM _ object, the this parameter is instantiated by using the UVM component, mainly to generate a range domain belonging to the coverage bin base class cg _ overlap _ default, so as to facilitate the subsequent replacement of reloading of the factory coverage collection code by using the set _ inst _ override.
Based on the purpose of reusing the code collected by the coverage rate, the code reuse of the coverage rate can be realized by transferring parameterized classes into the collection of the coverage rate which needs to be ignored and is not supported any more; meanwhile, through static calling, the class is guaranteed not to be instantiated, only the coverage bin align _ bins which need to be ignored by a target are obtained, however, in order to use the overloading function of the factor mechanism, a hierarchical coverage _ base class needs to be additionally added, then the base class is overloaded each time, instead of selectively ignoring the coverage rate collection characteristics of some performance characteristics which are not supported any more by overloading the corresponding foreground _ cg _ align _ bins _ default according to the project requirement, two defects are generated:
(1) a level coverage _ base is additionally added, so that the complexity of the verification platform is increased, and the whole code is not concise.
(2) The base class coverage _ base is reloaded during each reloading, and the corresponding coverage _ cg _ align _ bins _ default is not directly reloaded to selectively ignore the coverage rate collection characteristics of some performance characteristics which are not supported any more, so that the reloading process is not intuitive and is not convenient to understand.
In the method for realizing reuse of the coverage rate collection code according to the embodiment of the present invention, the default cg _ ignore _ bins _ default class is instantiated in the new constructor of the coverage rate collection component coverage and the method therein is called to obtain the coverage bins ignore _ bins to be ignored, then assigning the static array variable to the statement, finally using the overloading function of the factor mechanism to replace the class object cg _ align _ bins _ default class corresponding to the default coverage collection point needing to be ignored into the class needing to be used in the actual project, greatly reducing the system complexity of the chip verification platform, leading the whole chip verification method to be more concise, meanwhile, the coverage rate collection component object required by the project is directly reloaded to ignore the coverage rate collection characteristics of some performance characteristics which are not supported any more, the reloading process is more visual and convenient to understand, and the maintenance of the verification environment code at the later stage is facilitated.
The method for realizing reuse of the coverage rate collection codes according to the embodiment of the invention is described above with reference to the attached figures 2-3. Further, the present invention can also be applied to a computer-readable medium having non-volatile program codes executable by a processor.
The computer readable medium having the non-volatile program code executable by the processor of the embodiment of the present invention, the program code causes the processor to execute the method for realizing reuse of the coverage collection code of the above-mentioned embodiment.
The method for realizing reuse of the coverage rate collection codes and the computer readable medium according to the embodiments of the invention are described above with reference to fig. 2 to 3, the system complexity of the chip verification platform is reduced, the whole chip verification method is simpler, meanwhile, the coverage rate collection of some performance characteristics which are not supported any more is omitted by directly overloading the coverage rate collection component objects required by the project, the overloading process is more intuitive and convenient to understand, and the maintenance of the verification environment codes at the later stage is facilitated.
It should be noted that, in the present specification, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
While the present invention has been described in detail with reference to the preferred embodiments, it should be understood that the above description should not be taken as limiting the invention. Various modifications and alterations to this invention will become apparent to those skilled in the art upon reading the foregoing description. Accordingly, the scope of the invention should be determined from the following claims.

Claims (6)

1. A method for implementing reuse of coverage collection codes, comprising the steps of:
creating a covering warehouse class;
according to the requirement, the coverage bin base class derives the coverage bin subclass and reloads the function of the coverage bin base class;
creating a coverage rate collection object, wherein the coverage rate collection object comprises a static array variable of a statement static, and the static array variable is used for acquiring coverage rate collection needing to be ignored;
declaring and instantiating the coverage collection object for creating a test case;
in the test case, the actually needed class objects in the coverage bin base class used by default in the test case are reloaded for reusing the coverage rate collection codes.
2. The method of implementing coverage collection code reuse according to claim 1, wherein in an initial state, there are no coverage collections in said coverage bin base class that need to be ignored.
3. The method of implementing coverage collection code reuse according to claim 1, wherein functions in the coverage bin base class and the coverage bin subclass are abstracted via a key virtual for code reloading.
4. The method of implementing coverage collection code reuse according to claim 1, wherein said static array variable obtains a coverage collection property that needs to be ignored by calling a function method that covers a bin-based class.
5. The method of enabling coverage collection code reuse according to claim 4, wherein declaring and instantiating the coverage bin base class passes a this parameter derived from a UVM object for generating a scope domain of the coverage bin base class.
6. A computer readable medium having non-volatile program code executable by a processor, the program code causing the processor to execute the method for enabling coverage collection code reuse according to any one of claims 1 to 5.
CN202210085225.6A 2022-01-25 2022-01-25 Method, computer readable medium for implementing coverage collection code reuse Pending CN114443028A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210085225.6A CN114443028A (en) 2022-01-25 2022-01-25 Method, computer readable medium for implementing coverage collection code reuse

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210085225.6A CN114443028A (en) 2022-01-25 2022-01-25 Method, computer readable medium for implementing coverage collection code reuse

Publications (1)

Publication Number Publication Date
CN114443028A true CN114443028A (en) 2022-05-06

Family

ID=81369120

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210085225.6A Pending CN114443028A (en) 2022-01-25 2022-01-25 Method, computer readable medium for implementing coverage collection code reuse

Country Status (1)

Country Link
CN (1) CN114443028A (en)

Similar Documents

Publication Publication Date Title
US6067641A (en) Demand-based generation of symbolic information
EP0664027B1 (en) Program modeling system
EP3204849B1 (en) Systems and methods to update source code files
US8726255B2 (en) Recompiling with generic to specific replacement
US5519866A (en) Method and apparatus of incrementally linking components of a modeled computer program
US7165074B2 (en) Software development test case analyzer and optimizer
US5805796A (en) System architecture for implementing modular diagnostics
US10296353B2 (en) Protecting basic input/output (BIOS) code
US7356813B2 (en) System and method for optimizing a program
JPH0844590A (en) Apparatus and method for selection test of software system
US7689979B1 (en) Methods and apparatus to improve application launch time
US20110126179A1 (en) Method and System for Dynamic Patching Software Using Source Code
CN112015491B (en) Method, device and computer storage medium for realizing function jump
CN113296786B (en) Data processing method, device, electronic equipment and storage medium
JP2020119348A (en) Analysis program, analysis method, and analysis device
US6519768B1 (en) Instruction translation method
CN111158667B (en) Code injection method and device, electronic equipment and storage medium
CN107766253A (en) A kind of method of the automatic maintenance test script based on model change
KR101995176B1 (en) Method and system for reverse engineering using big data based on dynamic context
CN114443028A (en) Method, computer readable medium for implementing coverage collection code reuse
CN113031964B (en) Big data application management method, device, equipment and storage medium
CN114174983B (en) Method and system for optimized automatic verification of advanced constructs
CN115705250A (en) Monitoring stack usage to optimize programs
CN1165844C (en) Method for determining software module testing information of digital equipment
CN114443027A (en) Reuse method of coverage collection code, computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Country or region after: China

Address after: 3 / F, 665 Zhangjiang Road, China (Shanghai) pilot Free Trade Zone, Pudong New Area, Shanghai

Applicant after: Yunhe Zhiwang (Shanghai) Technology Co.,Ltd.

Address before: 311200 room 107, building D, integrated circuit design Industrial Park, No. 858, Jianshe Second Road, Xiaoshan Economic and Technological Development Zone, Xiaoshan District, Hangzhou, Zhejiang Province

Applicant before: Hangzhou yunhezhi Network Technology Co.,Ltd.

Country or region before: China