There are two usual ways to run the sequence:
How default_sequence works?
Inside uvm_sequencer_base.svh
---------------------------------------------------------------------------------
function void uvm_sequencer_base::start_phase_sequence(uvm_phase phase);
...
(uvm_config_db #(uvm_object_wrapper)::get(
this, {phase.get_name(),"_phase"}, "default_sequence", wrapper) && wrapper != null)
...
--------------------------------------------------------------------------------------
This API will do the following:
Who calls this above method?
Inside uvm_task_phase.svh:
--------------------------------------------------------------------------------------
virtual function void execute(uvm_component comp,
uvm_phase phase);
...
if ($cast(seqr,comp))
seqr.start_phase_sequence(phase);
...
--------------------------------------------------------------------------------------
execute method is called for all phases of component.
And if the component is Sequencer it will call start_phase_sequence() method, to check if the default_sequence has been set for this method.
If we run sequence using both the approach:
Registering default sequence in main phase of sequencer and starting another sequence in main phase of testcase, default sequence will be executed first as main phase is called in bottom-up hierarchy.
- Using default_sequence
- Using start method
How default_sequence works?
Inside uvm_sequencer_base.svh
---------------------------------------------------------------------------------
function void uvm_sequencer_base::start_phase_sequence(uvm_phase phase);
...
(uvm_config_db #(uvm_object_wrapper)::get(
this, {phase.get_name(),"_phase"}, "default_sequence", wrapper) && wrapper != null)
...
--------------------------------------------------------------------------------------
This API will do the following:
- get default_sequence
- cast this uvm_object_wrapper into uvm_sequence_base
- start the sequence
Who calls this above method?
Inside uvm_task_phase.svh:
--------------------------------------------------------------------------------------
virtual function void execute(uvm_component comp,
uvm_phase phase);
...
if ($cast(seqr,comp))
seqr.start_phase_sequence(phase);
...
--------------------------------------------------------------------------------------
execute method is called for all phases of component.
And if the component is Sequencer it will call start_phase_sequence() method, to check if the default_sequence has been set for this method.
If we run sequence using both the approach:
Registering default sequence in main phase of sequencer and starting another sequence in main phase of testcase, default sequence will be executed first as main phase is called in bottom-up hierarchy.
No comments:
Post a Comment