diff options
author | Joachim StroĢmbergson <joachim@secworks.se> | 2018-07-05 15:58:51 +0200 |
---|---|---|
committer | Joachim StroĢmbergson <joachim@secworks.se> | 2018-07-05 15:58:51 +0200 |
commit | f4ac53ac5e0885021fa7ae40f72a61846682ce41 (patch) | |
tree | 16394fc89b0991946353686f7e009ed35367cac6 | |
parent | 96463cb7129b5998abe02e9a62b9094dff6b3a74 (diff) |
Adding wait state to allow access from memory to complete. Should be possible to optimize.
-rw-r--r-- | src/rtl/keywrap_core.v | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/rtl/keywrap_core.v b/src/rtl/keywrap_core.v index a8e6d73..1f180c9 100644 --- a/src/rtl/keywrap_core.v +++ b/src/rtl/keywrap_core.v @@ -75,8 +75,8 @@ module keywrap_core ( localparam CTRL_INIT_WAIT = 4'h1; localparam CTRL_NEXT_WSTART = 4'h2; localparam CTRL_NEXT_USTART = 4'h3; - localparam CTRL_NEXT_LOOP = 4'h4; - localparam CTRL_NEXT_WAIT0 = 4'h5; + localparam CTRL_NEXT_LOOP0 = 4'h4; + localparam CTRL_NEXT_LOOP = 4'h5; localparam CTRL_NEXT_WAIT = 4'h6; localparam CTRL_NEXT_UPDATE = 4'h7; localparam CTRL_NEXT_WCHECK = 4'h8; @@ -405,7 +405,7 @@ module keywrap_core ( begin block_ctr_rst = 1'h1; iteration_ctr_rst = 1'h1; - keywrap_core_ctrl_new = CTRL_NEXT_LOOP; + keywrap_core_ctrl_new = CTRL_NEXT_LOOP0; keywrap_core_ctrl_we = 1'h1; end @@ -414,21 +414,21 @@ module keywrap_core ( begin block_ctr_set = 1'h1; iteration_ctr_set = 1'h1; - keywrap_core_ctrl_new = CTRL_NEXT_LOOP; + keywrap_core_ctrl_new = CTRL_NEXT_LOOP0; keywrap_core_ctrl_we = 1'h1; end - CTRL_NEXT_LOOP: + CTRL_NEXT_LOOP0: begin - aes_next = 1'h1; - keywrap_core_ctrl_new = CTRL_NEXT_WAIT; + keywrap_core_ctrl_new = CTRL_NEXT_LOOP; keywrap_core_ctrl_we = 1'h1; end - CTRL_NEXT_WAIT0: + CTRL_NEXT_LOOP: begin + aes_next = 1'h1; keywrap_core_ctrl_new = CTRL_NEXT_WAIT; keywrap_core_ctrl_we = 1'h1; end @@ -461,7 +461,7 @@ module keywrap_core ( if (block_ctr_reg < rlen) begin block_ctr_inc = 1'h1; - keywrap_core_ctrl_new = CTRL_NEXT_LOOP; + keywrap_core_ctrl_new = CTRL_NEXT_LOOP0; keywrap_core_ctrl_we = 1'h1; end @@ -469,7 +469,7 @@ module keywrap_core ( begin block_ctr_rst = 1'h1; iteration_ctr_inc = 1'h1; - keywrap_core_ctrl_new = CTRL_NEXT_LOOP; + keywrap_core_ctrl_new = CTRL_NEXT_LOOP0; keywrap_core_ctrl_we = 1'h1; end |