Hi,
For any UVM phase, we pass the argument typically “phase” of type uvm_phase. eg., function void build_phase( uvm_phase phase ). What is the purpose of this argument. Is it mainly to raise and drop objections or does it have any other functionality?
Also, does the “phase” variable take on the value of build phase in the code snippet above.
Thanks
Uma
The phase argument is mainly used for objections, but is also used for coordination between different task based phases - something we do not recommend doing - use sequences instead.
The reason for the phase argument in the build_phase and all the other function based phases was just for symmetry in all the phase methods.
In reply to dave_59:
Hello Dave,
Thanks for your reply. I have another very basic question. When I call function void build_phase( uvm_phase phase ), say maybe in the test, we really donot pass any value to it. And maybe in the sequence I access the phase variable by saying “seq.starting_phase = phase”. What will be the value of phase because i have not passed any value as such?
Thanks
Uma
Hi,
I am facing issue while adding user defined phase.
I want to add it between uvm_extract_phase and uvm_check_phase
code snippet (test component build phase)
##################
uvm_phase schedule;
schedule = uvm_domain::get_uvm_schedule();
schedule.add(my_training_phase::get(), .after_phase(uvm_extract_phase::get()),
.before_phase(uvm_check_phase::get()));
##################
But getting following error
reporter [PH_BAD_ADD] cannot find before_phase ‘report’ within node ‘uvm_sched’
Why its not taking “.before_phase(uvm_check_phase::get()”?
Thanks,
Rithu
Did you try to run in debug gui mode and set a breakpoint in the UVM source code itself?
Assuming you are using UVM version 1.2
File: uvm_phase.svh, lines 847-853
if (before_phase != null && before_phase.get_phase_type() == UVM_PHASE_IMP) begin
string nm = before_phase.get_name();
before_phase = find(before_phase);
if (before_phase == null)
`uvm_fatal("PH_BAD_ADD",
{"cannot find before_phase '",nm,"' within node '",get_name(),"'"})
end
Hi
Yes using uvm 1.2 I was not using debug gui and didn’t touch the source code of uvm_phase
Regards,
Rithu
One more point, this issue faced only when try to add the phase between extract and check phase. There is no issue when defined phase added between configure phase and main phase
Regards,
Rithu
Please try running debug gui mode and set breakpoints across the file I wrote you.
To understand what value has the before_phase
variable?
And why the fatal error is triggered.