Jump to content

about `ovm_update_sequence_lib(_and_item)


Recommended Posts

why UVM removed `ovm_update_sequence_lib(_and_item) macros? Is there some other macro that can be used as the same function? Could you helps?

The replacement for the old `uvm_update_sequence_lib_and_item macro is to use Sequence Libraries. However these are "late" additions to the standard & I'm not 100% sure of their status. They work tho'.

Here's something simple to try:-

Declare a sequence library & add the sequences you want to access in the library:

class my_seq_lib extends uvm_sequence_library #(my_packet);

   `uvm_object_utils(my_seq_lib)

  function new(string name="my_seq_lib");
     super.new(name);
     add_sequence(my_first_seq::get_type());
     add_sequence(my_second_seq::get_type());
  endfunction

endclass

Create an instance of the library in a test class:-

...
   my_seq_lib myseqs;

  function new(string name, uvm_component parent);
    super.new(name, parent);
    myseqs = my_seq_lib::type_id::create("myseqs",this);
  endfunction : new

Set the properties of the instance in the build_phase of the test class:

   myseqs.selection_mode = UVM_SEQ_LIB_RAND;
From the test class, set the sequence library instance to run on a specific sequencer in a run phase:

uvm_config_db #(uvm_sequence_base)::set(this, "*.env.agent.sequencer.run_phase",
                            "default_sequence",
                            myseqs);
   super.build_phase(phase);

With a selection mode of UVM_SEQ_LIB_RAND, you should get uvm_random_sequence-like behaviour over the sequences you added to the sequence library.

You can also set min/max_random_count properties of the instance in order to control the number of sequences randomly executed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...