CreditConservationChecker constructor
- String name,
- Component? parent, {
- required Logic clk,
- required Logic reset,
- required List<
Logic> available, - required List<
Logic> forwardInFlight, - required List<
Logic> receiverOccupied, - required List<
Logic> returnsInFlight, - required List<
int> provisioned, - String endpoint = 'creditPath',
- bool reportViolations = true,
Creates an end-to-end conservation checker.
Implementation
CreditConservationChecker(super.name, super.parent,
{required this.clk,
required this.reset,
required List<Logic> available,
required List<Logic> forwardInFlight,
required List<Logic> receiverOccupied,
required List<Logic> returnsInFlight,
required List<int> provisioned,
this.endpoint = 'creditPath',
this.reportViolations = true})
: available = List.unmodifiable(available),
forwardInFlight = List.unmodifiable(forwardInFlight),
receiverOccupied = List.unmodifiable(receiverOccupied),
returnsInFlight = List.unmodifiable(returnsInFlight),
provisioned = List.unmodifiable(provisioned) {
final lengths = {
this.available.length,
this.forwardInFlight.length,
this.receiverOccupied.length,
this.returnsInFlight.length,
this.provisioned.length,
};
if (lengths.length != 1 || this.provisioned.isEmpty) {
throw ArgumentError(
'Every conservation term must contain one signal per pool.');
}
if (this.provisioned.any((capacity) => capacity < 0)) {
throw ArgumentError('Provisioned capacities must not be negative.');
}
}