Jump to content

[uvm_event] wait_trigger could not be cancelled by disable fork. why?


Recommended Posts

Hi,

After several hours' debug, I realized the truth that uvm_event.wait_trigger could not be cancelled by disabling fork. Could any one let me know the reason why?

uvm_event a0, a1;

a0 = uvm_event_pool::get_global("a0");

a1 = uvm_event_pool::get_global("a1");

fork: fork_name

a0.wait_trigger();

a1.wait_trigger();

begin

#100

a1.trigger();

end

join_any

disable fork_name;

// a0 is still waiting here

if ( a0.get_num_waiters() != 0 )

`uvm_fatal(...)

Link to comment
Share on other sites

disable fork_name will disable the fork statement, that is, it will stop waiting on its children (but in this case the fork has already ended). If you want to kill the children, you need to use "disable fork" instead. Be careful as both of these can have unexpected consequences. I tend to agree that having the thread end itself is easier to understand and debug.

Link to comment
Share on other sites

hi,

what do you mean with "still waiting". the wait_trigger() task should be aborted BUT without cleanup. this probably looks like as if there are still num_waiters waiting. if you do use "disable fork" to break the wait_trigger() you probably have to call cancel() to indicate that you removed one waiter.

/uwe

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.

Guest
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...