HI All,
Here is my code
function void build_phase(uvm_phase phase);
super.build_phase(phase);
environment = env::type_id::create("env",this);
endfunction : build_phase
task run_phase(uvm_phase phase);
seq = rand_sequence::type_id::create("seq",this);
phase.raise_objection(this);
seq.start(environment.seqr);
phase.phase_done.set_drain_time(this, 20ns);
phase.drop_objection(this);
endtask : run_phase
env constructed in build phase, whereas seq constructed in run_phase.
Both can be constructed in build phase also.
I have ran the code by constructing boh in build phase, I am not seeing any simulation difference.
May I know will there be any advantage in terms of reuse or will this lead to any limitation?
Thank You,