From 2345e42241948889ddf46074415c3377553f2027 Mon Sep 17 00:00:00 2001 From: "Pavel V. Shatov (Meister)" Date: Tue, 21 Jan 2020 00:03:52 +0300 Subject: Added more meaningful constants to avoid certain hardcoded numbers. --- rtl/modexpng_parameters.vh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'rtl') 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}; -- cgit v1.2.3