aboutsummaryrefslogtreecommitdiff
path: root/src/tb
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2018-11-23 10:06:30 +0100
committerJoachim StroĢˆmbergson <joachim@secworks.se>2018-11-23 10:06:30 +0100
commite3ce9cd91fe4da7917dd72920f0a9d0540831c37 (patch)
tree7a74b1d8d8d507fa988d9e7ce5ef9b20118d6abd /src/tb
parent4e4a87a035e98cc8fbcc6d33b9c6009919213a64 (diff)
Added observation of mem internal control states.
Diffstat (limited to 'src/tb')
-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;