run method

  1. @override
Future<void> run(
  1. Phase phase
)
override

Executes this Component's activities related to running the test.

Overrides of run must call super.run in an unawaited fashion. For example:

@override
Future<void> run(Phase phase) async {
  unawaited(super.run(phase));
  // New code goes here!
}

Implementation

@override
Future<void> run(Phase phase) async {
  unawaited(super.run(phase));

  final random = Test.random ?? Random();

  await _drive(null);

  await reset.nextNegedge;

  while (!Simulator.simulationHasEnded) {
    final doBlock = random.nextDouble() < blockRate;

    if (pendingSeqItems.isNotEmpty && !doBlock) {
      await _drive(pendingSeqItems.removeFirst());
    } else {
      await _drive(null);
    }
  }
}