Jump to content

attoseconds handling in systemC

Recommended Posts



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,

Share this post

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!




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