From 274862150052b4e62de20a52519a517ef1f9a3ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Thu, 5 Jul 2018 10:24:58 +0200 Subject: Debugged keywrap processing including A update. All AES operations works correctly. Now we just need to stop processing whe we should. --- src/rtl/keywrap_core.v | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/rtl/keywrap_core.v') diff --git a/src/rtl/keywrap_core.v b/src/rtl/keywrap_core.v index 07a079b..bb7cc09 100644 --- a/src/rtl/keywrap_core.v +++ b/src/rtl/keywrap_core.v @@ -134,6 +134,7 @@ module keywrap_core ( reg update_state; reg core_we; + reg [12 : 0] core_addr; reg [63 : 0] core_wr_data; wire [63 : 0] core_rd_data; @@ -150,7 +151,7 @@ module keywrap_core ( .api_rd_data(api_rd_data), .core_we(core_we), - .core_addr(block_ctr_reg), + .core_addr(core_addr), .core_wr_data(core_wr_data), .core_rd_data(core_rd_data) ); @@ -230,8 +231,9 @@ module keywrap_core ( begin : keywrap_dp reg [63 : 0] xor_val; - a_new = 64'h0; - a_we = 1'h0; + a_new = 64'h0; + a_we = 1'h0; + core_addr = block_ctr_reg - 1'h1; core_we = 1'h0; aes_block = {a_reg, core_rd_data}; @@ -258,12 +260,12 @@ module keywrap_core ( //---------------------------------------------------------------- always @* begin : block_ctr - block_ctr_new = 13'h0; + block_ctr_new = 13'h1; block_ctr_we = 1'h0; if (block_ctr_rst) begin - block_ctr_new = 13'h0; + block_ctr_new = 13'h1; block_ctr_we = 1'h1; end -- cgit v1.2.3