How to implement multiple inheritance in random constraint objects

Through the factory mechanism of parameterized classes and UVM, multiple inheritance in random constraint objects is realized, the problem of repeated code in chip verification is solved, and the reusability and work efficiency of code is improved.

CN114116344BActive Publication Date: 2024-11-12YUNHE ZHIWANG (SHANGHAI) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111404694.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-24
Publication Date
2024-11-12
Estimated Expiration
2041-11-24

AI Technical Summary

Technical Problem

In chip verification, the prior art has a large number of repeated code writing problems, which leads to inefficiency and difficulty in managing, especially when multiple extreme situations need to be tested simultaneously, errors are easily missed.

Method used

By writing an incentive sequence using parameterized classes, the default input incentive is passed into the incentive sequence as parameters, the incentive sequence is inherited to generate new input incentives, and the UVM factory mechanism is used for reload replacement, so as to achieve multiple extremes constraints on situations.

Benefits of technology

It achieves an effect similar to multiple inheritance, avoids duplicate code, improves the reusability and manageability of the code, simplifies random constraints on input motivation objects in extreme cases, and improves work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114116344B_ABST
    Figure CN114116344B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for realizing multiple inheritance in a random constraint object, comprising the following steps: using a parameterized class to write an excitation sequence; passing a default input excitation as a parameter into the excitation sequence to obtain an extreme input excitation; passing an extreme input excitation as a parameter into the excitation sequence and inheriting the excitation sequence to obtain a new input excitation; using the overload function of the factory mechanism of UVM to overload and replace the default input excitation with a new input excitation. The present invention can achieve an effect similar to multiple inheritance through a parameterized class, can be applied to random constraints on input excitation objects in extreme cases, avoids duplicate code, and increases the reusability and manageability of the code. The technology can be applied not only to random constraints on input excitation objects, but also to any class of objects such as configuration objects, thereby improving work efficiency.
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 technology, and in particular to a method for realizing multiple inheritance in a random constraint object. Background Art

[0002] In chip verification work, we often need to randomize the configuration objects of the RTL design or the applied input stimuli, and then run the corresponding test cases in the hope of discovering some potential problems in the RTL design through randomness. The randomness here is not completely random. It is necessary to constrain the random value to a legal range so that the RTL design module works in a normal state or obtains valid and legal input stimuli. Otherwise, we may get invalid configurations or stimuli, and running the test cases will lose the meaning of testing and verifying the RTL design. (The valid and legal values ​​here refer to the interval values ​​that comply with the RTL design rules, and the normal working state here refers to the working mode state that complies with the RTL design rules.)

[0003] like Figure 1 As shown, we can see that in the figure we randomize the configuration object config and the input stimulus sequence to configure the DUT in a random working state and apply a random stimulus to the DUT for simulation testing.

[0004] Among the existing technologies, Figure 2 As shown, we can see that the above example default_item is used as the input stimulus of DUT, which is derived from uvm_sequence_item, contains random data members member1~N, and the default random constraint is default_c. Usually when we verify DUT, we will consider some extreme cases, so we will construct some corresponding test cases for the extreme cases. Then we first need to randomly constrain the input stimulus default_item and constrain the data members in it to the interval value range that we consider to be extreme cases. Then we just need to inherit the above default_item and add the corresponding random constraint block corner1_c.

[0005] We add some random constraints for extreme cases in corner1_c, so that some data members member are in an interval value range under extreme cases, and then use the overload function of UVM's factory mechanism in the test case to replace the original default default_item with corner1_item, so as to drive the extreme input stimulus corner1_item to the input port of DUT, and then test the function and performance of DUT under extreme cases to verify whether DUT can meet the design requirements under extreme cases.

[0006] Of course, there may be other extreme cases. In this case, the same method as above is used to construct the corner2_item input stimulus, and some random constraints for extreme cases are added to corner2_c, so that other data members member are within an interval value range of extreme cases.

[0007] However, we often need to test the function and performance of the DUT when the above two extreme cases occur at the same time to verify whether the DUT can meet the design requirements in this case. Then, we need to reconstruct corner_mix_item as the input stimulus in this extreme case. At this time, corner_mix_item either inherits the input stimulus corner1_item corresponding to the first extreme case, or inherits the input stimulus corner2_item corresponding to the second extreme case.

