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 (b.valid.previousValue!.isValid &&
        b.ready!.previousValue!.isValid &&
        b.valid.previousValue!.toBool() &&
        b.ready!.previousValue!.toBool()) {
      add(Axi5BChannelPacket(
        id: b.id != null
            ? Axi5IdSignalsStruct(
                id: b.id?.previousValue!.toInt(),
                idUnq: b.idUnq?.previousValue!.toBool())
            : null,
        tag: b.tag != null
            ? Axi5MemRespDataTagSignalsStruct(
                tag: b.tag?.previousValue!.toInt(),
                tagUpdate: b.tagUpdate?.previousValue!.toInt(),
                tagMatch: b.tagMatch?.previousValue!.toInt(),
                comp: b.comp?.previousValue!.toBool(),
                persist: b.persist?.previousValue!.toBool(),
              )
            : null,
        debug: Axi5DebugSignalsStruct(
            trace: b.trace?.previousValue!.toBool(),
            loop: b.loop?.previousValue!.toInt()),
        response: Axi5ResponseSignalsStruct(
            resp: b.resp?.previousValue!.toInt(),
            busy: b.busy?.previousValue!.toBool()),
        user: b.user != null
            ? Axi5UserSignalsStruct(user: b.user?.previousValue!.toInt())
            : null,
      ));
    }
  });
}