diff options
author | Joachim StroĢmbergson <joachim@secworks.se> | 2018-11-06 16:40:14 +0100 |
---|---|---|
committer | Joachim StroĢmbergson <joachim@secworks.se> | 2018-11-06 16:40:14 +0100 |
commit | 42d63504f02f895a7b89dc164571c4b0d21cf8d4 (patch) | |
tree | c261a6b2c3b25b59bc607303c3f9abee0a343f51 /src/tb | |
parent | 8b4f7c06886b3cb937d11fe9d2bd9a4f62a6d621 (diff) |
Fixed incorrect address used for the key. Added testcase to verify reading of status word.
Diffstat (limited to 'src/tb')
-rw-r--r-- | src/tb/tb_keywrap_mkmif.v | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/src/tb/tb_keywrap_mkmif.v b/src/tb/tb_keywrap_mkmif.v index 8bd3a05..e917c2c 100644 --- a/src/tb/tb_keywrap_mkmif.v +++ b/src/tb/tb_keywrap_mkmif.v @@ -182,9 +182,9 @@ module tb_keywrap_mkm(); tc_ctr = tc_ctr + 1; $display("TEST AUTO-LOAD START"); - $display("Check that correct ICV is generated for a single block message."); + $display("Check that key and key status is read automatically after reset."); - // Observe SPI for a number of cycles. Reset the DUT during monitoring. + // Observe SPI for a number of cycles. Reset the DUT during observation. show_spi = 1; #(10 * CLK_PERIOD); reset_dut(); @@ -197,21 +197,51 @@ module tb_keywrap_mkm(); endtask // auto_load + //---------------------------------------------------------------- + // test_write_status + //---------------------------------------------------------------- + task test_write_status; + begin + tc_ctr = tc_ctr + 1; + + $display("TEST WRITE STATUS START"); + $display("Check that we can write the key status word."); + + // Observe SPI for a number of cycles. Reset the DUT during observation. + show_spi = 1; + #(10 * CLK_PERIOD); + + tb_key_status = 1'h0; + tb_write = 1'h1; + tb_wr_status = 32'hdeadbeef; + + #(CLK_PERIOD); + tb_write = 1'h0; + + #(100 * CLK_PERIOD); + show_spi = 0; + + $display("TEST WRITE STATUS END"); + $display(""); + end + endtask // test_write_status + //---------------------------------------------------------------- // main //---------------------------------------------------------------- initial begin : main - $display(" -= Testbench for Keywrap mkmif wrapper started =-"); - $display(" ================================================"); + $display(" -= Testbench for Keywrap mkmif integration started =-"); + $display(" ===================================================="); $display(""); init_sim(); test_auto_load(); + test_write_status(); $display(""); - $display("*** Keywrap mkmif wrapper testbench done. ***"); + $display("*** Keywrap mkmif integration testbench done. ***"); $finish; end // main |