Function simics::api::base::event::event_post_cycle

source ·
pub fn event_post_cycle<F>(
    clock: *mut ConfObject,
    event: *mut EventClass,
    obj: *mut ConfObject,
    cycles: Cycles,
    callback: F,
) -> Result<()>
where F: FnMut(*mut ConfObject) + 'static,
Expand description

An event of evclass for object obj is posted on clock to occur at a given point in the future. The user_data will be associated with the event. The clock is the object that should be used for keeping track of time for the event. It can be a processor or an instance of the clock class.

If a configuration class was specified when evclass was registered, then obj must be an instance of that class.

The expiration point can be specified in seconds, cycles or steps by using the appropriate call, and these values are relative to the current state. Events that need to run synchronized (Sim_EC_Machine_Sync) can only be posted in seconds or cycles, not steps, since synchronization can only be perform in virtual time.

Note: Events posted with SIM_event_post_cycle are posted at a certain point in time based on the clock’s current frequency, not at a certain clock cycle. The difference is significant if the frequency of the clock object can change dynamically.

§Arguments

  • clock - The clock whose time this event is being posted for
  • event - The event class registered with register_event being posted
  • obj - The object the event is being posted on
  • cycles - The number of seconds until this event expires
  • callbacks - Callbacks to run for this event

§Context

Cell Context