jsmith
jsmith

Reputation: 127

How to get the time of the next event in SystemC

Is there a function in SystemC which returns the time of the next event? Or if does not exist, then how to implement it?

For example I have clock model with 1 MHz frequency and I run the model with sc_start(100, SC_NS). The next scheduled event is at 500 ns.

The code looks like this:

..
sc_start(100, SC_NS);
next_time = get_next_event_time(); //get_next_event_time() should return with 500
..

Upvotes: 1

Views: 366

Answers (1)

Guillaume
Guillaume

Reputation: 1407

You can use sc_time_to_pending_activity() to get the time until the earliest pending activity. More details are available in IEEE Std 1666-2011 at 4.5.7 Functions to detect pending activity

Upvotes: 1

Related Questions