NicoCaldo Posted April 18, 2020 Report Posted April 18, 2020 Hi, is there a function that return the actual time at which the simulation is? I know sc_time_stamp() but it actually returns a string with the measure unit. I would like something like int i; i = sc_time_stamp().time(ns); (where ns is, for istance, the measure unit) Quote
Eyck Posted April 18, 2020 Report Posted April 18, 2020 sc_time_stamp() returns a sc_time objec, not a string. It seems the use in a particular context (e.g. cout<<sc_time_stamp()) triggers an implicit type conversion. Pls. refer to the standard how to convert to particular unit. Quote
maehne Posted April 19, 2020 Report Posted April 19, 2020 Check clause 5.11 of IEEE Std 1666-2011 for the member functions of the sc_time class. sc_time::value() will return the underlying integer representation of the time value, which has to be interpreted together with the set discrete time resolution. sc_time::to_seconds() returns a double value representing the time value in seconds. Shashank V M 1 Quote
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.