CacheBackingPorts<T extends Logic, M extends Logic> constructor

CacheBackingPorts<T extends Logic, M extends Logic>({
  1. required int addrWidth,
  2. required T dataSchema,
  3. required M lineMetadataSchema,
  4. int readLatency = 1,
})

Creates read and write ports for blocks shaped by the given schemas.

Implementation

CacheBackingPorts({
  required int addrWidth,
  required T dataSchema,
  required M lineMetadataSchema,
  this.readLatency = 1,
})  : read = DataPortInterface.typed(
          CacheBackingLine(
              dataSchema: dataSchema, lineMetadataSchema: lineMetadataSchema),
          addrWidth),
      write = DataPortInterface.typed(
          CacheBackingLine(
              dataSchema: dataSchema, lineMetadataSchema: lineMetadataSchema),
          addrWidth) {
  if (readLatency < 0) {
    throw ArgumentError.value(
        readLatency, 'readLatency', 'Must not be negative.');
  }
}