aboutsummaryrefslogtreecommitdiff
path: root/rtl/modexpng_microcode.vh
diff options
context:
space:
mode:
authorPavel V. Shatov (Meister) <meisterpaul1@yandex.ru>2019-10-03 16:42:24 +0300
committerPavel V. Shatov (Meister) <meisterpaul1@yandex.ru>2019-10-03 16:42:24 +0300
commit8ee5a19240722f397d55f57a426992350f8019a3 (patch)
treee13a9cf1559ea4c65214119373188e17313d8b57 /rtl/modexpng_microcode.vh
parentaffada8d5da7426d22035360c3674ab3b3311ab5 (diff)
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).
Diffstat (limited to 'rtl/modexpng_microcode.vh')
-rw-r--r--rtl/modexpng_microcode.vh15
1 files changed, 15 insertions, 0 deletions
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;