walkeranderson Posted October 11, 2015 Report Share Posted October 11, 2015 In the run_phase() of a component, I'd like to raise an objection to the main phase so I added the following: uvm_main_phase::get().raise_objection(this); and I get this error when it runs: UVM_ERROR @ 0 ns: reporter [uVM/PH/NULL_OBJECTION] 'uvm_test_top.foo' attempted to raise an objection on 'main', however 'main' is not a task-based phase node! (This is a UVM_PHASE_IMP, you have to query the schedule to find the UVM_PHASE_NODE) Why? What do I not understand or how should this be done? It looks to me like uvm_main_phase is derived from uvm_task_phase so wouldn't that make it a "task-based phase node"? Thanks. Walker Quote Link to comment Share on other sites More sharing options...
tudor.timi Posted October 15, 2015 Report Share Posted October 15, 2015 You can get a handle to the 'phase' argument that gets passed to 'main_phase(...)' using: uvm_hase main_phase = phase.find(uvm_main_phase::get(), 0); This works if you call it from 'end_of_elaboration_phase(...)' (or I guess any function-based phase), but for some reason it returns null when called in 'run_phase(...)'. I don't know why and I also don't want to dig around the source code to find out. You could store this 'main_phase' inside a class field and use in 'run_phase'. It's not clean, but it's pragmatic. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.