Jump to content

attoseconds handling in systemC


Recommended Posts

Prasanna,

 

yes, the time resolution is limited to femtoseconds in IEEE 1666-2011.  It is even guaranteed that SC_FS = 0, which means you can't easily add an SC_AS to your own implementation without the risk of breaking models relying on the SC_[timeunit] enum values (provided that you even have access to the sc_time source code).

 

Do you need these small time values for event notifications and/or delays?  Then you're currently out of luck.  In case you can control the overall simulation, then you can "slow down" the simulated time by a factor of 1000, interpreting seconds as microseconds.  But this is of course dangerous, since some parts of the model may rely on the physical meaning of e.g. sc_time.to_seconds() values.

 

If you need this small resolution for internal computations only, you can resort to your own time type with small conversion functions from/to sc_time, e.g. based on the to_seconds() function returning a plain double (and therefore relying on its physical meaning as well, see above).

 

Greetings from Oldenburg,
  Philipp

Link to post
Share on other sites

Hi Philipp,

 

Thanks for the reply. Hope you are doing good.

 

 I am not going to have anything SC_AS in breaking the exisiting flow.

 

I am already doing with the standard C++/ C (with the help of time_t factor) with internal computation as you mentioned. But i am converting to handle at simulation point (using systemC) than local system time perspective, so thought of using with small delay factor for the sampling. Anyway i will try as you mentioned with the small conversion.

 

Thank you once again. Have a nice weekend!

 

Regards

Prasanna.

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