[Cryptech-Commits] [user/js/keywrap] 02/02: Adding test case for mem init. Removing auto-load test case since the dut does not support auto load. Updating the write status test case to use wait_ready() for dut status.

git at cryptech.is git at cryptech.is
Fri Nov 23 06:38:14 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 42e3fcaaec5fe0ae0788d3e1c02da1751cbc9c5b
Author: Joachim Strömbergson <joachim at secworks.se>
AuthorDate: Fri Nov 23 07:38:00 2018 +0100

    Adding test case for mem init. Removing auto-load test case since the dut does not support auto load. Updating the write status test case to use wait_ready() for dut status.
---
 src/tb/tb_keywrap_mkmif.v | 48 ++++++++++++++++++++++++++++++-----------------
 1 file changed, 31 insertions(+), 17 deletions(-)

diff --git a/src/tb/tb_keywrap_mkmif.v b/src/tb/tb_keywrap_mkmif.v
index faef1df..1acce3d 100644
--- a/src/tb/tb_keywrap_mkmif.v
+++ b/src/tb/tb_keywrap_mkmif.v
@@ -204,27 +204,40 @@ module tb_keywrap_mkmif();
 
 
   //----------------------------------------------------------------
-  // test_auto_load
+  // wait_ready()
+  //
+  // Wait for ready to be asserted.
+  //----------------------------------------------------------------
+  task wait_ready;
+    begin
+      while (!tb_ready)
+        #(CLK_PERIOD);
+
+      $display("Ready has been set.");
+    end
+  endtask // wait_ready
+
+
+  //----------------------------------------------------------------
+  // test_init_mem
   //----------------------------------------------------------------
-  task test_auto_load;
+  task test_init_mem;
     begin
       tc_ctr = tc_ctr + 1;
 
-      $display("TEST AUTO-LOAD START");
-      $display("Check that key and key status is read automatically after reset.");
+      $display("TEST INIT-MEM START");
+      $display("Check that the memory is configured when pulling init.");
       $display();
 
-      // Observe SPI for a number of cycles. Reset the DUT during observation.
-      show_spi = 1;
-      #(10 * CLK_PERIOD);
-      reset_dut();
-      #(100 * CLK_PERIOD);
-      show_spi = 0;
+      tb_init = 1'h1;
+      #(CLK_PERIOD);
+      tb_init = 1'h0;
+      wait_ready();
 
-      $display("TEST AUTO-LOAD END");
+      $display("TEST INIT-MEM END");
       $display("");
     end
-  endtask // auto_load
+  endtask // test_init_mem
 
 
   //----------------------------------------------------------------
@@ -234,24 +247,25 @@ module tb_keywrap_mkmif();
     begin
       tc_ctr = tc_ctr + 1;
 
-      $display("TEST WRITE STATUS START");
+      $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);
 
+      $display("Trying to write 0xdeadbeef to status address.");
+      tb_wr_status  = 32'hdeadbeef;
       tb_key_status = 1'h0;
       tb_write      = 1'h1;
-      tb_wr_status  = 32'hdeadbeef;
 
       #(CLK_PERIOD);
       tb_write      = 1'h0;
 
-      #(100 * CLK_PERIOD);
+      wait_ready();
       show_spi = 0;
 
-      $display("TEST WRITE STATUS END");
+      $display("TEST WRITE-STATUS END");
       $display("");
     end
   endtask // test_write_status
@@ -267,7 +281,7 @@ module tb_keywrap_mkmif();
       $display("");
 
       init_sim();
-      test_auto_load();
+      test_init_mem();
       test_write_status();
 
       $display("");



More information about the Commits mailing list