Jump to content
jsmith125x

sc_start return on node change

Recommended Posts

Hi. 

 

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.

 

Greetings

Ralph

Share this post


Link to post
Share on other sites

Hi,

 

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?

Hello,

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×