[Cryptech-Commits] [user/js/keywrap] 01/02: Added observation of mem internal control states.

git at cryptech.is git at cryptech.is
Fri Nov 23 09:34:48 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 e3ce9cd91fe4da7917dd72920f0a9d0540831c37
Author: Joachim Strömbergson <joachim at secworks.se>
AuthorDate: Fri Nov 23 10:06:30 2018 +0100

    Added observation of mem internal control states.
---
 src/tb/tb_keywrap_mkmif.v | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/src/tb/tb_keywrap_mkmif.v b/src/tb/tb_keywrap_mkmif.v
index ccb8ff3..06e3356 100644
--- a/src/tb/tb_keywrap_mkmif.v
+++ b/src/tb/tb_keywrap_mkmif.v
@@ -60,6 +60,7 @@ module tb_keywrap_mkmif();
 
   integer show_spi;
   integer show_dut_state;
+  integer show_mem_state;
 
   reg            tb_clk;
   reg            tb_reset_n;
@@ -109,12 +110,12 @@ module tb_keywrap_mkmif();
   // Memory model. See README.md in src/tech for info on how
   // to get the vendor specific model needed here.
   //----------------------------------------------------------------
-  M23K640 memory(.SI(tb_mkm_spi_di),
-                 .SO(tb_mkm_spi_do),
-                 .SCK(tb_mkm_spi_sclk),
-                 .CS_N(tb_mkm_spi_cs_n),
-                 .HOLD_N(mem_hold_n),
-                 .RESET(tb_reset_n));
+  M23K640 mem(.SI(tb_mkm_spi_di),
+              .SO(tb_mkm_spi_do),
+              .SCK(tb_mkm_spi_sclk),
+              .CS_N(tb_mkm_spi_cs_n),
+              .HOLD_N(mem_hold_n),
+              .RESET(tb_reset_n));
 
 
   //----------------------------------------------------------------
@@ -147,13 +148,21 @@ module tb_keywrap_mkmif();
           $display("ready: 0x%01x  ctrl_state: 0x%02x", dut.ready, dut.keywrap_mkmif_ctrl_reg);
         end
 
+      if (show_mem_state)
+        begin
+          $display("BitCounter: %08d  InstRegister: 0x%01x  AddrRegister: 0x%02x",
+                   mem.BitCounter, mem.InstRegister, mem.AddrRegister);
+          $display("DataShifterI: 0x%02x  DataShifterO: 0x%01x",
+                   mem.DataShifterI, mem.DataShifterO);
+        end
+
       if (show_spi)
         begin
           $display("spi_clk: 0x%01x, spi_cs_n: 0x%01x, spi_do: 0x%01x, spi_di: 0x%01x",
                    tb_mkm_spi_sclk, tb_mkm_spi_cs_n, tb_mkm_spi_do, tb_mkm_spi_di);
-          $display();
-          $display();
         end
+
+      $display("\n");
       #(CLK_PERIOD);
     end
 
@@ -172,6 +181,7 @@ module tb_keywrap_mkmif();
 
       show_spi       = 0;
       show_dut_state = 1;
+      show_mem_state = 1;
 
       tb_clk        = 1'h0;
       tb_reset_n    = 1'h1;



More information about the Commits mailing list