vishnuprasanthv Posted April 15, 2014 Report Share Posted April 15, 2014 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. Quote Link to comment Share on other sites More sharing options...
mastrick Posted April 16, 2014 Report Share Posted April 16, 2014 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 Quote Link to comment Share on other sites More sharing options...
vishnuprasanthv Posted April 16, 2014 Author Report Share Posted April 16, 2014 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. Quote Link to comment Share on other sites More sharing options...
David Black Posted April 18, 2014 Report Share Posted April 18, 2014 Writing to the config_db should normally be established in the build_phase, which is executed top-down, rather than the run_phase, then I believe it should work. Quote Link to comment Share on other sites More sharing options...
vishnuprasanthv Posted April 24, 2014 Author Report Share Posted April 24, 2014 Hi David, I am seeing the same behaviour when move the configuration from run to build phase. Below is the code http://www.edaplayground.com/x/3Gi I was trying to modify the sequence to seq_a from command line. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.