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): anything to do with crediting here??

  sys.clk.posedge.listen((event) {
    if (la.valid.previousValue!.isValid && la.valid.previousValue!.toBool()) {
      add(LtiLaChannelPacket(
        addr: la.addr.previousValue!.toInt(),
        trans: la.trans.previousValue!.toInt(),
        attr: la.attr.previousValue!.toInt(),
        user: la.userMixInEnable
            ? Axi5UserSignalsStruct(user: la.user?.previousValue!.toInt())
            : null,
        id: la.idMixInEnable
            ? Axi5IdSignalsStruct(
                id: la.id?.previousValue!.toInt(),
              )
            : null,
        prot: Axi5ProtSignalsStruct(
          nse: la.nse?.previousValue!.toBool(),
          priv: la.priv?.previousValue!.toBool(),
          inst: la.inst?.previousValue!.toBool(),
          pas: la.pas?.previousValue!.toInt(),
        ),
        mmu: la.mmuMixInEnable
            ? Axi5MmuSignalsStruct(
                mmuValid: la.mmuValid!.previousValue!.toBool(),
                mmuSecSid: la.mmuSecSid?.previousValue!.toInt(),
                mmuSid: la.mmuSid?.previousValue!.toInt(),
                mmuSsidV: la.mmuSsidV?.previousValue!.toBool(),
                mmuSsid: la.mmuSsid?.previousValue!.toInt(),
                mmuAtSt: la.mmuAtSt?.previousValue!.toBool(),
                mmuFlow: la.mmuFlow?.previousValue!.toInt(),
                mmuPasUnknown: la.mmuPasUnknown?.previousValue!.toBool(),
                mmuPm: la.mmuPm?.previousValue!.toBool(),
              )
            : null,
        debug: la.debugMixInEnable
            ? Axi5DebugSignalsStruct(
                loop: la.loop?.previousValue!.toInt(),
              )
            : null,
        ogV: la.ogv.previousValue!.toBool(),
        og: la.og?.previousValue!.toInt(),
        tlBlock: la.tlBlock?.previousValue!.toInt(),
        ident: la.ident?.previousValue!.toInt(),
        vc: la.vc?.previousValue!.toInt() ?? 0,
      ));
    }
  });
}