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 sIntf.resetN.nextPosedge;

  sIntf.clk.posedge.listen((event) {
    if (rIntf.valid.previousValue!.isValid &&
        rIntf.ready.previousValue!.isValid &&
        rIntf.valid.previousValue!.toBool() &&
        rIntf.ready.previousValue!.toBool()) {
      final lastCheck = rIntf.last == null ||
          rIntf.last!.previousValue!.isValid &&
              rIntf.last!.previousValue!.toBool();
      final curr = rIntf.data.value;
      final currS =
          (isWr ? (rIntf as Axi4BaseWChannelInterface).strb.value : null);
      _dataBuf.add(curr);
      if (isWr) {
        _strbBuf.add(currS!);
      }
      if (lastCheck) {
        add(
          Axi4DataPacket(
              data: _dataBuf.rswizzle(),
              strb: (isWr ? _strbBuf.rswizzle() : null),
              id: rIntf.id?.previousValue,
              user: rIntf.user?.previousValue,
              resp: (isRd
                  ? (rIntf as Axi4BaseRChannelInterface).resp?.value
                  : null)),
        );
        _dataBuf.clear();
        if (isWr) {
          _strbBuf.clear();
        }
      }
    }
  });
}