From e3ce9cd91fe4da7917dd72920f0a9d0540831c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Fri, 23 Nov 2018 10:06:30 +0100 Subject: Added observation of mem internal control states. --- src/tb/tb_keywrap_mkmif.v | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'src/tb') 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; -- cgit v1.2.3