aboutsummaryrefslogtreecommitdiff
path: root/src/tb
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2018-11-27 13:47:35 +0100
committerJoachim StroĢˆmbergson <joachim@secworks.se>2018-11-27 13:47:35 +0100
commit0fb1cd7cddf85af93a29959b66b0295ae0021e45 (patch)
treebc5a8e9303f0376376af978f1d4f15371402c1f1 /src/tb
parente8fb3bbedca650c3b5fdf0e620bdc231bc85fd55 (diff)
Adding check that correct status word was written into the serial memory.
Diffstat (limited to 'src/tb')
-rw-r--r--src/tb/tb_keywrap_mkmif.v18
1 files changed, 14 insertions, 4 deletions
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