diff options
author | Joachim StroĢmbergson <joachim@assured.se> | 2019-01-17 13:02:13 +0100 |
---|---|---|
committer | Joachim StroĢmbergson <joachim@assured.se> | 2019-01-17 13:02:13 +0100 |
commit | f7c9cd18767f30259a285c3fd20a0905bea2b2d4 (patch) | |
tree | 0944681fa91ab03994dff5a7b73358809994e3b1 /src | |
parent | 5827799dd22a582c304142e5fa63add4ca92b065 (diff) |
Added non-zero default timeout value in core. This fixes the keywrap problems by not automatically reset the key in the API. Enabled all testcases and disabled excessive debug outputs.
Diffstat (limited to 'src')
-rw-r--r-- | src/rtl/keywrap_core.v | 4 | ||||
-rw-r--r-- | src/tb/tb_keywrap.v | 28 |
2 files changed, 17 insertions, 15 deletions
diff --git a/src/rtl/keywrap_core.v b/src/rtl/keywrap_core.v index b084363..0354475 100644 --- a/src/rtl/keywrap_core.v +++ b/src/rtl/keywrap_core.v @@ -91,6 +91,8 @@ module keywrap_core #(parameter MEM_BITS = 11) localparam CTRL_NEXT_FINALIZE = 4'ha; localparam CTRL_ZERO_WAIT = 4'hb; + localparam DEFAULT_TIMEOUT = 32'h0400_0000; + //---------------------------------------------------------------- // Registers and memories including control signals. @@ -222,7 +224,7 @@ module keywrap_core #(parameter MEM_BITS = 11) key_loaded_reg <= 1'h0; block_ctr_reg <= {(MEM_BITS - 1){1'h0}}; iteration_ctr_reg <= 3'h0; - key_timeout_ctr_reg <= 32'h0; + key_timeout_ctr_reg <= DEFAULT_TIMEOUT; keywrap_core_ctrl_reg <= CTRL_IDLE; end diff --git a/src/tb/tb_keywrap.v b/src/tb/tb_keywrap.v index c900b2a..b232ab3 100644 --- a/src/tb/tb_keywrap.v +++ b/src/tb/tb_keywrap.v @@ -39,7 +39,7 @@ module tb_keywrap(); - parameter DEBUG = 1; + parameter DEBUG = 0; parameter DUMP_TOP = 1; parameter DUMP_CORE = 1; parameter DUMP_TIMEOUT = 1; @@ -299,17 +299,17 @@ module tb_keywrap(); $display("keywrap_core_ctrl_reg = 0x%0x", dut.core.keywrap_core_ctrl_reg); $display("keywrap_core_ctrl_new = 0x%0x", dut.core.keywrap_core_ctrl_new); $display("keywrap_core_ctrl_we = 0x%0x", dut.core.keywrap_core_ctrl_we); + $display(""); end if (DUMP_TIMEOUT) begin - $display("timeout signals:"); - + $display("timeout state:"); $display("api_timeout_reg = 0x%04x api_timeout_we = 0x%x", dut.timeout_reg, dut.timeout_we); - $display("timeout = 0x%04x ping = 0x%x zeroise = 0x%x loaded = 0x%x", - dut.core.timeout, dut.core.ping, dut.core.zeroise, dut.core.loaded); - $display("key_timeout_ctr_reg = 0x%04x key_timeout_ctr_new = 0x%04x", - dut.core.key_timeout_ctr_reg, dut.core.key_timeout_ctr_new); + $display("timeout_delay = 0x%04x timeout = 0x%x ping = 0x%x zeroise = 0x%x loaded = 0x%x", + dut.core.timeout_delay, dut.core.timeout, dut.core.ping, dut.core.zeroise, dut.core.loaded); + $display("key_timeout_ctr_reg = 0x%04x key_timeout_ctr_new = 0x%04x key_timeout_ctr_we = 0x%x", + dut.core.key_timeout_ctr_reg, dut.core.key_timeout_ctr_new, dut.core.key_timeout_ctr_we); $display("key_timeout = 0x%x key_timeout_ctr_we = 0x%x key_timeout_ctr_set = 0x%x key_timeout_ctr_dec = 0x%x", dut.core.key_timeout, dut.core.key_timeout_ctr_we, dut.core.key_timeout_ctr_set, dut.core.key_timeout_ctr_dec); @@ -1531,15 +1531,15 @@ module tb_keywrap(); test_core_access(); test_kwp_ae_128_1(); -// test_kwp_ad_128_1(); -// test_kwp_ae_128_2(); -// test_kwp_ad_128_2(); -// test_big_wrap_256(); + test_kwp_ad_128_1(); + test_kwp_ae_128_2(); + test_kwp_ad_128_2(); + test_big_wrap_256(); reset_dut(); -// test_zeroise1(); -// test_zeroise2(); -// test_zeroise3(); + test_zeroise1(); + test_zeroise2(); + test_zeroise3(); display_test_results(); |