[Cryptech-Commits] [user/shatov/modexpng] 13/21: Added more meaningful constants to avoid certain hardcoded numbers.

git at cryptech.is git at cryptech.is
Mon Jan 20 21:18:14 UTC 2020


This is an automated email from the git hooks/post-receive script.

meisterpaul1 at yandex.ru pushed a commit to branch master
in repository user/shatov/modexpng.

commit 2345e42241948889ddf46074415c3377553f2027
Author: Pavel V. Shatov (Meister) <meisterpaul1 at yandex.ru>
AuthorDate: Tue Jan 21 00:03:52 2020 +0300

    Added more meaningful constants to avoid certain hardcoded numbers.
---
 rtl/modexpng_parameters.vh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

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};



More information about the Commits mailing list