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 sys.resetN.nextPosedge;
// TODO(kimmeljo): anything to do with crediting here??
sys.clk.posedge.listen((event) {
if (lr.valid.previousValue!.isValid && lr.valid.previousValue!.toBool()) {
add(LtiLrChannelPacket(
addr: lr.addr.previousValue!.toInt(),
hwattr: lr.hwAttr.previousValue!.toInt(),
attr: lr.attr.previousValue!.toInt(),
user: lr.userMixInEnable
? Axi5UserSignalsStruct(user: lr.user?.previousValue!.toInt())
: null,
id: lr.idMixInEnable
? Axi5IdSignalsStruct(
id: lr.id?.previousValue!.toInt(),
)
: null,
prot: Axi5ProtSignalsStruct(
nse: lr.nse?.previousValue!.toBool(),
priv: lr.priv?.previousValue!.toBool(),
inst: lr.inst?.previousValue!.toBool(),
pas: lr.pas?.previousValue!.toInt(),
),
debug: lr.debugMixInEnable
? Axi5DebugSignalsStruct(
loop: lr.loop?.previousValue!.toInt(),
)
: null,
response: Axi5ResponseSignalsStruct(
resp: lr.resp?.previousValue!.toInt(),
),
mecId: lr.mecId?.previousValue!.toInt(),
mpam: lr.mpam?.previousValue!.toInt(),
ctag: lr.ctag.previousValue!.toInt(),
size: lr.size.previousValue!.toInt(),
vc: lr.vc?.previousValue!.toInt() ?? 0,
));
}
});
}