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.
Link to comment
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?

Link to comment
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.

 

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...