Function simics::api::base::event::_event_find_next_time

source ·
fn _event_find_next_time<F>(
    clock: *mut ConfObject,
    event: *mut EventClass,
    obj: *mut ConfObject,
    filter: Option<F>,
) -> Result<f64>
where F: Fn(*mut c_void) -> i32 + 'static,
Expand description

Return the number of cycles/seconds/steps to the first event of evclass of obj posted on clock for which pred is true, or −1 if no event matched. pred will be called with the data associated with the event and the supplied match_data. If pred is null (None in Python), the first evclass event for obj on clock will be used.

There are separate calls of events posted at a point in time (cycle or seconds) and on a specific step. Note that the return value of SIM_event_find_next_cycle is only a preliminary estimate; the number of remaining cycles will change if the clock’s frequency changes dynamically. To handle dynamically changing clock frequencies correctly, subscribe to the frequency changes via the clock’s simple_dispatcher interface.

§Arguments

  • clock - The clock for the posted event
  • event - The posted event class
  • obj - The object posted on

§Return Value

If found, the cycle number the event will next trigger on

§Context

Cell Context