[0008] In either case, we need to rewrite the original random constraint code corner1_c or corner2_c. Even worse, if there is an input stimulus corner3_item corresponding to the third extreme case, then there will be more repetitive random constraint code that needs to be rewritten.

[0009] The prior art has the following problems:

[0010] (1) For complex projects, there is a lot of repetitive code, which is inefficient and difficult to manage. This is something we should avoid as much as possible.

[0011] (2) Due to the large amount of repeated code, if an error occurs in one place and needs to be modified, many of the same places will have to be modified, which is very troublesome and easy to miss and cause errors. Summary of the invention

[0012] According to an embodiment of the present invention, a method for implementing multiple inheritance in a random constraint object is provided, comprising the following steps:

[0013] Use parameterized classes to write stimulus sequences;

[0014] The default input stimulus is passed into the stimulus sequence as a parameter to obtain an extreme input stimulus.

[0015] The extreme input stimulus is passed into the stimulus sequence as a parameter and inherits the stimulus sequence to obtain a new input stimulus;

[0016] Use the reload function of UVM's factory mechanism to reload and replace the default input stimulus with a new input stimulus.

[0017] Furthermore, the stimulus sequence includes: a first input stimulus and a second input stimulus.

[0018] Furthermore, the default input stimulus is passed into the stimulus sequence as a parameter to obtain the extreme input stimulus, which includes the following sub-steps:

[0019] The default input stimulus is passed into the first input stimulus as a parameter to obtain an extreme first input stimulus;

[0020] The default input excitation is passed into the second input excitation as a parameter to obtain an extreme second input excitation.

[0021] Furthermore, the extreme input excitation is passed as a parameter into the excitation sequence and inherits the excitation sequence to obtain a new input excitation. Specifically, the extreme first input excitation is passed as a parameter into the second input excitation and inherits the second input excitation to obtain the first new input excitation, or the extreme second input excitation is passed as a parameter into the first input excitation to obtain the second new input excitation.

[0022] Further, the first new input stimulus is the same as the second new input stimulus.

[0023] Furthermore, the stimulus sequence is written using a parameterized class in which the passed parameters and the inherited parent class are of the same data type.

[0024] The method for implementing multiple inheritance in a random constraint object according to an embodiment of the present invention has the following beneficial effects:

[0025] (1) Through parameterized classes, a similar effect to multiple inheritance is achieved, which can be applied to random constraints on input stimulus objects in extreme cases, avoiding duplication of code and increasing the reusability and manageability of the code.

[0026] (2) This technology can be applied not only to random constraints on input stimulus objects, but also to any class of objects such as configuration objects, thereby improving work efficiency.

[0027] 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 technology as claimed. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 The following is an example diagram of random constraints in a typical UVM-based verification platform architecture.

[0029] Figure 2 Derived structure diagram of random constraint objects for existing solutions

[0030] Figure 3The present invention is a flowchart of a method for implementing multiple inheritance in a random constraint object according to an embodiment of the present invention.

[0031] Figure 4 The figure is a derived structure diagram of a method for implementing multiple inheritance in a random constraint object according to an embodiment of the present invention.

[0032] Figure 5 The present invention is a flowchart of the sub-steps of a method for implementing multiple inheritance in a random constraint object according to an embodiment of the present invention. DETAILED DESCRIPTION

[0033] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings to further illustrate the present invention.

[0034] First, combine Figures 1 to 4 A method for implementing multiple inheritance in a random constraint object according to an embodiment of the present invention is described, which is used for chip verification and has a wide range of application scenarios.

[0035] like Figures 1 to 4 As shown, the method for implementing multiple inheritance in a random constraint object according to an embodiment of the present invention comprises the following steps:

[0036] In S1, Figure 3 As shown, the stimulus sequence corner_item is written in a parameterized class. In this embodiment, the stimulus sequence is written in a parameterized class in which the transmitted parameters and the inherited parent class are of the same data type. The stimulus sequence includes: a first input stimulus corner1_item and a second input stimulus corner2_item.

[0037] In S2, if Figure 3 As shown, the default input stimulus default_item is passed into the stimulus sequence as a parameter to obtain an extreme input stimulus.

[0038] In this embodiment, the default input stimulus is passed into the stimulus sequence as a parameter, and obtaining the extreme input stimulus includes the following sub-steps:

