Jump to content

how to avoid repetitive sensitivity after signal update


Recommended Posts

I hope I have made the topic title understandable, jeje

 

There is the question:

 

I have a sc_method method1 with static sensitivity to 2 signals, sig_1 and sig_2. and sc_method method2 is sensitive to sig_1.

When the sig_1 in simulator is changed, method1 is triggered by sig_1, and after a delta cycle, agian by sig_2. Is there a way to let the sensitivity of method1 to sig_1 wait for a delta cycle, i.e. ignore the sensitiviy of sig_1, if after a delta cycle there is the sensitiviy of sig_2

 

thanks

 

 

sc_method(method1)
    sensitivity << sig_1 <<sig_2;

sc_method(method2)
    sensitivity << sig_1;

/* simulator */
sig_1.write(variable);

 

Link to comment
Share on other sites

In the sense of hardware, an sc_method could be a pure combinatorical block, e.g. something you would implement in a concurrent signal assignment in VHDL. For simulation, the difference is in the simulation performance. An sc_method is always 'run-to-completion' an has no persistent local variables. Hence, it can run in the context of another process. An sc_thread has to have its own process context. As a result, you get less context switches and faster simulation with sc_method. To achieve 'run-to-completion' you are not allowed to wait inside an sc_method. 

 

If you want to wait inside the process you have to use SC_THREAD or SC_CTHREAD.

Link to comment
Share on other sites

  • 4 weeks later...

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.

 Share

×
×
  • Create New...