Jump to content

Recommended Posts

You cannot. SystemC cannot be restarted without exiting and restarting the entire program.

That said, you have three choices:

  1. Call your executable repeatedly from a script, saving the data in uniquely named log files.
  2. 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.
  3. 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.

Share this post


Link to post
Share on other sites
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:

  1. Call your executable repeatedly from a script, saving the data in uniquely named log files.
  2. 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.
  3. 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?

Share this post


Link to post
Share on other sites

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:

  1. Access command-line options (i.e. like Linux) using sc_argc() and sc_argv() -- See https://github.com/dcblack/sc-command-line
  2. Test and get values via environment variables.
  3. Read a configuration file.
  4. Prompt the user at the command line.

 

 

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

×