aboutsummaryrefslogtreecommitdiff
path: root/rtl
diff options
context:
space:
mode:
authorPavel V. Shatov (Meister) <meisterpaul1@yandex.ru>2020-01-21 00:03:52 +0300
committerPavel V. Shatov (Meister) <meisterpaul1@yandex.ru>2020-01-21 00:03:52 +0300
commit2345e42241948889ddf46074415c3377553f2027 (patch)
treeafbf3a7ad6b9c46829a63230b10b4131d86885a4 /rtl
parent8f7829ce5e37728ddc51b4aaa735b9e04a5eca01 (diff)
Added more meaningful constants to avoid certain hardcoded numbers.
Diffstat (limited to 'rtl')
-rw-r--r--rtl/modexpng_parameters.vh10
1 files changed, 9 insertions, 1 deletions
diff --git a/rtl/modexpng_parameters.vh b/rtl/modexpng_parameters.vh
index 1718e00..77230fe 100644
--- a/rtl/modexpng_parameters.vh
+++ b/rtl/modexpng_parameters.vh
@@ -55,8 +55,8 @@ localparam BUS_OP_ADDR_W = cryptech_clog2(MAX_OP_W / BUS_DATA_W);
localparam BIT_INDEX_W = cryptech_clog2(MAX_OP_W);
localparam BANK_ADDR_W = 3;
localparam OP_ADDR_W = cryptech_clog2(MAX_OP_W / WORD_W);
-localparam COL_INDEX_W = OP_ADDR_W - cryptech_clog2(NUM_MULTS);
localparam MAC_INDEX_W = cryptech_clog2(NUM_MULTS);
+localparam COL_INDEX_W = OP_ADDR_W - MAC_INDEX_W;
localparam CARRY_W = WORD_EXT_W - WORD_W;
localparam WORD_MUX_W = cryptech_clog2(WORD_W);
@@ -140,6 +140,7 @@ localparam [OP_ADDR_W-1:0] OP_ADDR_EXT_COEFF = 0;
localparam [OP_ADDR_W-1:0] OP_ADDR_EXT_Q = 1;
localparam [OP_ADDR_W-1:0] OP_ADDR_ZERO = {OP_ADDR_W{1'b0}};
localparam [OP_ADDR_W-1:0] OP_ADDR_ONE = {{(OP_ADDR_W-1){1'b0}}, 1'b1};
+localparam [OP_ADDR_W-1:0] OP_ADDR_TWO = {OP_ADDR_ONE[OP_ADDR_W-2:0], 1'b0};
localparam [OP_ADDR_W-1:0] OP_ADDR_DNC = {OP_ADDR_W{1'bX}};
//
@@ -170,3 +171,10 @@ localparam [MAC_INDEX_W-1:0] MAC_INDEX_DNC = {MAC_INDEX_W{1'bX}};
// Multiplier Bitmap Values
//
localparam [NUM_MULTS-1:0] MULT_BITMAP_ZEROES = {NUM_MULTS{1'b0}};
+
+
+//
+// Column Index Values
+//
+localparam [COL_INDEX_W-1:0] COL_INDEX_ZERO = {COL_INDEX_W{1'b0}};
+localparam [COL_INDEX_W-1:0] COL_INDEX_ONE = {{(COL_INDEX_W-1){1'b0}}, 1'b1};