[Cryptech-Commits] [user/js/keywrap] 01/02: Adding check that correct status word was written into the serial memory.

git at cryptech.is git at cryptech.is
Tue Nov 27 12:48:36 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 0fb1cd7cddf85af93a29959b66b0295ae0021e45
Author: Joachim Strömbergson <joachim at secworks.se>
AuthorDate: Tue Nov 27 13:47:35 2018 +0100

    Adding check that correct status word was written into the serial memory.
---
 src/tb/tb_keywrap_mkmif.v | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/tb/tb_keywrap_mkmif.v b/src/tb/tb_keywrap_mkmif.v
index 89e93c7..79083e4 100644
--- a/src/tb/tb_keywrap_mkmif.v
+++ b/src/tb/tb_keywrap_mkmif.v
@@ -216,8 +216,8 @@ module tb_keywrap_mkmif();
 
       show_spi       = 0;
       show_dut_state = 1;
-      show_mem_state = 1;
-      show_mkm_state = 1;
+      show_mem_state = 0;
+      show_mkm_state = 0;
 
       tb_clk        = 1'h0;
       tb_reset_n    = 1'h1;
@@ -282,7 +282,7 @@ module tb_keywrap_mkmif();
       $display("Check that the memory is configured when pulling init.");
       $display();
 
-      show_spi = 1;
+      show_spi = 0;
       tb_init = 1'h1;
       #(CLK_PERIOD);
       tb_init = 1'h0;
@@ -306,7 +306,7 @@ module tb_keywrap_mkmif();
       $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;
+      show_spi = 0;
       #(10 * CLK_PERIOD);
 
       $display("Trying to write 0xdeadbeef to status address.");
@@ -320,6 +320,16 @@ module tb_keywrap_mkmif();
       wait_ready();
       show_spi = 0;
 
+      // Check content in memory.
+      if ((mem.MemoryBlock[0] == 8'hde) && (mem.MemoryBlock[1] == 8'had) &&
+          (mem.MemoryBlock[2] == 8'hbe) && (mem.MemoryBlock[3] == 8'hef))
+        $display("Correct status word was written into the memory.");
+      else
+        begin
+        $display("Correct status word was NOT written into the memory.");
+          error_ctr = error_ctr + 1;
+        end
+
       $display("TEST WRITE-STATUS END");
       $display("");
     end



More information about the Commits mailing list