aboutsummaryrefslogtreecommitdiff
path: root/src/rtl/keywrap.v
diff options
context:
space:
mode:
Diffstat (limited to 'src/rtl/keywrap.v')
-rw-r--r--src/rtl/keywrap.v13
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;