[Cryptech-Commits] [core/util/keywrap] 38/95: Add support to dump contents of memory to check that data has been written correctly.

git at cryptech.is git at cryptech.is
Wed Mar 25 17:18:37 UTC 2020


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch master
in repository core/util/keywrap.

commit c874d87b9a4c78a8dd42f4fe860d10a4461bb8b7
Author: Joachim Strömbergson <joachim at secworks.se>
AuthorDate: Tue Jul 3 11:13:54 2018 +0200

    Add support to dump contents of memory to check that data has been written correctly.
---
 src/tb/tb_keywrap.v | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/tb/tb_keywrap.v b/src/tb/tb_keywrap.v
index 9c6fb56..04efa44 100644
--- a/src/tb/tb_keywrap.v
+++ b/src/tb/tb_keywrap.v
@@ -140,6 +140,21 @@ module tb_keywrap();
     end
 
 
+  //----------------------------------------------------------------
+  // dump_mem()
+  //
+  // Dump the n first memory positions in the dut internal memory.
+  //----------------------------------------------------------------
+  task dump_mem(integer n);
+    begin : dump_mem
+      integer i;
+      for (i  = 0 ; i < n ; i = i + 2)
+        $display("mem0[0x%06x] = 0x%08x  mem1[0x%06x] = 0x%08x",
+                 i, dut.core.mem.mem0[i], i, dut.core.mem.mem1[i]);
+    end
+  endtask // dump_mem
+
+
   //----------------------------------------------------------------
   // read_word()
   //
@@ -332,6 +347,8 @@ module tb_keywrap();
       write_word(ADDR_WRITE_DATA, 32'h45a28800);
       write_word(ADDR_WRITE_DATA, 32'h5f37a27d);
 
+      dump_mem(6);
+
 
       // Start wrapping and wait for wrap to complete.
       write_word(ADDR_CTRL, 32'h00000002);



More information about the Commits mailing list