aboutsummaryrefslogtreecommitdiff
path: root/src/tb
diff options
context:
space:
mode:
Diffstat (limited to 'src/tb')
-rw-r--r--src/tb/tb_keywrap_mkmif.v42
1 files changed, 39 insertions, 3 deletions
diff --git a/src/tb/tb_keywrap_mkmif.v b/src/tb/tb_keywrap_mkmif.v
index 3289a77..b275499 100644
--- a/src/tb/tb_keywrap_mkmif.v
+++ b/src/tb/tb_keywrap_mkmif.v
@@ -215,7 +215,7 @@ module tb_keywrap_mkmif();
tc_ctr = 0;
show_spi = 0;
- show_dut_state = 1;
+ show_dut_state = 0;
show_mem_state = 0;
show_mkm_state = 0;
@@ -303,7 +303,7 @@ module tb_keywrap_mkmif();
tc_ctr = tc_ctr + 1;
$display("TEST WRITE-STATUS START");
- $display("Check that we can write the key status word.");
+ $display("Check that we can write the status word.");
// Observe SPI for a number of cycles. Reset the DUT during observation.
show_spi = 0;
@@ -337,6 +337,41 @@ module tb_keywrap_mkmif();
//----------------------------------------------------------------
+ // test_read_status
+ // Note: This test should be called after test_write_status.
+ // If not the contents of the memort will be undefined.
+ //----------------------------------------------------------------
+ task test_read_status;
+ begin
+ tc_ctr = tc_ctr + 1;
+
+ $display("TEST READ-STATUS START");
+ $display("Check that we can read the status word.");
+
+ // Observe SPI for a number of cycles. Reset the DUT during observation.
+ show_spi = 0;
+ show_dut_state = 1;
+ #(10 * CLK_PERIOD);
+
+ $display("Trying to read 0xdeadbeef from the status address.");
+ tb_key_status = 1'h0;
+ tb_read = 1'h1;
+
+ #(CLK_PERIOD);
+ tb_read = 1'h0;
+
+ wait_ready();
+ show_spi = 0;
+
+ $display("The word read: 0x%04x", tb_rd_status);
+
+ $display("TEST READ-STATUS END");
+ $display("");
+ end
+ endtask // test_read_status
+
+
+ //----------------------------------------------------------------
// test_write_key
//----------------------------------------------------------------
task test_write_key;
@@ -383,7 +418,8 @@ module tb_keywrap_mkmif();
dump_mem();
test_init_mem();
test_write_status();
- test_write_key();
+// test_read_status();
+// test_write_key();
dump_mem();
$display("");