I am creating a framework where my verification team and I can write uvm test cases with ease. The basic idea is that my base (uvm_)sequence only contains the one line in its body task:
regs.update(status);
From my individual (uvm_)tests, I can set the register values using handy helper functions. For example, my tests would contain:
class base_test extends uvm_test;
........
........
virtual function void set_registerA(....);
regs.registerA1.set(....);
regs.registerA2.set(....);
regs.registerA3.set(....);
endfunction
virtual function void set_registerB(....);
regs.registerB1.set(....);
regs.registerB2.set(....);
regs.registerB3.set(....);
endfunction
endclass
class test1 extends base_test;
virtual function void end_of_elaboration_phase(uvm_phase phase);
set_registerA(....);
set_registerB(....);
endfunction
endclass
class test2 extends base_test;
virtual function void end_of_elaboration_phase(uvm_phase phase);
set_registerA(....);
set_registerB(....);
endfunction
endclass
Now I realize that end_of_elaboration phase may not be the best place to set the registers. My compiler gave me warnings that said "WARNING: Calling a task "set_registerA" in task "end_of_elaboration". So I changed it to execute in my run_phase:
class test1 extends base_test;
virtual task run_phase(uvm_phase phase);
super.run_phase(phase);
set_registerA(....);
set_registerB(....);
endfunction
endclass
class test2 extends base_test;
virtual task run_phase(uvm_phase phase);
super.run_phase(phase);
set_registerA(....);
set_registerB(....);
endfunction
endclass
I am unsure if this is the right methodology for what I am trying to do? Does calling super.run_phase cause problems? I don't see this done anywhere else.