injectEndOfTickAction static method

void injectEndOfTickAction(
  1. dynamic action()
)

Adds an arbitrary action to be executed at the end of a tick in the SimulatorPhase.clkStable phase, the current one if possible.

If the injection occurs too late to occur in the current tick, it will execute in a new tick in the same timestamp.

If action returns a Future, it will be awaited.

This function is useful for some scenarios such as cosimulation, but is not generally expected to be used for "normal" testbench development.

Implementation

static void injectEndOfTickAction(dynamic Function() action) {
  _injectedEndOfTickActions.add(action);
}