Axi5TransactionChecker constructor
- required Axi5SystemInterface sys,
- required Component? parent,
- Axi5ReadCluster? read,
- Axi5WriteCluster? write,
- bool reportViolations = true,
- int maxTransactionBytes = 4096,
- bool readInterleavingDisabled = false,
- 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.');
}
}