Jump to content
vishnuprasanthv

+uvm_set_default_sequence usage behavior in UVM 1.2

Recommended Posts

I have two sequences seq_a and seq_b that can be run on sequencer.

In my component i have the code to set the default sequence.

Below is the code in component and i am trying to set the default sequence as "seq_b"

 

task run_phase(uvm_phase phase);

uvm_config_db #(uvm_object_wrapper)::set(null, "uvm_test_top.my_sequencer.main_phase", "default_sequence", seq_b::type_id::get());
sequencer.start_phase_sequence(phase);
endtask: run_phase
With this code in component, if i pass the following command lines argument to change the sequence to seq_a:
 "+uvm_set_default_sequence=*,main_phase,seq_a"

The sequence that runs on sequencer is still seq_b only, it was not modified to seq_a.  

Sequence control from command line works when i comment the default_sequence code in run_phase.

It looks for me that "+uvm_set_default_sequence" can't be used when i am setting the default_sequence inside the run_phase.

It will be good if "+uvm_set_default_sequence" overrides the default_sequence that was set in run_phase. So that it gives more flexibility from command line.

 

Please give your comments on this behavior on UVM 1.2.

 

 

 

 

 

Share this post


Link to post
Share on other sites

The +uvm_set_default_sequence is applied at the time that +uvm_set_config_int is applied, which seems consistent.  This is before run_phase, which is why your code overrides the command line value.  What do you think about making your code check whether there is an existing setting first?

task run_phase(uvm_phase phase);

   if (!uvm_config_db #(uvm_object_wrapper)::exists(null, "uvm_test_top.my_sequencer.main_phase", "default_sequence"))
      uvm_config_db #(uvm_object_wrapper)::set(null, "uvm_test_top.my_sequencer.main_phase", "default_sequence", seq_b::type_id::get());
   sequencer.start_phase_sequence(phase);
endtask: run_phase

Share this post


Link to post
Share on other sites

I agree with your code and the code snippet which you added should work fine.

 

But my question is when both are there, the configuration from command line should be given the highest precedence with out any code fix and should work as config_db::set was done from top hierarchy. But this is not the observed behaviour.

Share this post


Link to post
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...