selectMemoryFunctor static method

SynchronousMemoryFunctor selectMemoryFunctor(
  1. MemoryConfiguration? configuration, {
  2. required int dataWidth,
  3. required int depth,
  4. required int memoryReadLatency,
  5. required SynchronousRamReadUnderWrite readUnderWrite,
})

Selects the backing memory for a stack of this shape.

configuration overrides the scoped memory configuration. A parent that names itself after the selected implementation can make the same selection the stack makes when it is given no explicit functor.

Implementation

static SynchronousMemoryFunctor selectMemoryFunctor(
  MemoryConfiguration? configuration, {
  required int dataWidth,
  required int depth,
  required int memoryReadLatency,
  required SynchronousRamReadUnderWrite readUnderWrite,
}) {
  final request = SynchronousMemoryRequest(
    dataWidth: dataWidth,
    addrWidth: max(1, depth.log2Ceil),
    entryCount: depth,
    writePortCount: 1,
    readPortCount: 1,
    maskedWritePorts: const [false],
    readLatency: memoryReadLatency,
    readUnderWrite: readUnderWrite,
  );
  return resolveMemoryConfiguration(configuration).selectFunctor(request);
}