Use of sequence in UVM (i)

Source: Internet
Author: User

The relationship between Driver,transaction,sequence,sequencer in UVM.

UVM will be the original in the driver data definition part, take out alone to become transaction, the main completion of the data randomize and constrained.

Above the transaction there is a layer of sequence that can be called to control the same type of transaction.

In the UVM component called Sequencer, to leave the interface with the sequence, and control the start of sequence, defined and UVM the environment of component

Contact.

Uvm_sequence_base inherited from Uvm_sequence_item, Uvm_sequence_item inherited from Uvm_transaction, uvm_transaction from

Uvm_object to inherit.

There are two ways to start a sequence:

1) Set sequence to the default_sequence of one of the phase of a sequencer. This will be done automatically with the execution of the phase. Sequence.

uvm_config_db # (Uvm_object_wrapper):: Set (This, "Env.i_agent.sqr.main_phase", "Default_sequence",

Case0_sequence::type_id::get ());

2) Call the start function directly.

My_seq_start (sequencer);

The second way, is mainly used in the need to control the execution of different sequence, or parallel execution of the time.

Uvm_sequence_base defines a variable with a uvm_phase type of starting_phase, which is generally used to set objection in the body of sequence.

This variable is automatically set when you choose to start with default_sequence. When you choose the second way to start, this variable needs to be set by itself and is guaranteed not to be empty.

Sequence starts, executes an internally defined Task--virtual task body (); Generally defined as virtual type, convenient for overloading.

There are also two callback functions Pre_body (); Post_body (); for user Configuration.

In the task body (), the function defined is: ' Uvm_create (M_trans) is equivalent to M_trans=new ("M_trans");

Sequencer.wait_for_grant (prior); requests are made to sequencer by the specified priority.

This.pre_do (); After execution, the transation will be randomized.

This.mid_do ();

Sequencer.send_request ();

Sequencer.wait_for_item_done ();

This.post_do ();

These are some of the parts within a task body defined internally by UVM, but can generally be done directly new+ their own randomized+ ' uvm_send.

Wait_for_grant and Pre_do can form a Start_item macro, the remaining four parts can also be composed of Finish_item macros. The entire UVM_DO series can also be composed of macros. It's OK

Add a lot of priority options.

In order to better control sequence in the sequencer, there are lock,unlock,grab,ungrab operations, all to gain control of sequencer, but the lock row in

Sequence's tail, and grab in front of sequence's team.

The sequence task function can also start other sequence internally, but it must be of the same transaction type. But virtual sequence can start other different

The sequence. Therefore, in the actual use, often in virtual sequencer to specify Default_virtual_sequence, and in which calls need to be executed in this phase

Sequence, so as to achieve the purpose of controlling sequence.

Two variables in the sequencer:

M_sequencer is an object of type Uvm_sequencer_base. Defined inside the sequence class as a default_sequencer of some operations.

P_sequencer is equivalent to M_seqencer after $cast () processing. Is the object of the sequencer type that initiated the sequence. You can call a higher-level

A new variable within the sequencer. UVM is declared internally using the macro definition ' Uvm_declare_psequencer (my_sequencer).

Use of sequence in UVM (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.