createModule method

  1. @override
Module createModule()
override

Creates a Module instance as configured.

Implementation

@override
Module createModule() {
  final word =
      elementKnob.array(lanesKnob.value, unpacked: unpackedKnob.value);
  return TensorDmaEngine(
    clk: Logic(),
    reset: Logic(),
    command: ReadyValidInterface(TensorDmaCommand(
        sourceAddressWidth: addressWidthKnob.value,
        destinationAddressWidth: destinationAddressWidthKnob.value,
        mWidth: mWidthKnob.value,
        nWidth: nWidthKnob.value,
        kWidth: kWidthKnob.value,
        commandIdWidth: commandIdWidthKnob.value)),
    sourceReadRequest: ReadyValidInterface(TensorScratchpadReadRequest(
        addressWidth: addressWidthKnob.value, tagWidth: tagWidthKnob.value)),
    sourceReadResponse: ReadyValidInterface(TensorScratchpadReadResponse(
        data: word, tagWidth: tagWidthKnob.value)),
    destinationWriteRequest: ReadyValidInterface(TensorScratchpadWriteRequest(
        data: word, addressWidth: destinationAddressWidthKnob.value)),
    completion: ReadyValidInterface(TensorDmaCompletion(
        commandIdWidth: commandIdWidthKnob.value,
        countWidth: tensorDmaCountWidth(
            mWidth: mWidthKnob.value,
            nWidth: nWidthKnob.value,
            kWidth: kWidthKnob.value))),
    sourceDepth: sourceDepthKnob.value,
    destinationDepth: destinationDepthKnob.value,
    counterWidth: counterWidthKnob.value,
    clearCounters: clearCountersKnob.value ? Logic() : null,
  );
}