createModule method

  1. @override
Module createModule()
override

Creates a Module instance as configured.

Implementation

@override
Module createModule() {
  final indexWidth = max(1, entryCountKnob.value.log2Ceil);
  return general.ParallelAssociativeMemory<Logic>(
    clk: Logic(name: 'clk'),
    reset: Logic(name: 'reset'),
    updatePorts: [
      for (var i = 0; i < updateCountKnob.value; i++)
        TypedAssociativeUpdatePortInterface(Logic(width: keyWidthKnob.value),
            indexWidth: indexWidth),
    ],
    lookupPorts: [
      for (var i = 0; i < lookupCountKnob.value; i++)
        TypedAssociativeLookupPortInterface(Logic(width: keyWidthKnob.value),
            indexWidth: indexWidth),
    ],
    entryCount: entryCountKnob.value,
    contract: const AssociativeMemoryContract(
      lookupLatency: 0,
      updateLatency: 0,
      duplicateKeyPolicy: AssociativeDuplicateKeyPolicy.allow,
      matchSelection: AssociativeMatchSelection.lowestIndex,
      resultShape: AssociativeResultShape.selectedIndex,
      lookupUpdatePolicy: AssociativeLookupUpdatePolicy.lookupAfterUpdate,
      updateCollisionPolicy: AssociativeUpdateCollisionPolicy.highestPortWins,
      resetBehavior: AssociativeMemoryResetBehavior.clearValidity,
      implementationKind: AssociativeMemoryImplementationKind.synthesizable,
    ),
    enableValidTracking: validTrackingKnob.value,
  );
}