jsmith125x 2 Report post 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? Share this post Link to post Share on other sites
ralph.goergen 57 Report post 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 Share this post Link to post Share on other sites
dakupoto 33 Report post 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. Share this post Link to post Share on other sites