From affada8d5da7426d22035360c3674ab3b3311ab5 Mon Sep 17 00:00:00 2001 From: "Pavel V. Shatov (Meister)" Date: Thu, 3 Oct 2019 16:40:25 +0300 Subject: Reworked storage architecture (moved I/O memory to a separate module, since there's only one instance of input/output values, while storage manager has dual storage space for P and Q multipliers). Started working on microcoded layer, added input operation and modular multiplication. --- rtl/modexpng_parameters.vh | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) (limited to 'rtl/modexpng_parameters.vh') diff --git a/rtl/modexpng_parameters.vh b/rtl/modexpng_parameters.vh index 6d63735..25fafb4 100644 --- a/rtl/modexpng_parameters.vh +++ b/rtl/modexpng_parameters.vh @@ -14,14 +14,16 @@ function integer cryptech_clog2; // endfunction +localparam MAX_OP_W = 4096; + localparam WORD_W = 16; localparam WORD_EXT_W = 18; localparam MAC_W = 47; -localparam BUS_DATA_W = 32; +localparam BUS_DATA_W = 32; localparam BUS_OP_ADDR_W = cryptech_clog2(MAX_OP_W / BUS_DATA_W); -localparam MAX_OP_W = 4096; + localparam BANK_ADDR_W = 3; localparam OP_ADDR_W = cryptech_clog2(MAX_OP_W / WORD_W); @@ -55,20 +57,41 @@ localparam [BANK_ADDR_W-1:0] BANK_RCMB_ML = 3'd0; localparam [BANK_ADDR_W-1:0] BANK_RCMB_MH = 3'd1; localparam [BANK_ADDR_W-1:0] BANK_RCMB_EXT = 3'd2; // [0] -> MH' -localparam [BANK_ADDR_W-1:0] BANK_DONT_CARE = {BANK_ADDR_W{1'bX}}; +localparam [BANK_ADDR_W-1:0] BANK_IN_1_M = 3'd0; +localparam [BANK_ADDR_W-1:0] BANK_IN_1_N = 3'd1; +localparam [BANK_ADDR_W-1:0] BANK_IN_1_N_FACTOR = 3'd2; +localparam [BANK_ADDR_W-1:0] BANK_IN_1_N_COEFF = 3'd3;/* +localparam [BANK_ADDR_W-1:0] BANK_IN_1_EXT = 3'd4; // [0] -> N_COEFF'*/ +localparam [BANK_ADDR_W-1:0] BANK_IN_1_X = 3'd5; +localparam [BANK_ADDR_W-1:0] BANK_IN_1_Y = 3'd6; + +localparam [BANK_ADDR_W-1:0] BANK_IN_2_D = 3'd0; +localparam [BANK_ADDR_W-1:0] BANK_IN_2_P = 3'd1; +localparam [BANK_ADDR_W-1:0] BANK_IN_2_P_FACTOR = 3'd2; +localparam [BANK_ADDR_W-1:0] BANK_IN_2_P_COEFF = 3'd3; +localparam [BANK_ADDR_W-1:0] BANK_IN_2_Q = 3'd4; +localparam [BANK_ADDR_W-1:0] BANK_IN_2_Q_FACTOR = 3'd5; +localparam [BANK_ADDR_W-1:0] BANK_IN_2_Q_COEFF = 3'd6; +localparam [BANK_ADDR_W-1:0] BANK_IN_2_QINV = 3'd7; + +localparam [BANK_ADDR_W-1:0] BANK_OUT_S = 3'd0; +localparam [BANK_ADDR_W-1:0] BANK_OUT_XM = 3'd1; +localparam [BANK_ADDR_W-1:0] BANK_OUT_YM = 3'd2; + +localparam [BANK_ADDR_W-1:0] BANK_DNC = {BANK_ADDR_W{1'bX}}; 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_DONT_CARE = {OP_ADDR_W{1'bX}}; +localparam [OP_ADDR_W-1:0] OP_ADDR_DNC = {OP_ADDR_W{1'bX}}; localparam [WORD_W-1:0] WORD_NULL = {WORD_W{1'b0}}; localparam [WORD_EXT_W-1:0] WORD_EXT_NULL = {WORD_EXT_W{1'b0}}; -localparam [WORD_EXT_W-1:0] WORD_EXT_DONT_CARE = {WORD_EXT_W{1'bX}}; +localparam [WORD_EXT_W-1:0] WORD_EXT_DNC = {WORD_EXT_W{1'bX}}; -localparam [MAC_INDEX_W-1:0] MAC_INDEX_DONT_CARE = {MAC_INDEX_W{1'bX}}; +localparam [MAC_INDEX_W-1:0] MAC_INDEX_DNC = {MAC_INDEX_W{1'bX}}; -localparam [NUM_MULTS-1:0] MULT_BITMAP_ZEROES = {NUM_MULTS{1'b0}}; \ No newline at end of file +localparam [NUM_MULTS-1:0] MULT_BITMAP_ZEROES = {NUM_MULTS{1'b0}}; -- cgit v1.2.3