From 8ee5a19240722f397d55f57a426992350f8019a3 Mon Sep 17 00:00:00 2001 From: "Pavel V. Shatov (Meister)" Date: Thu, 3 Oct 2019 16:42:24 +0300 Subject: Expanded micro-operation parameters (added dedicated control bit to force the B input of the modular multiplier to 1, this is necessary to bring numbers out of Montgomery domain). --- rtl/modexpng_microcode.vh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'rtl/modexpng_microcode.vh') diff --git a/rtl/modexpng_microcode.vh b/rtl/modexpng_microcode.vh index af21391..1465c48 100644 --- a/rtl/modexpng_microcode.vh +++ b/rtl/modexpng_microcode.vh @@ -17,15 +17,30 @@ localparam UOP_W = UOP_OPCODE_W + UOP_CRT_W + UOP_NPQ_W + UOP_AUX_W + UOP_LADDER // OPCODE localparam [UOP_OPCODE_W -1:0] UOP_OPCODE_STOP = 4'd0; +/* all fields are don't care + */ localparam [UOP_OPCODE_W -1:0] UOP_OPCODE_INPUT_TO_WIDE = 4'd1; localparam [UOP_OPCODE_W -1:0] UOP_OPCODE_INPUT_TO_NARROW = 4'd2; +/* CRT tells into which of the dual MMM to write + * NPQ specifies the width of the operand + * AUX specifies from which INPUT to read + * LADDER is don't care + * source WIDE is always don't care + * destination NARROW is don't care for _WIDE opcode and vice versa + * +*/ localparam [UOP_OPCODE_W -1:0] UOP_OPCODE_OUTPUT_FROM_NARROW = 4'd3; //localparam [UOP_OPCODE_W -1:0] UOP_OPCODE_COPY_CRT_Y2X = 4'd0; localparam [UOP_OPCODE_W -1:0] UOP_OPCODE_MODULAR_MULTIPLY = 4'd8; +/* CRT is don't care + * NPQ specifies the width of the operand + * AUX = AUX_2 forces B input to 1 (AUX_1 reads from source NARROW as usual) + * LADDER specifies Montgomery ladder mode + */ // CRT localparam [UOP_CRT_W -1:0] UOP_CRT_X = 1'b0; -- cgit v1.2.3