createModule method

  1. @override
Module createModule()
override

Creates a Module instance as configured.

Implementation

@override
Module createModule() {
  final capacity = max(1, capacityKnob.value);
  final indexWidth = max(1, capacity.log2Ceil);
  if (boundaryKnob.value == ConfiguratorBoundary.actions) {
    return MemoryIndexAllocator(
      clk: Logic(name: 'clk'),
      reset: Logic(name: 'reset'),
      allocate: Logic(name: 'allocate'),
      release: Logic(name: 'release'),
      releaseIndex: Logic(name: 'releaseIndex', width: indexWidth),
      capacity: capacity,
      memoryFunctor: synchronousRegisterFileFunctor,
    );
  }
  return ReadyValidMemoryIndexAllocator(
    clk: Logic(name: 'clk'),
    reset: Logic(name: 'reset'),
    allocation: ReadyAndValidInterface<Logic>(
        Logic(name: 'allocation', width: indexWidth)),
    release:
        ReadyAndValidInterface<TagRelease>(TagRelease(tagWidth: indexWidth)),
    capacity: capacity,
    memoryFunctor: synchronousRegisterFileFunctor,
  );
}