run method
- 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();
ready.inject(0);
await reset.nextNegedge;
var cycle = 0;
while (!Simulator.simulationHasEnded) {
final active =
activity?.isActive(cycle) ?? random.nextDouble() >= blockRate;
ready.inject(active ? 1 : 0);
await clk.nextPosedge;
cycle++;
}
}