Axi4SubordinateMemoryAgent constructor

Axi4SubordinateMemoryAgent({
  1. required Axi4SystemInterface sIntf,
  2. required List<Axi4SubordinateClusterAgent> lanes,
  3. required Component parent,
  4. MemoryStorage? storage,
  5. int readResponseDelay(
    1. Axi4RequestPacket request
    )?,
  6. int writeResponseDelay(
    1. Axi4RequestPacket request
    )?,
  7. bool respondWithError(
    1. Axi4RequestPacket request
    )?,
  8. bool invalidReadDataOnError = true,
  9. bool dropWriteDataOnError = true,
  10. List<AxiAddressRange> ranges = const [],
  11. bool supportLocking = false,
  12. String name = 'axi4SubordinateMemoryAgent',
})

Creates a new model Axi4SubordinateMemoryAgent.

If no storage is provided, it will use a default SparseMemoryStorage.

Implementation

Axi4SubordinateMemoryAgent(
    {required this.sIntf,
    required this.lanes,
    required Component parent,
    MemoryStorage? storage,
    this.readResponseDelay,
    this.writeResponseDelay,
    this.respondWithError,
    this.invalidReadDataOnError = true,
    this.dropWriteDataOnError = true,
    this.ranges = const [],
    this.supportLocking = false,
    String name = 'axi4SubordinateMemoryAgent'})
    : super(name, parent) {
  var maxAddrWidth = 0;
  var maxDataWidth = 0;
  for (var i = 0; i < lanes.length; i++) {
    maxAddrWidth = max(maxAddrWidth, lanes[i].arIntf.addrWidth);
    maxDataWidth = max(maxDataWidth, lanes[i].rIntf.dataWidth);
  }

  this.storage = storage ??
      SparseMemoryStorage(
        addrWidth: maxAddrWidth,
        dataWidth: maxDataWidth,
      );
  for (var i = 0; i < lanes.length; i++) {
    // read side handling
    _dataReadResponseMetadataQueue.add([]);
    _dataReadResponseDataQueue.add([]);
    // _dataReadResponseErrorQueue.add([]);
    _dataReadResponseIndex.add(0);
    _readAddrToChannel[i] = _dataReadResponseMetadataQueue.length - 1;

    // write side handling
    _writeMetadataQueue.add([]);
    _writeDataQueue.add([]);
    _writeReadyToOccur.add(false);
    _writeAddrToChannel[i] = _writeMetadataQueue.length - 1;
  }
}