Jump to content

How do I raise objection to main phase in a component's run_phase()

Recommended Posts

In the run_phase() of a component, I'd like to raise an objection to the main phase so I added the following:




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"?






Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...