run method

  1. @override
Future<void> run(
  1. 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 (aw.valid.previousValue!.isValid &&
        aw.ready!.previousValue!.isValid &&
        aw.valid.previousValue!.toBool() &&
        aw.ready!.previousValue!.toBool()) {
      add(Axi5AwChannelPacket(
        request: Axi5RequestSignalsStruct(
          addr: aw.addr.previousValue!.toInt(),
          len: aw.len?.previousValue!.toInt(),
          size: aw.size?.previousValue!.toInt(),
          burst: aw.burst?.previousValue!.toInt(),
          qos: aw.qos?.previousValue!.toInt(),
        ),
        prot: Axi5ProtSignalsStruct(
          prot: aw.prot?.previousValue!.toInt(),
          nse: aw.nse?.previousValue!.toBool(),
          priv: aw.priv?.previousValue!.toBool(),
          inst: aw.inst?.previousValue!.toBool(),
          pas: aw.pas?.previousValue!.toInt(),
        ),
        memAttr: Axi5MemoryAttributeSignalsStruct(
          cache: aw.cache?.previousValue!.toInt(),
          region: aw.region?.previousValue!.toInt(),
          mecId: aw.mecId?.previousValue!.toInt(),
        ),
        user: aw.user != null
            ? Axi5UserSignalsStruct(user: aw.user?.previousValue!.toInt())
            : null,
        id: aw.id != null
            ? Axi5IdSignalsStruct(
                id: aw.id?.previousValue!.toInt(),
                idUnq: aw.idUnq?.previousValue!.toBool())
            : null,
        debug: Axi5DebugSignalsStruct(
            trace: aw.trace?.previousValue!.toBool(),
            loop: aw.loop?.previousValue!.toInt()),
        mmu: aw.mmuValid != null
            ? Axi5MmuSignalsStruct(
                mmuValid: aw.mmuValid?.previousValue!.toBool(),
                mmuSecSid: aw.mmuSecSid?.previousValue!.toInt(),
                mmuSid: aw.mmuSid?.previousValue!.toInt(),
                mmuSsidV: aw.mmuSsidV?.previousValue!.toBool(),
                mmuSsid: aw.mmuSsid?.previousValue!.toInt(),
                mmuAtSt: aw.mmuAtSt?.previousValue!.toBool(),
                mmuFlow: aw.mmuFlow?.previousValue!.toInt(),
                mmuPasUnknown: aw.mmuPasUnknown?.previousValue!.toBool(),
                mmuPm: aw.mmuPm?.previousValue!.toBool(),
              )
            : null,
        qual: aw.nsaId != null
            ? Axi5QualifierSignalsStruct(
                nsaId: aw.nsaId?.previousValue!.toInt(),
                pbha: aw.pbha?.previousValue!.toInt(),
                subSysId: aw.subSysId?.previousValue!.toInt(),
                actV: aw.actV?.previousValue!.toBool(),
                act: aw.act?.previousValue!.toInt(),
              )
            : null,
        atomic: aw.lock != null
            ? Axi5AtomicSignalsStruct(
                lock: aw.lock?.previousValue!.toBool(),
                atOp: aw.atOp?.previousValue!.toInt(),
              )
            : null,
        tag: aw.mpam != null
            ? Axi5MemPartTagSignalsStruct(
                mpam: aw.mpam?.previousValue!.toInt(),
                tagOp: aw.tagOp?.previousValue!.toInt(),
              )
            : null,
        stash: aw.domain != null
            ? Axi5StashSignalsStruct(
                domain: aw.domain?.previousValue!.toInt(),
                stashNid: aw.stashNid?.previousValue!.toInt(),
                stashNidEn: aw.stashNidEn?.previousValue!.toBool(),
                stashLPid: aw.stashLPid?.previousValue!.toInt(),
                stashLPidEn: aw.stashLPidEn?.previousValue!.toBool(),
                cmo: aw.cmo?.previousValue!.toInt(),
              )
            : null,
        opcode: aw.snoop != null
            ? Axi5OpcodeSignalsStruct(snoop: aw.snoop?.previousValue!.toInt())
            : null,
      ));
    }
  });
}