Samuel Oliveira Posted October 4, 2018 Report Share Posted October 4, 2018 Hi! How i make ohers sc_start() without get rest time of first sc_start()? Quote Link to comment Share on other sites More sharing options...
David Black Posted October 4, 2018 Report Share Posted October 4, 2018 You cannot. SystemC cannot be restarted without exiting and restarting the entire program. That said, you have three choices: Call your executable repeatedly from a script, saving the data in uniquely named log files. Same as 1 except you could use Linux 'exec' call to chain simulations together; however, be very careful with this. Probably #1 above is simpler and better for that reason. If you are able to deal with only having a single elaboration, then you could do the following: Create a global start_time_offset variable that you update between calls. Make sure you report/act-on time as if it is sc_time_stamp() - start_time_offset. Observation: #1 is still simpler and there are really no real advantages to this approach. Quote Link to comment Share on other sites More sharing options...
Samuel Oliveira Posted October 4, 2018 Author Report Share Posted October 4, 2018 Thanks! I try test yours solutions! Quote Link to comment Share on other sites More sharing options...
Samuel Oliveira Posted October 4, 2018 Author Report Share Posted October 4, 2018 3 hours ago, David Black said: You cannot. SystemC cannot be restarted without exiting and restarting the entire program. That said, you have three choices: Call your executable repeatedly from a script, saving the data in uniquely named log files. Same as 1 except you could use Linux 'exec' call to chain simulations together; however, be very careful with this. Probably #1 above is simpler and better for that reason. If you are able to deal with only having a single elaboration, then you could do the following: Create a global start_time_offset variable that you update between calls. Make sure you report/act-on time as if it is sc_time_stamp() - start_time_offset. Observation: #1 is still simpler and there are really no real advantages to this approach. Can you show how use the varieble start_time_offset in an exemple? Quote Link to comment Share on other sites More sharing options...
David Black Posted October 4, 2018 Report Share Posted October 4, 2018 Sorry, but I'm bit too busy for that. As I indicated, choice 1 is the best option. It is both easier and safer. Coding mistakes with the other options are highly likely and as a non-standard approach, you likely won't get any support or help when it breaks. Something you might not have considered: You can easily pass configuration information to your SystemC designs in many different ways: Access command-line options (i.e. like Linux) using sc_argc() and sc_argv() -- See https://github.com/dcblack/sc-command-line Test and get values via environment variables. Read a configuration file. Prompt the user at the command line. 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.