diff options
author | Joachim StroĢmbergson <joachim@secworks.se> | 2018-09-04 15:01:17 +0200 |
---|---|---|
committer | Joachim StroĢmbergson <joachim@secworks.se> | 2018-09-04 15:01:17 +0200 |
commit | ef8a8eae18b6cd4aae7c19940a1d9be389f8952e (patch) | |
tree | 0365ce79294c743d534c270713a67acce90f8531 /src/rtl | |
parent | 2fb042d7158d4bd5315ef7b716334a7f45aa0928 (diff) |
Updated rtl and tb to support parameterized memory size.
Diffstat (limited to 'src/rtl')
-rw-r--r-- | src/rtl/keywrap.v | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/rtl/keywrap.v b/src/rtl/keywrap.v index dc18d92..f8fcbd7 100644 --- a/src/rtl/keywrap.v +++ b/src/rtl/keywrap.v @@ -48,7 +48,7 @@ // //====================================================================== -module keywrap #(parameter ADDR_BITS = 15) +module keywrap #(parameter ADDR_BITS = 13) ( input wire clk, input wire reset_n, @@ -94,15 +94,12 @@ module keywrap #(parameter ADDR_BITS = 15) localparam ADDR_KEY6 = 8'h16; localparam ADDR_KEY7 = 8'h17; - localparam ADDR_R_DATA0 = 8'h80; - localparam ADDR_R_DATA127 = 8'hff; - localparam CORE_NAME0 = 32'h6b657920; // "key " localparam CORE_NAME1 = 32'h77726170; // "wrap" localparam CORE_VERSION = 32'h302e3830; // "0.80" - localparam MEM_BITS = ADDR_BITS - 1; + localparam RLEN_BITS = ADDR_BITS - 2; localparam PAD = ADDR_BITS - 8; @@ -119,8 +116,8 @@ module keywrap #(parameter ADDR_BITS = 15) reg keylen_reg; reg config_we; - reg [12 : 0] rlen_reg; - reg rlen_we; + reg [(RLEN_BITS - 1) : 0] rlen_reg; + reg rlen_we; reg [31 : 0] a0_reg; reg a0_we; @@ -214,7 +211,7 @@ module keywrap #(parameter ADDR_BITS = 15) next_reg <= 1'h0; encdec_reg <= 1'h0; keylen_reg <= 1'h0; - rlen_reg <= 13'h0; + rlen_reg <= {RLEN_BITS{1'h0}}; valid_reg <= 1'h0; ready_reg <= 1'h0; a0_reg <= 32'h0; |