Talking about the sequence/item insight of UVM (on)

Item refers to uvm_sequence_item, Sequence Item has the necessary data manipulation methods for the UVM core base class. For stimulus generation and scene control, it is woven by sequence. What data members should the item be used for in the item? The article was divided.

Whether it is a self-driving item, passing through the sequencer traffic station, leading to the terminal driver, or taking the route bus, sightseeing along the way, and finally following the tour guide to the scenic point driver, introducing how to drive the item and sequence, what rules to follow, and finally Before the sequencer arrives at the driver in an orderly manner, the reader must first understand the relationship between the sequence and the item. Here the sequence value is the class uvm_sequence, and the item refers to the uvm_sequence_item. For the sake of simplicity, we call it sequence and item. For the generation of the stimulus and the control of the scene, it is woven by the sequence, and the specific data and control requirements required for the stimulus are derived from the member data in the item.

Sequence Item

We have proposed that the item is based on uvm_object, which indicates that it has the necessary data manipulation methods for the UVM core base class, such as copy, clone, compare, record, etc., we will not repeat them here. What the reader needs to know is that usually for an item, what data members should be used in the item? We can divide them into the following categories:

Control class. For example, the read/write type, data length, and transfer mode on the bus protocol.

Load class. Generally, it is a packet on the data bus.

Configuration class. This is often used to control the driver's drive behavior, such as the command driver's send interval or the presence or absence of erroneous insertion.

Debug class. Used to mark some additional information for debugging purposes, such as the instance number of the object, the creation time, and the time and time of resolution by the driver.

The following example code is a definition of an item. From this code, the reader can see the data usage of the various uses mentioned above:

Talking about the sequence/item insight of UVM (on)

Talking about the sequence/item insight of UVM (on)

Output result:

Talking about the sequence/item insight of UVM (on)

In the above code, not only a more typical item definition, but also some features of the item use:

If the data field is in need of a driver in the future, then the user should consider defining the rand type and giving the appropriate constraint in accordance with the driver protocol.

Due to the data properties of the item itself, in order to make full use of the characteristics declared by the UVM domain, we recommend that the necessary data members be declared by the `uvm_field_xxx macro for later basic function operations, such as the print() function above.

The reader also noticed that in the above example, t1 is not randomized and t2 is randomized. This difference is obvious before the item leads to the sequencer. Because UVM requires that item creation and randomization should occur in the body() task of the sequence, not in the sequencer or driver.

If you distinguish it according to the life cycle of the item object, its life should start in the creation of the sequence, and then go through randomization and traversing the sequencer and finally reach the driver. After being digested by the driver, its life cycle is generally considered to be dead. The reason why this is highlighted is that some users in the actual operation will improperly operate the item object directly, modify the data directly, or send its handle to other components, which invisibly modify the gene of the item. Or extend the life of an item object. This kind of inappropriate object operation mode is what the user needs to pay attention to. The alternative way is to make reasonable use of copy and clone methods.

Next we need to clarify the relationship between the item and the sequence, and the sequence community. In a nutshell, a sequence contains some ordered instances of the item. Considering that the item needs to be randomized after it is created, the sequence needs to reserve some variables for external randomization when declaring. Some of these random variables are It is used to control the variables in the item object through hierarchical transfer, and part of it is used to organize and sequence the item objects. In order to distinguish between several common sequence definitions, before we introduce the subsequent sequence, we can first classify the sequence as:

Flat sequence. This class is often used only to organize more granular granularity, that is, the organization of the item example.

Hierarchical sequence. This class is used by higher-level sequences to organize the underlying sequence, and then these sequences are mounted to the same sequencer either in a sequential manner or in parallel.

Virtual class. This class is the way to ultimately control the entire test scenario. Given the different kinds of sequencers and their corresponding sequences in the entire environment, we need a virtual sequence to coordinate the top-level test scenarios. The reason why this method is called virtual sequence is because the sequence is not fixedly mounted on a certain sequencer type, but it will eventually mount various internal types of sequences to different target sequencers. . This is also the biggest difference from the historical sequence.

510 Battery

Suizhou simi intelligent technology development co., LTD , https://www.msmsmart.com

Posted on