Jump to content

sc_start return on node change


Recommended Posts



Think about how simulation works in SystemC. 

Logical time advances with events (timestamps). And in a process, every line between two wait statements (or every line of a method) is executed without any time advance. 


So, if you want the simulation not to advance time after a specific event: don't let the execution of a process reach the next wait statement. 


E.g., you may have a method sensitive to the mentioned output port. In the execution of this method, you can synchronize with your environment (Operation system wait (physical/wall-clock-time), read or set button status, ...). When the synchronization is done, let the method return and the simulation will continue.




Link to comment
Share on other sites



I'd like to run sc_start(duration) but to stop when a node change. Nodes are the out ports at top level.

Is there this feauture or could you give me guidlines how to implement it?


Maybe I did not understand your query correctly, but a sensitivity list

achieves your goal fairly easily. For example, if one were to simulate

a 2 input AND gate, then the first is set to logic '1', the second to '0'

and then sc_core::sc_start(<time duration>); is executed,

Then the first input is changed to logic '0' and the second to logic '1',

and sc_core::sc_start is invoked gain for the same time period. Hope

this helps.

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