Register coverage statistics collection method, storage medium
By creating coverage groups and coverage group subscribers, the register bus interface is directly monitored for coverage statistics collection, which solves the complex and inflexible problems of the existing technology, and realizes a simpler and more flexible register coverage statistics collection.
Patent Information
- Application Number
- CN202210659779.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-13
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-06-13
AI Technical Summary
The prior art is complex and not flexible enough in register coverage statistics collection, error prone and limited encoding flexibility.
By creating the overlay group and overlay group subscriber of the register model, the register bus interface is directly monitored, and the coverage sampling method of the overlay group object is called for statistical collection, avoiding the use of the register coverage-related interface methods provided by UVM.
The register coverage statistics collection process is simplified, and the encoding flexibility is increased, making complex register coverage statistics collection more convenient and easy to implement.
Smart Images

Figure CN115081368B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip verification technology, and in particular to a register coverage statistics collection method and a storage medium. Background Art
[0002] Usually, registers are used in RTL (Register transfer level) designs to complete some logical functions. Therefore, when verifying the RTL design, we need to model its internal registers to simulate the functional logic inside the RTL as much as possible, so as to help verification developers determine the correctness of the RTL design functions.
[0003] A typical verification platform structure based on UVM verification methodology including register coverage statistics collection is as follows: Figure 1 As shown, using the UVM register model ( Figure 1 The register_model in the DUT (Design undertest, i.e. the RTL design mentioned above) can be used to conveniently model the registers and storage inside the DUT. After creating the register model, you can obtain the handle of the register model in the sequence and component, and then call the interface method in the register model to complete the read and write access to the register. For example, in the sequence on the left of the figure, the read and write access to the register is achieved by calling the interface method in the register model. You can also directly start the sequence of the register bus as shown in the lower right corner, that is, to achieve read and write access to the register by operating the bus.
[0004] Since there are various register buses, and UVM is a general verification methodology, it needs to be able to handle various types of transaction request sequence_items. It happens that these sequence_items to be processed are very similar. After integrating their characteristics, UVM predefines a sequence_item called uvm_reg_item. Then, the bus2reg() and reg2bus() methods of the adapter are used to realize the conversion between uvm_reg_item and the bus_item of the target bus protocol (that is, the register read and write operations need to be converted into sequence_items that comply with the target bus protocol according to the bus communication protocol). Finally, the sequencer and driver drive the DUT to finally complete the reading and writing of the target register. During the register reading and writing process, the register model and the register values in the actual DUT are synchronized and the coverage statistics are collected.
[0005] We say that an important metric for measuring the progress of chip verification is to track its verification coverage, which naturally includes the register part. The verification platform built based on UVM mentioned above also provides support for the function of collecting register coverage. It can be seen that in the register model, there will be a coverage group encapsulation object (reg_coverage). Then, every time the access interface method of the register model is called, in addition to synchronously updating the numerical states of the register model and the DUT registers, the information of this access will also be monitored to collect the coverage statistics of the access to the target register.
[0006] Next, let's look at a specific example:
[0007] First step, declare the coverage statistics parameters to be supported in the test case.
[0008] As Figure 2 shown, here, we set it to support all coverage types for the register model on the entire verification platform. In fact, there are more than just these parameters. The functional coverage configuration parameters provided by UVM are an enumeration type value of the data type uvm_coverage_model_e, specifically including:
[0009] UVM_NO_COVERAGE: Do not perform coverage statistics.
[0010] UVM_CVR_REG_BITS: Perform coverage statistics on the read and write of each bit of the register.
[0011] UVM_CVR_ADDR_MAP: Perform coverage statistics on the read and write of all addresses in the register address mapping table.
[0012] UVM_CVR_FIELD_VALS: Perform coverage statistics on the values in the register field.
[0013] UVM_CVR_ALL: Include all of UVM_CVR_REG_BITS, UVM_CVR_ADDR_MAP, and UVM_CVR_FIELD_VALS for statistics.
[0014] These parameters supported by coverage statistics are just for our convenience in making corresponding configurations in the verification platform. They are equivalent to some switch parameters and do not have special meanings themselves. However, verification developers need to configure and use them according to the needs of the actual engineering project.
[0015] As Figure 3 shown, second step, create a coverage group for the register model, which is encapsulated as an object and used to collect the coverage statistics of the offset address of the accessed register, read and write operations, and the cross-coverage of both.
[0016] As Figure 4 shown, in the third step, the following five things are mainly done in the register model:
[0017] (1) Declare and instantiate the coverage group encapsulation object of the previous step.
[0018] (2) Call the set_coverage() method to allow sampling of this coverage type.
[0019] (3) Call the add_coverage() method to increase the sampling support for the coverage type.
[0020] (4) According to different maps, start sampling the corresponding coverage information through the get_name() method of the address mapping table map.
[0021] (5) Call the sample() method and the sample_value() method in reg_coverage to complete the final coverage sampling of the register model.
[0022] As Figure 5 shown, the coverage group can also be directly written in the register, and then the sample_values method is written to implement the collection of the coverage statistics of a certain target register.
[0023] The above scheme is usually adopted in engineering applications, but there are two main defects as follows:
[0024] (1) It is relatively complex to write and requires many parameters to configure. In actual engineering applications, it is often easy to make mistakes, especially not friendly to newbies in engineering projects.
[0025] (2) It is not flexible enough to use because the collection of the coverage statistics of the target register must be completed according to the syntax rules provided by UVM, which will lose part of the coding flexibility and cannot directly monitor all the behavioral functions on the register bus. Therefore, a more simple and flexible method is needed to collect the register coverage. Summary of the Invention
[0026] According to an embodiment of the present invention, a method for collecting register coverage statistics is provided, including the following steps:
[0027] Create a coverage group for the register model, and encapsulate a coverage group object in the coverage group for collecting the coverage statistics of the offset address, read / write operations, and the intersection of both of the accessed registers;
[0028] Create a coverage group subscriber;
[0029] Declare and instantiate a coverage group object within the register coverage group subscriber to obtain relevant numerical or address information of the register;
[0030] The register coverage group subscriber subscribes to receive the transaction data of the register bus broadcast by the monitor from the register bus;
[0031] Use the transaction data as the input information for coverage sampling, and call the coverage sampling method of the declared and instantiated coverage group object to complete the statistical collection of the register coverage rate.
[0032] Furthermore, for the statistical collection of the corresponding register coverage rate, relevant interface methods can also be directly called through the handle of the register model to access the register for statistical collection.
[0033] Furthermore, pass the register model to the declared and instantiated coverage group object, so that the coverage group object can use the interface methods of the register model to obtain relevant numerical or address information of the register.
[0034] Furthermore, write a write method within the register coverage group subscriber to subscribe to receive the register bus transaction data broadcast by the monitor from the register bus.
[0035] According to another embodiment of the present invention, there is provided a storage medium having non-volatile program code executable by a processor, and the program code causes the processor to run the register coverage statistical collection method.
[0036] According to the register coverage statistical collection method of the embodiment of the present invention, without using the register coverage related interface methods provided by UVM, it also avoids the relatively complex use parameter settings and the limitations of coding flexibility. By directly monitoring the register bus interface to perform the statistical collection of the monitored register related data, the coding flexibility is increased, which is more convenient and easier to implement for the complex register coverage statistical collection.
[0037] It should 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a structural diagram of a verification platform including register coverage statistical collection based on the UVM verification methodology.
[0039] Figure 2 It is the first code diagram of the existing solution.
[0040] Figure 3 It is the second code diagram of the existing solution.
[0041] Figure 4 The third code diagram of the existing solution.
[0042] Figure 5 The fourth code diagram of the existing solution.
[0043] Figure 6 The flowchart of the method for collecting register coverage statistics according to an embodiment of the present invention.
[0044] Figure 7 The structural diagram of the method for collecting register coverage statistics according to an embodiment of the present invention. Detailed implementation manners
[0045] Hereinafter, the preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings to further illustrate the present invention.
[0046] First, in combination with Figures 6 - 7 Describe the method for collecting register coverage statistics according to an embodiment of the present invention, which is used for chip verification and has a wide range of application scenarios.
[0047] As Figures 6 - 7 shown, the method for collecting register coverage statistics according to an embodiment of the present invention includes the following steps:
[0048] In S1, as Figure 6 shown, create a coverage group of the register model, and encapsulate a coverage group object reg_coverage in the coverage group to collect statistics on the coverage of the offset address, read / write operations, and the intersection of both of the accessed registers. In this embodiment, for the corresponding coverage collection and statistics of the registers, relevant interface methods can also be directly called through the handle of the register model to access the registers for statistics collection.
[0049] In S2, as Figure 6 shown, create a coverage group subscriber coverage_subscriber.
[0050] In S3, as Figure 6 shown, declare and instantiate the coverage group object reg_coverage in the coverage group subscriber coverage_subscriber to obtain relevant numerical or address information of the registers. In this embodiment, further, pass the register model to the declared and instantiated coverage group object, so that the coverage group object can use the interface methods of the register model to obtain relevant numerical or address information of the registers, facilitating the collection of corresponding coverage rate data for statistics.
[0051] In S4, as Figure 6As shown, the coverage subscriber subscribes to receive the bus item of the register bus broadcast by the monitor from the register bus. In this embodiment, further, a write method is written in the coverage subscriber to subscribe to receive the bus item of the register bus broadcast by the monitor from the register bus.
[0052] In S5, as Figure 6 shown, the bus item is used as the input information for coverage sampling, and the coverage sampling method of the instantiated coverage group object reg_coverage is called to complete the statistical collection of the register coverage.
[0053] From the above steps, it can be seen that at this time, we no longer need to set the parameters supported by UVM for coverage statistics, and we don't need to use too many control methods for register coverage. The whole process of register coverage statistical collection becomes more simple and flexible.
[0054] Above, with reference to Figures 6 - 7 the register coverage statistical collection method according to the embodiment of the present invention is described. Without using the register coverage related interface methods provided by UVM, it also avoids the relatively complex parameter setting and coding flexibility limitations. By directly monitoring the register bus interface to perform the statistical collection of the monitored register related data for coverage, the coding flexibility is increased, which is more convenient and easier to implement for complex register coverage statistical collection.
[0055] According to another embodiment of the present invention, a storage medium with non-volatile program code executable by a processor is provided, and the program code causes the processor to run the register coverage statistical collection method.
[0056] It should be noted that in this specification, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without further limitations, the element defined by the statement "comprising..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0057] Although the content of the present invention has been described in detail through the above preferred embodiments, it should be recognized that the above description should not be considered as a limitation of the present invention. After those skilled in the art have read the above content, various modifications and alternatives to the present invention will be obvious. Therefore, the protection scope of the present invention should be defined by the appended claims.
Claims
1. A method for statistically collecting register coverage, characterized in that It includes the following steps: Create a coverage group for the register model, and encapsulate a coverage group object within the coverage group for statistically collecting the coverage rates of the offset addresses of the accessed registers, read / write operations, and their cross - coverage; Create a coverage group subscriber; Declare and instantiate the coverage group object within the coverage group subscriber for obtaining relevant numerical or address information of the register; Pass the register model to the declared and instantiated coverage group object so that the coverage group object can use the interface methods of the register model to obtain relevant numerical or address information of the register; The coverage group subscriber subscribes to and receives the transaction data of the register bus broadcast by the monitor from the register bus; Use the transaction data as the input information for coverage rate sampling, and call the coverage rate sampling method of the declared and instantiated coverage group object to complete the statistical collection of the coverage rate of the register; 2. The register coverage rate statistical collection method according to claim 1, wherein, For the statistical collection of the corresponding coverage rate of the register, it is also possible to directly access the register by calling relevant interface methods through the handle of the register model for statistical collection.
3. The register coverage rate statistical collection method according to claim 1, wherein, Write a write method within the coverage group subscriber for subscribing to and receiving the register bus transaction data broadcast by the monitor from the register bus.
4. A storage medium having non-volatile program code executable by a processor, characterized in that, The program code causes the processor to run the register coverage rate statistical collection method according to any one of claims 1 - 3.
Citation Information
Patent Citations
Verification platform of system-on-chip and verification method thereof
CN113868987A
Register function coverage group generation method and device, equipment and storage medium
CN114443403A