createModule method

  1. @override
Module createModule()
override

Creates a Module instance as configured.

Implementation

@override
Module createModule() {
  final entryCount = max(1, entryCountKnob.value);
  final keyWidth = max(1, keyWidthKnob.value);
  final indexWidth = scheduledAssociativeIndexWidth(entryCount);
  if (boundaryKnob.value == ConfiguratorBoundary.readyValid) {
    return ReadyValidSramScanAssociativeMemory(
      clk: Logic(name: 'clk'),
      reset: Logic(name: 'reset'),
      lookupRequest:
          ReadyValidInterface(AssociativeLookupRequest(keyWidth: keyWidth)),
      updateRequest: ReadyValidInterface(AssociativeUpdateRequest(
          keyWidth: keyWidth, indexWidth: indexWidth)),
      lookupResponse: IrrevocableReadyValidInterface(
          AssociativeLookupResponse(
              indexWidth: indexWidth, entryCount: entryCount)),
      entryCount: entryCount,
      readLatency: max(1, readLatencyKnob.value),
      matchSelection: selectionKnob.value,
      memoryFunctor: synchronousRegisterFileFunctor,
    );
  }
  return SramScanAssociativeMemory(
    clk: Logic(name: 'clk'),
    reset: Logic(name: 'reset'),
    update: Logic(name: 'update'),
    updateRequest:
        AssociativeUpdateRequest(keyWidth: keyWidth, indexWidth: indexWidth),
    lookup: Logic(name: 'lookup'),
    lookupRequest: AssociativeLookupRequest(keyWidth: keyWidth),
    consumeResponse: _consumeControl(retainResultsKnob, 'consumeResponse'),
    entryCount: entryCount,
    readLatency: max(1, readLatencyKnob.value),
    matchSelection: selectionKnob.value,
    memoryFunctor: synchronousRegisterFileFunctor,
  );
}