From 0fb1cd7cddf85af93a29959b66b0295ae0021e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Tue, 27 Nov 2018 13:47:35 +0100 Subject: Adding check that correct status word was written into the serial memory. --- src/tb/tb_keywrap_mkmif.v | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/tb') diff --git a/src/tb/tb_keywrap_mkmif.v b/src/tb/tb_keywrap_mkmif.v index 89e93c7..79083e4 100644 --- a/src/tb/tb_keywrap_mkmif.v +++ b/src/tb/tb_keywrap_mkmif.v @@ -216,8 +216,8 @@ module tb_keywrap_mkmif(); show_spi = 0; show_dut_state = 1; - show_mem_state = 1; - show_mkm_state = 1; + show_mem_state = 0; + show_mkm_state = 0; tb_clk = 1'h0; tb_reset_n = 1'h1; @@ -282,7 +282,7 @@ module tb_keywrap_mkmif(); $display("Check that the memory is configured when pulling init."); $display(); - show_spi = 1; + show_spi = 0; tb_init = 1'h1; #(CLK_PERIOD); tb_init = 1'h0; @@ -306,7 +306,7 @@ module tb_keywrap_mkmif(); $display("Check that we can write the key status word."); // Observe SPI for a number of cycles. Reset the DUT during observation. - show_spi = 1; + show_spi = 0; #(10 * CLK_PERIOD); $display("Trying to write 0xdeadbeef to status address."); @@ -320,6 +320,16 @@ module tb_keywrap_mkmif(); wait_ready(); show_spi = 0; + // Check content in memory. + if ((mem.MemoryBlock[0] == 8'hde) && (mem.MemoryBlock[1] == 8'had) && + (mem.MemoryBlock[2] == 8'hbe) && (mem.MemoryBlock[3] == 8'hef)) + $display("Correct status word was written into the memory."); + else + begin + $display("Correct status word was NOT written into the memory."); + error_ctr = error_ctr + 1; + end + $display("TEST WRITE-STATUS END"); $display(""); end -- cgit v1.2.3