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));
await intf.resetN.nextPosedge;
intf.clk.posedge.listen((event) {
for (var i = 0; i < intf.numSelects; i++) {
if (intf.sel[i].previousValue!.toBool() &&
intf.enable.previousValue!.toBool() &&
intf.ready.previousValue!.toBool()) {
if (intf.write.previousValue!.toBool()) {
add(
ApbWritePacket(
addr: intf.addr.previousValue!,
data: intf.wData.previousValue!,
strobe: intf.strb.previousValue,
selectIndex: i,
)..complete(
slvErr: intf.slvErr?.previousValue,
),
);
} else {
add(
ApbReadPacket(
addr: intf.addr.previousValue!,
selectIndex: i,
)..complete(
data: intf.rData.previousValue,
slvErr: intf.slvErr?.previousValue,
),
);
}
}
}
});
}