Hi,
I have the following set of sequence classes and test class.
//Defining base sequence
class base_seq extends uvm_sequence;
`uvm_object_utils(base_seq)
`uvm_declare_p_sequencer(my_virtual_sequencer)
axi_seq my_seq;
function new(string name="base_seq");
super.new(name);
endfunction:new
virtual task pre_body()
my_seq = axi_seq::type_id::create("my_seq");
axi_seq.start(p_sequencer.axi_seqr);
endtask: pre_body
endclass: base_seq
//Defining actual test sequence
class my_seq extends base_seq;
`uvm_object_utils(my_seq)
`uvm_declare_p_sequencer(my_virtual_sequencer)
test_seq_item my_test_seq_item; //test_seq_item is of the type uvm_sequence_item
function new(string name="my_seq");
super.new(name);
endfunction:new
virtual task body();
$display("Starting my_seq"); //Display 1
`uvm_create_on(my_test_seq_item, p_sequencer.config_seqr)
start_item(my_test_seq_item);
my_test_seq_item.var1 = 1;
my_test_seq_item.var2 = 2;
finish_item(my_test_seq_item);
$display("End of my_seq"); //Display 2
endtask: body
endclass: my_seq
class my_test extends uvm_test;
my_seq test_seq;
`uvm_component_utils(my_test)
function new(string name = "my_test", uvm_component parent=null);
super.new(name,parent);
endfunction : new
virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
test_seq = new();
endfunction : build_phase
virtual task run_phase(uvm_phase phase);
//start test_seq of the class my_seq. I use start because i think that is the only way i can make the pre_body to execute
test_seq.start(env_inst.vseqr); //vseqr is of of the type my_virtual_sequencer.
endtask: run_phase
endclass: my_test
As soon as i start the test_seq (of class my_seq) in my_test class, i see that pre_body of base_seq is executed and then i see the display statement (Display 1) in my_seq body. However the item my_test_seq_item (of class test_seq_item) is never started. I do not see any warnings or errors. The sequence my_seq seems to be stuck at the point after the display statement. I do not see Display 2.
Can any one figure out whats wrong here. Why is the sequence item in my_seq not getting started(executed)?
I do know a work around for this and this would have two steps.
- We could change the pre_body in the base_seq to body.
- Add the statement super.body() as the first line under body() of my_seq.
I really do not (read cannot) change the contents of body() task of my_seq. i.e i do not want to add a super.body().
I would like to know if we can somehow start axi_seq mentioned in base_seq before the body of my_seq and without changing the contents of the body() of my_seq. (Please read that i may be able to change anything outside of the body() of my_seq).