[Cryptech-Commits] [user/js/keywrap] 02/02: Adding test that tries to write a key into the serial memory.
git at cryptech.is
git at cryptech.is
Tue Nov 27 12:48:37 UTC 2018
This is an automated email from the git hooks/post-receive script.
joachim at secworks.se pushed a commit to branch integrate_mkmif
in repository user/js/keywrap.
commit 88c15a5ff837dc6871f7ca8caf4610a4e2d056fd
Author: Joachim Strömbergson <joachim at secworks.se>
AuthorDate: Tue Nov 27 13:48:22 2018 +0100
Adding test that tries to write a key into the serial memory.
---
src/tb/tb_keywrap_mkmif.v | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/src/tb/tb_keywrap_mkmif.v b/src/tb/tb_keywrap_mkmif.v
index 79083e4..3289a77 100644
--- a/src/tb/tb_keywrap_mkmif.v
+++ b/src/tb/tb_keywrap_mkmif.v
@@ -336,6 +336,39 @@ module tb_keywrap_mkmif();
endtask // test_write_status
+ //----------------------------------------------------------------
+ // test_write_key
+ //----------------------------------------------------------------
+ task test_write_key;
+ begin
+ tc_ctr = tc_ctr + 1;
+
+ $display("TEST WRITE-KEY START");
+ $display("Check that we can write the key words.");
+
+ // Observe SPI for a number of cycles. Reset the DUT during observation.
+ show_spi = 0;
+ #(10 * CLK_PERIOD);
+
+ $display("Trying to write test key to key address.");
+ $display("test key: 0x01020304 0xaa55aa55 0x00ff00ff 0x0f0e0d0c");
+ $display(" 0x11121314 0x55aa55aa 0x11ee11ee 0x1f1e1d1c");
+
+ tb_wr_key = 256'h01020304_aa55aa55_00ff00ff_0f0e0d0c_11121314_55aa55aa_11ee11ee_1f1e1d1c;
+ tb_key_status = 1'h1;
+ tb_write = 1'h1;
+
+ #(CLK_PERIOD);
+ tb_write = 1'h0;
+
+ wait_ready();
+ show_spi = 0;
+
+ $display("TEST WRITE-KEY END");
+ $display("");
+ end
+ endtask // test_write_key
+
//----------------------------------------------------------------
// main
//----------------------------------------------------------------
@@ -350,6 +383,7 @@ module tb_keywrap_mkmif();
dump_mem();
test_init_mem();
test_write_status();
+ test_write_key();
dump_mem();
$display("");
More information about the Commits
mailing list