diff options
Diffstat (limited to 'src/rtl')
-rw-r--r-- | src/rtl/keywrap_mkmif.v | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/src/rtl/keywrap_mkmif.v b/src/rtl/keywrap_mkmif.v index e2b9302..88af6f8 100644 --- a/src/rtl/keywrap_mkmif.v +++ b/src/rtl/keywrap_mkmif.v @@ -282,27 +282,33 @@ module keywrap_mkmif ( keywrap_mkmif_ctrl_new = CTRL_READ_STATUS_WAIT; keywrap_mkmif_ctrl_we = 1'h1; end + end + + if (write) + begin + ready_new = 1'h0; + ready_we = 1'h1; - if (write) - if (key_status) - begin - key_word_ctr_rst = 1'h1; - keywrap_mkmif_ctrl_new = CTRL_WRITE_KEY; - keywrap_mkmif_ctrl_we = 1'h1; - end - else - begin - mkm_write_op = 1'h1; - mkm_addr_new = MKM_STATUS_WORD; - mkm_addr_we = 1'h1; - mkm_write_data_new = wr_status; - mkm_write_data_we = 1'h1; - keywrap_mkmif_ctrl_new = CTRL_WAIT; - keywrap_mkmif_ctrl_we = 1'h1; - end + if (key_status) + begin + key_word_ctr_rst = 1'h1; + keywrap_mkmif_ctrl_new = CTRL_WRITE_KEY; + keywrap_mkmif_ctrl_we = 1'h1; + end + else + begin + mkm_write_op = 1'h1; + mkm_addr_new = MKM_STATUS_WORD; + mkm_addr_we = 1'h1; + mkm_write_data_new = wr_status; + mkm_write_data_we = 1'h1; + keywrap_mkmif_ctrl_new = CTRL_WAIT; + keywrap_mkmif_ctrl_we = 1'h1; + end end end + CTRL_WAIT: begin if (mkm_ready) |