Axi5CreditDriver constructor

Axi5CreditDriver({
  1. required Component parent,
  2. required Axi5SystemInterface sys,
  3. required Axi5TransportInterface trans,
  4. List<int>? creditsPerResourcePlane,
  5. int? sharedCreditCount,
  6. num returnFrequency = 1.0,
  7. String name = 'axi5CreditDriver',
})

Creates a credited receiver with one slot per pool by default.

Implementation

Axi5CreditDriver({
  required Component parent,
  required this.sys,
  required this.trans,
  List<int>? creditsPerResourcePlane,
  int? sharedCreditCount,
  this.returnFrequency = 1.0,
  String name = 'axi5CreditDriver',
})  : creditsPerResourcePlane = List.unmodifiable(
          creditsPerResourcePlane ?? List.filled(trans.numRp, 1)),
      sharedCreditCount = sharedCreditCount ?? (trans.sharedCredits ? 1 : 0),
      super(name, parent) {
  if (!trans.useCrediting ||
      this.creditsPerResourcePlane.length != trans.numRp ||
      this.creditsPerResourcePlane.any((count) =>
          count < 1 || count > Axi5TransportInterface.maxCreditsPerPool) ||
      this.sharedCreditCount < 0 ||
      this.sharedCreditCount > Axi5TransportInterface.maxCreditsPerPool ||
      (!trans.sharedCredits && this.sharedCreditCount != 0) ||
      !returnFrequency.isFinite ||
      returnFrequency < 0 ||
      returnFrequency > 1) {
    throw ArgumentError('Invalid AXI credited receiver configuration.');
  }
  final flow = trans.creditFlow!;
  checker = CreditChannelChecker('creditChecker', this,
      clk: sys.clk,
      reset: ~sys.resetN,
      debit: flow.debit,
      creditReturn: flow.creditReturn,
      configuration: CreditChannelCheckConfiguration.uniform(
          poolCount: flow.poolCount,
          initialCredits: 0,
          maximumCredits: Axi5TransportInterface.maxCreditsPerPool));
}