aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tb/tb_keywrap_mkmif.v48
1 files changed, 31 insertions, 17 deletions
diff --git a/src/tb/tb_keywrap_mkmif.v b/src/tb/tb_keywrap_mkmif.v
index faef1df..1acce3d 100644
--- a/src/tb/tb_keywrap_mkmif.v
+++ b/src/tb/tb_keywrap_mkmif.v
@@ -204,27 +204,40 @@ module tb_keywrap_mkmif();
//----------------------------------------------------------------
- // test_auto_load
+ // wait_ready()
+ //
+ // Wait for ready to be asserted.
+ //----------------------------------------------------------------
+ task wait_ready;
+ begin
+ while (!tb_ready)
+ #(CLK_PERIOD);
+
+ $display("Ready has been set.");
+ end
+ endtask // wait_ready
+
+
+ //----------------------------------------------------------------
+ // test_init_mem
//----------------------------------------------------------------
- task test_auto_load;
+ task test_init_mem;
begin
tc_ctr = tc_ctr + 1;
- $display("TEST AUTO-LOAD START");
- $display("Check that key and key status is read automatically after reset.");
+ $display("TEST INIT-MEM START");
+ $display("Check that the memory is configured when pulling init.");
$display();
- // Observe SPI for a number of cycles. Reset the DUT during observation.
- show_spi = 1;
- #(10 * CLK_PERIOD);
- reset_dut();
- #(100 * CLK_PERIOD);
- show_spi = 0;
+ tb_init = 1'h1;
+ #(CLK_PERIOD);
+ tb_init = 1'h0;
+ wait_ready();
- $display("TEST AUTO-LOAD END");
+ $display("TEST INIT-MEM END");
$display("");
end
- endtask // auto_load
+ endtask // test_init_mem
//----------------------------------------------------------------
@@ -234,24 +247,25 @@ module tb_keywrap_mkmif();
begin
tc_ctr = tc_ctr + 1;
- $display("TEST WRITE STATUS START");
+ $display("TEST WRITE-STATUS START");
$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;
#(10 * CLK_PERIOD);
+ $display("Trying to write 0xdeadbeef to status address.");
+ tb_wr_status = 32'hdeadbeef;
tb_key_status = 1'h0;
tb_write = 1'h1;
- tb_wr_status = 32'hdeadbeef;
#(CLK_PERIOD);
tb_write = 1'h0;
- #(100 * CLK_PERIOD);
+ wait_ready();
show_spi = 0;
- $display("TEST WRITE STATUS END");
+ $display("TEST WRITE-STATUS END");
$display("");
end
endtask // test_write_status
@@ -267,7 +281,7 @@ module tb_keywrap_mkmif();
$display("");
init_sim();
- test_auto_load();
+ test_init_mem();
test_write_status();
$display("");