[0039] In S201, if Figure 5 As shown, the default input stimulus is passed into the first input stimulus as a parameter to obtain the extreme first input stimulus corner1_item#(default_item).

[0040] In S202, if Figure 5 As shown, the default input stimulus is passed into the second input stimulus as a parameter to obtain the extreme second input stimulus corner2_item#(default_item).

[0041] In S3, such as Figure 3 As shown, the extreme input stimulus is passed into the stimulus sequence as a parameter and inherits the stimulus sequence to obtain a new input stimulus. In this embodiment, the extreme input stimulus is passed into the stimulus sequence as a parameter and inherits the stimulus sequence to obtain a new input stimulus specifically as follows: the extreme first input stimulus is passed into the second input stimulus as a parameter and inherits the second input stimulus to obtain the first new input stimulus corner_mix_item, or the extreme second input stimulus is passed into the first input stimulus as a parameter to obtain the second new input stimulus corner_mix_item. The first new input stimulus corner_mix_item is the same as the second new input stimulus corner_mix_item. It can be seen that in this step we have actually realized the multiple inheritance of the input stimuli corner1_item and corner2_item in two extreme cases. At this time, we no longer need to write repeated random constraint block codes as in the previous solution. The random constraint blocks corner1_c and corner2_c in these two input stimuli will take effect to constrain the data members in default_item to an interval value range in a double extreme case to test the function and performance when the input stimulus in this extreme case is applied to the DUT.

[0042] In S4, Figure 3 As shown, the overload function of the UVM factory mechanism is used to overload and replace the default input stimulus with a new input stimulus.

[0043] Above, refer to Figures 1 to 5 A method for implementing multiple inheritance in a random constraint object according to an embodiment of the present invention is described, which has the following beneficial effects:

[0044] (1) Through parameterized classes, a similar effect to multiple inheritance is achieved, which can be applied to random constraints on input stimulus objects in extreme cases, avoiding duplication of code and increasing the reusability and manageability of the code.

[0045] (2) This technology can be applied not only to random constraints on input stimulus objects, but also to any class of objects such as configuration objects, thereby improving work efficiency.

[0046] It should be noted that, in this specification, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprises..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0047] Although the content of the present invention has been described in detail through the above preferred embodiments, it should be appreciated that the above description should not be considered as a limitation of the present invention. After reading the above content, it will be apparent to those skilled in the art that various modifications and substitutions of the present invention will occur. Therefore, the protection scope of the present invention should be limited by the appended claims.

Claims

1. A method for implementing multiple inheritance in a random constraint object, characterized in that: The following steps are included: Use parameterized classes to write stimulus sequences; Passing a default input stimulus as a parameter into the stimulus sequence to obtain an extreme input stimulus; The extreme input stimulus is passed into the stimulus sequence as a parameter and inherits the stimulus sequence to obtain a new input stimulus; The default input stimulus is overloaded and replaced with the new input stimulus using the overload function of the factory mechanism of UVM.

2. The method for implementing multiple inheritance in a random constraint object as claimed in claim 1, characterized in that: The stimulus sequence includes: a first input stimulus and a second input stimulus.

3. The method for implementing multiple inheritance in a random constraint object as claimed in claim 2, characterized in that: The step of passing the default input stimulus as a parameter into the stimulus sequence to obtain the extreme input stimulus comprises the following sub-steps: passing the default input stimulus as a parameter into the first input stimulus to obtain an extreme first input stimulus; The default input stimulus is passed as a parameter into the second input stimulus to obtain an extreme second input stimulus.

4. The method for implementing multiple inheritance in a random constraint object as claimed in claim 3, characterized in that: The extreme input excitation is passed as a parameter into the excitation sequence and inherits the excitation sequence to obtain a new input excitation. Specifically, the first extreme input excitation is passed as a parameter into the second input excitation and inherits the second input excitation to obtain a first new input excitation, or the second extreme input excitation is passed as a parameter into the first input excitation to obtain a second new input excitation.

5. The method for implementing multiple inheritance in a random constraint object as claimed in claim 4, characterized in that: The first new input stimulus is the same as the second new input stimulus.

6. The method for implementing multiple inheritance in a random constraint object as claimed in claim 1, characterized in that: The writing of the stimulus sequence uses a parameterized class method in which the passed parameters and the inherited parent class are of the same data type.