createModule method

  1. @override
Module createModule()
override

Creates a Module instance as configured.

Implementation

@override
Module createModule() {
  final dataWidth = max(1, dataWidthKnob.value);
  final tagWidth = max(1, tagWidthKnob.value);
  final wakeupLaneCount = max(1, wakeupLaneCountKnob.value);
  DependencyOperand<Logic> operand(String name) =>
      DependencyOperand(Logic(name: name, width: dataWidth),
          tagWidth: tagWidth);
  return DependencyTracker<Logic>(
    clk: Logic(name: 'clk'),
    reset: Logic(name: 'reset'),
    load: ReadyAndValidInterface<DependencyOperand<Logic>>(
        operand('load_operand')),
    wakeups: [
      for (var lane = 0; lane < wakeupLaneCount; lane++)
        ReadyAndValidInterface<WakeupEvent<Logic>>(WakeupEvent(
            Logic(name: 'wakeup_${lane}_data', width: dataWidth),
            tagWidth: tagWidth))
    ],
    invalidation: ReadyAndValidInterface<WakeupInvalidation>(
        WakeupInvalidation(tagWidth: tagWidth)),
  );
}