diff options
author | Joachim StroĢmbergson <joachim@secworks.se> | 2018-07-03 11:13:54 +0200 |
---|---|---|
committer | Joachim StroĢmbergson <joachim@secworks.se> | 2018-07-03 11:13:54 +0200 |
commit | c874d87b9a4c78a8dd42f4fe860d10a4461bb8b7 (patch) | |
tree | ab892c83912744386c903c87ed71effe73019e80 /src | |
parent | 2d3531979d28f73027587cd7168e33a1b66fe811 (diff) |
Add support to dump contents of memory to check that data has been written correctly.
Diffstat (limited to 'src')
-rw-r--r-- | src/tb/tb_keywrap.v | 17 |
1 files changed, 17 insertions, 0 deletions
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 @@ -141,6 +141,21 @@ module tb_keywrap(); //---------------------------------------------------------------- + // 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() // // Read a data word from the given address in the DUT. @@ -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); |