Axi4MainAgent constructor

Axi4MainAgent({
  1. required Axi4SystemInterface sIntf,
  2. required List<Axi4Channel> channels,
  3. required Component parent,
  4. String name = 'axiMainAgent',
  5. int timeoutCycles = 500,
  6. int dropDelayCycles = 30,
})

Constructs a new Axi4MainAgent.

Implementation

Axi4MainAgent({
  required this.sIntf,
  required this.channels,
  required Component parent,
  String name = 'axiMainAgent',
  this.timeoutCycles = 500,
  this.dropDelayCycles = 30,
}) : super(name, parent) {
  final idMap = <int, bool>{};
  for (var i = 0; i < channels.length; i++) {
    if (idMap.containsKey(channels[i].channelId)) {
      throw RohdHclException('Channel ID ${channels[i].channelId} is not '
          'unique across all channels.');
    }
    idMap[channels[i].channelId] = true;

    if (channels[i].hasRead) {
      rdAgents.add(Axi4ReadAgent(
          sIntf: sIntf,
          channel: channels[i],
          parent: parent,
          name: 'axi4RdAgent_$i'));
      _readAddrToChannel[i] = rdAgents.length - 1;
    }
    if (channels[i].hasWrite) {
      wrAgents.add(Axi4WriteAgent(
          sIntf: sIntf,
          channel: channels[i],
          parent: parent,
          name: 'axi4WrAgent_$i'));
      _writeAddrToChannel[i] = wrAgents.length - 1;
    }
  }
}