CreditFlowControl constructor

CreditFlowControl({
  1. required Logic valid,
  2. required Logic creditReturn,
  3. Logic? pool,
})

Views existing credit-control signals.

Implementation

CreditFlowControl({
  required this.valid,
  required this.creditReturn,
  this.pool,
}) {
  if (valid.width != 1 ||
      poolCount < 1 ||
      (poolCount > 1 && pool == null) ||
      (pool != null && pool!.width < poolCount.log2Ceil)) {
    throw ArgumentError(
        'Credit flow requires a one-bit valid and a selector wide enough '
        'for every returned-credit pool.');
  }
}