From e7aa2b3d029e617f1461343770358e67f3febd32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Thu, 5 Jul 2018 13:23:10 +0200 Subject: Removed a few states and a few cycles. --- src/rtl/keywrap_core.v | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'src/rtl') diff --git a/src/rtl/keywrap_core.v b/src/rtl/keywrap_core.v index 0788024..28e8f74 100644 --- a/src/rtl/keywrap_core.v +++ b/src/rtl/keywrap_core.v @@ -72,17 +72,13 @@ module keywrap_core ( localparam OUTER_LOOP_MAX = 6 - 1; localparam CTRL_IDLE = 4'h0; - - localparam CTRL_INIT_START = 4'h1; - localparam CTRL_INIT_WAIT = 4'h2; - - localparam CTRL_NEXT_START = 4'h4; - localparam CTRL_NEXT_LOOP = 4'h5; - localparam CTRL_NEXT_WAIT0 = 4'h6; - localparam CTRL_NEXT_WAIT = 4'h7; - localparam CTRL_NEXT_UPDATE = 4'h9; - localparam CTRL_NEXT_CHECK = 4'ha; - localparam CTRL_NEXT_FINALIZE = 4'hb; + localparam CTRL_INIT_WAIT = 4'h1; + localparam CTRL_NEXT_LOOP = 4'h2; + localparam CTRL_NEXT_WAIT0 = 4'h3; + localparam CTRL_NEXT_WAIT = 4'h4; + localparam CTRL_NEXT_UPDATE = 4'h5; + localparam CTRL_NEXT_CHECK = 4'h6; + localparam CTRL_NEXT_FINALIZE = 4'h7; //---------------------------------------------------------------- @@ -339,36 +335,29 @@ module keywrap_core ( begin if (init) begin + aes_init = 1'h1; ready_new = 1'h0; ready_we = 1'h1; valid_new = 1'h0; valid_we = 1'h1; - keywrap_core_ctrl_new = CTRL_INIT_START; + keywrap_core_ctrl_new = CTRL_INIT_WAIT; keywrap_core_ctrl_we = 1'h1; end if (next) begin + block_ctr_rst = 1'h1; + iteration_ctr_rst = 1'h1; ready_new = 1'h0; ready_we = 1'h1; valid_new = 1'h0; valid_we = 1'h1; init_a = 1'h1; - block_ctr_rst = 1'h1; - iteration_ctr_rst = 1'h1; keywrap_core_ctrl_new = CTRL_NEXT_LOOP; keywrap_core_ctrl_we = 1'h1; end end - - CTRL_INIT_START: - begin - aes_init = 1'h1; - keywrap_core_ctrl_new = CTRL_INIT_WAIT; - keywrap_core_ctrl_we = 1'h1; - end - CTRL_INIT_WAIT: begin if (aes_ready) -- cgit v1.2.3