katang Posted January 5 Report Share Posted January 5 I am making a design using the timing facilities of SystemC only (not electronic design). The SystemC design is ready-made, and the parameters can be varied by the user. I am preparing a graphic interface that starts the Run() method of the simulator, runs maybe not to the end. When seeing that some parameter is not perfect, the user quits the actual simulation; changes the respective parameter and starts the simulation again, from the very beginning. My questions: 1./ How can I reset SystemC engine to make a fresh start (i.e., no change in the design, only some (say, simulated delay or transmitted parameter) changes), so that it runs as it were the first sc_start() it sees? 2./ (before executing the simulation steps, I perform sc_start( SC_ZERO_TIME ); as suggested in the Reference Book) The simulator proceeds event-by event, in a way like while(MoreEvents) { sc_start( sc_time_to_pending_activity() ); MoreEvents = sc_pending_activity(); // Set flag if more to do sc_pause(); // Be sure there is no processing // Some update } Do I need to call scPause() after every single event, or, say if I want to update only after a certain number of events or after some (simulation) time passes, outside the "while" brackets? Thanks in advance Quote Link to comment Share on other sites More sharing options...
David Black Posted January 6 Report Share Posted January 6 Restart is not possible and that is by design. See the fourth paragraph of section 4.4.5.3 in IEEE-1666-2023 (download free copy via ). Also see figure 1 in section 4.6.10. However, you could save your parameters in a file (e.g., YAML or JSON) on exiting and read them on subsequent runs. Also, you possibly misunderstand sc_pause and sc_start. You should never call sc_pause() from sc_main(), but only within the context of SystemC processes (SC_THREAD, SC_CTHREAD or SC_METHOD). With respect to sc_start, read section 4.6.8 carefully. The example code could significantly slow down your simulation, but it does allow for single stepping the simulation. Observation: sc_start is sort of misnamed. The first time it is called, it "starts" the simulation. Subsequent calls "resume" the simulation. You should never attempt to advance time outside of SystemC processes. Also, time can never be negative or go backwards. Quote Link to comment Share on other sites More sharing options...
katang Posted January 7 Author Report Share Posted January 7 Thanks for the clarification. Yes, the example code slows down the simulation by some 25-30%, but enables the GUI to access my objects without limitation, given that sc_time is not passing. Furthermore, if it runs in a separate thread, it can run in parallel with the GUI. What I actually wanted, just to stop the original event processing, empty the event wait list (BTW: Is there any 'Cancel all events?'), and with issuing a special 'reset' signal to my simulator (initializing all my modules), from the point of my design, I am at a point where I was after I issued sc_start(SC_ZERO_TIME'); except that sc_time is not reset. Do you see any caveat with tis? Quote Link to comment Share on other sites More sharing options...
David Black Posted January 9 Report Share Posted January 9 It can only run in a separate thread if you use the correct semantics. The SystemC kernel is not thread-safe in general. If you use async_request_update and some of the newer 2023 features, you can do a decent job of parallelism. Quote Link to comment Share on other sites More sharing options...
katang Posted January 11 Author Report Share Posted January 11 Thanks again. One more little question: who can access IEEE-1666-2023? (I mean: our universities and IEEE members cannot). The SystemC page leads back to IEEE. Quote Link to comment Share on other sites More sharing options...
David Black Posted January 15 Report Share Posted January 15 The IEEE version is currently free from the IEEE because Accellera paid IEEE to have it so. However, you need a free IEEE account (i.e., you must register) and it is easy to then download the free version. Every copy is registered to the individuals login - the price for free). https://ieeexplore.ieee.org/document/10246125 (you will need to login to access) Quote Link to comment Share on other sites More sharing options...
katang Posted January 19 Author Report Share Posted January 19 I am sorry, but the best reply I can achieve is This Content is Not Included in Your Subscription The system creates an account for my gmail address, resets my university address. It allows to log me in with either my gmail address or my university address, welcomes me by name, but that is all. Somehow the institutions are restricted. No access with institutional access, nor with free/paid IEEE account. Quote Link to comment Share on other sites More sharing options...
David Black Posted January 21 Report Share Posted January 21 You will need to take that up with IEEE. No additional help will be found here I'm afraid. Quote Link to comment Share on other sites More sharing options...
katang Posted January 24 Author Report Share Posted January 24 I think you are right. However, on page https://ieeexplore.ieee.org/browse/standards/get-program/page/series?id=80 this standard is not listed. Quote Link to comment Share on other sites More sharing options...
David Black Posted March 1 Report Share Posted March 1 IEEE 1666-2023 is the first standard listed on the page! I'm sorry, but you need to try harder. We cannot legally get it for you. 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.