aboutsummaryrefslogtreecommitdiff
path: root/src/tb/tb_keywrap.v
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2018-09-14 16:07:25 +0200
committerJoachim StroĢˆmbergson <joachim@secworks.se>2018-09-14 16:07:25 +0200
commitf20979faa37d4f272fcce51af18b829027778614 (patch)
treedf76c9d45bed0ee5275b8ad818d001d312c29de0 /src/tb/tb_keywrap.v
parent6cfcc1ec5bc0e2c944ec66bd62d58740d2b8823d (diff)
Adding instatiation of the mkmif in the keywrap top level wrapper. Updated testbench anf Makefile to build with instantiated mkmif. The mkmif is not yet used by the keywrap.
Diffstat (limited to 'src/tb/tb_keywrap.v')
-rw-r--r--src/tb/tb_keywrap.v24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/tb/tb_keywrap.v b/src/tb/tb_keywrap.v
index 4d1c25c..1f1dabf 100644
--- a/src/tb/tb_keywrap.v
+++ b/src/tb/tb_keywrap.v
@@ -97,6 +97,10 @@ module tb_keywrap();
reg tb_clk;
reg tb_reset_n;
+ wire tb_mkm_spi_sclk;
+ wire tb_mkm_spi_cs_n;
+ reg tb_mkm_spi_do;
+ wire tb_mkm_spi_di;
reg tb_cs;
reg tb_we;
reg [(ADDR_BITS -1 ) : 0] tb_address;
@@ -111,6 +115,10 @@ module tb_keywrap();
keywrap dut(
.clk(tb_clk),
.reset_n(tb_reset_n),
+ .mkm_spi_sclk(tb_mkm_spi_sclk),
+ .mkm_spi_cs_n(tb_mkm_spi_cs_n),
+ .mkm_spi_do(tb_mkm_spi_do),
+ .mkm_spi_di(tb_mkm_spi_di),
.cs(tb_cs),
.we(tb_we),
.address(tb_address),
@@ -330,15 +338,17 @@ module tb_keywrap();
//----------------------------------------------------------------
task init_sim;
begin
- cycle_ctr = 0;
- error_ctr = 0;
- tc_ctr = 0;
+ cycle_ctr = 1'h0;
+ error_ctr = 1'h0;
+ tc_ctr = 1'h0;
- tb_clk = 0;
- tb_reset_n = 1;
+ tb_clk = 1'h0;
+ tb_reset_n = 1'h1;
- tb_cs = 0;
- tb_we = 0;
+ tb_mkm_spi_do = 1'h1;
+
+ tb_cs = 1'h0;
+ tb_we = 1'h0;
tb_address = 8'h0;
tb_write_data = 32'h0;
end