Jump to content

Recommended Posts

Posted

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)

Posted

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.

Posted

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.

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...