jsmith125x Posted January 31, 2014 Report Share Posted January 31, 2014 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? Quote Link to comment Share on other sites More sharing options...
ralph.goergen Posted January 31, 2014 Report Share Posted January 31, 2014 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 Quote Link to comment Share on other sites More sharing options...
dakupoto Posted February 1, 2014 Report Share Posted February 1, 2014 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.