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));
var cycle = 0;
while (!Simulator.simulationHasEnded) {
await clk.nextPosedge;
if (Simulator.simulationHasEnded) {
return;
}
final resetValue = reset.previousValue;
final readyValue = ready.previousValue;
final validValue = valid.previousValue;
final inReset =
resetValue != null && resetValue.isValid && resetValue.toBool();
final accepted = !inReset &&
readyValue != null &&
validValue != null &&
readyValue.isValid &&
validValue.isValid &&
readyValue.toBool() &&
validValue.toBool();
if (accepted) {
add(ReadyValidChannelItem(codec.sample(data, previous: true),
cycle: cycle));
}
cycle++;
}
}