aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tb/tb_keywrap_mkmif.v26
1 files 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;