Jump to content

How to invoke a function/sc_method for two sensitive becomes true


Recommended Posts

Actually this is not going to work  as it is quite unlikely that both events fire at the same delta cycle. So you would write something like

void do_dff(){
    if(enable.read())
        q=d;
}

sc_ctor(){
    SC_METHOD(do_dff);
    sensitive << clk;
} 

The only option to concatenate events is to use sc_core::sc_event_and_list and sc_core::sc_event_or_list but those can only use in dynamic sensitivity (wait() for SC_THREADs and next_trigger() for SC_METHODs).

Best

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