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): handle credited!!
sys.clk.posedge.listen((event) {
if (ar.valid.previousValue!.isValid &&
ar.ready!.previousValue!.isValid &&
ar.valid.previousValue!.toBool() &&
ar.ready!.previousValue!.toBool()) {
add(Axi5ArChannelPacket(
request: Axi5RequestSignalsStruct(
addr: ar.addr.previousValue!.toInt(),
len: ar.len?.previousValue!.toInt(),
size: ar.size?.previousValue!.toInt(),
burst: ar.burst?.previousValue!.toInt(),
qos: ar.qos?.previousValue!.toInt(),
),
prot: Axi5ProtSignalsStruct(
prot: ar.prot?.previousValue!.toInt(),
nse: ar.nse?.previousValue!.toBool(),
priv: ar.priv?.previousValue!.toBool(),
inst: ar.inst?.previousValue!.toBool(),
pas: ar.pas?.previousValue!.toInt(),
),
memAttr: Axi5MemoryAttributeSignalsStruct(
cache: ar.cache?.previousValue!.toInt(),
region: ar.region?.previousValue!.toInt(),
mecId: ar.mecId?.previousValue!.toInt(),
),
user: ar.user != null
? Axi5UserSignalsStruct(user: ar.user?.previousValue!.toInt())
: null,
id: ar.id != null
? Axi5IdSignalsStruct(
id: ar.id?.previousValue!.toInt(),
idUnq: ar.idUnq?.previousValue!.toBool())
: null,
debug: Axi5DebugSignalsStruct(
trace: ar.trace?.previousValue!.toBool(),
loop: ar.loop?.previousValue!.toInt()),
mmu: ar.mmuValid != null
? Axi5MmuSignalsStruct(
mmuValid: ar.mmuValid?.previousValue!.toBool(),
mmuSecSid: ar.mmuSecSid?.previousValue!.toInt(),
mmuSid: ar.mmuSid?.previousValue!.toInt(),
mmuSsidV: ar.mmuSsidV?.previousValue!.toBool(),
mmuSsid: ar.mmuSsid?.previousValue!.toInt(),
mmuAtSt: ar.mmuAtSt?.previousValue!.toBool(),
mmuFlow: ar.mmuFlow?.previousValue!.toInt(),
mmuPasUnknown: ar.mmuPasUnknown?.previousValue!.toBool(),
mmuPm: ar.mmuPm?.previousValue!.toBool(),
)
: null,
qual: ar.nsaId != null
? Axi5QualifierSignalsStruct(
nsaId: ar.nsaId?.previousValue!.toInt(),
pbha: ar.pbha?.previousValue!.toInt(),
subSysId: ar.subSysId?.previousValue!.toInt(),
actV: ar.actV?.previousValue!.toBool(),
act: ar.act?.previousValue!.toInt(),
)
: null,
atomic: ar.lock != null
? Axi5AtomicSignalsStruct(
lock: ar.lock?.previousValue!.toBool(),
atOp: ar.atOp?.previousValue!.toInt(),
)
: null,
tag: ar.mpam != null
? Axi5MemPartTagSignalsStruct(
mpam: ar.mpam?.previousValue!.toInt(),
tagOp: ar.tagOp?.previousValue!.toInt(),
)
: null,
chunk: ar.chunkEn != null
? Axi5ChunkSignalsStruct(
chunkEn: ar.chunkEn?.previousValue!.toBool(),
chunkV: ar.chunkV?.previousValue!.toBool(),
chunkNum: ar.chunkNum?.previousValue!.toInt(),
chunkStrb: ar.chunkStrb?.previousValue!.toInt(),
)
: null,
opcode: ar.snoop != null
? Axi5OpcodeSignalsStruct(snoop: ar.snoop?.previousValue!.toInt())
: null,
));
}
});
}