Axi5TransactionChecker constructor

Axi5TransactionChecker({
  1. required Axi5SystemInterface sys,
  2. required Component? parent,
  3. Axi5ReadCluster? read,
  4. Axi5WriteCluster? write,
  5. bool reportViolations = true,
  6. int maxTransactionBytes = 4096,
  7. bool readInterleavingDisabled = false,
  8. String name = 'axi5TransactionChecker',
})

Checks at least one read or write cluster without changing its agents.

Implementation

Axi5TransactionChecker({
  required this.sys,
  required Component? parent,
  this.read,
  this.write,
  this.reportViolations = true,
  this.maxTransactionBytes = 4096,
  this.readInterleavingDisabled = false,
  String name = 'axi5TransactionChecker',
}) : super(name, parent) {
  final reads = read;
  final writes = write;
  if (reads == null && writes == null) {
    throw ArgumentError('Provide AXI5 read or write channels to check.');
  }
  if (!const {64, 128, 256, 512, 1024, 2048, 4096}
      .contains(maxTransactionBytes)) {
    throw ArgumentError.value(maxTransactionBytes, 'maxTransactionBytes',
        'Must be a power of two from 64 to 4096 bytes.');
  }
  if (reads != null && reads.ar.useCrediting != reads.r.useCrediting) {
    throw ArgumentError('AR and R must use the same transport.');
  }
  if (writes != null &&
      (writes.aw.useCrediting != writes.w.useCrediting ||
          writes.aw.useCrediting != writes.b.useCrediting ||
          (writes.aw.useCrediting && writes.aw.numRp != writes.w.numRp))) {
    throw ArgumentError(
        'AW, W, and B must use the same transport, and credited AW and W '
        'must have the same number of resource planes.');
  }
  for (final width in [
    if (reads != null) reads.r.data.width,
    if (writes != null) writes.w.data.width,
  ]) {
    Axi5SizeField.fromSize(width);
  }
  final w = writes?.w;
  if (w != null && w.strb != null && w.strb!.width != w.data.width ~/ 8) {
    throw ArgumentError('WSTRB must have one bit per WDATA byte.');
  }
}