diff options
author | Joachim StroĢmbergson <joachim@secworks.se> | 2018-08-23 12:45:23 +0200 |
---|---|---|
committer | Joachim StroĢmbergson <joachim@secworks.se> | 2018-08-23 12:45:23 +0200 |
commit | 702c57e301342005ea6f854fbeeb862d78b75360 (patch) | |
tree | 6926dc26b3829648c9c8f7baac8011fb9f4a3590 /src/tb | |
parent | 90b5fcc58633957ed5a03f0ba210216a5639d2a7 (diff) |
Debugged pipeline register and state update. All test cases ok.timing_fix
Diffstat (limited to 'src/tb')
-rw-r--r-- | src/tb/tb_chacha_core.v | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/tb/tb_chacha_core.v b/src/tb/tb_chacha_core.v index 1e729d2..bcd9e0f 100644 --- a/src/tb/tb_chacha_core.v +++ b/src/tb/tb_chacha_core.v @@ -162,14 +162,17 @@ module tb_chacha_core(); if (display_cycle_ctr) begin $display("cycle = %08x:", cycle_ctr); - $display(""); + $display("-----------------"); end // Display FSM control state and QR, DR counters. if (display_ctrl_and_ctrs) begin - $display("chacha_ctrl_reg = %01x", dut.chacha_ctrl_reg); + $display("Control and status:"); + $display("init = 0x%01x, next = 0x%01x", dut.init, dut.next); + $display("ready = 0x%01x, valid = 0x%01x", dut.ready, dut.data_out_valid); $display("qr_ctr_reg = %01x, dr_ctr_reg = %01x", dut.qr_ctr_reg, dut.dr_ctr_reg); + $display("chacha_ctrl_reg = %01x", dut.chacha_ctrl_reg); $display(""); end @@ -193,17 +196,24 @@ module tb_chacha_core(); $display("state13_reg = 0x%08x, state13_new = 0x%08x", dut.state_reg[13], dut.state_new[13]); $display("state14_reg = 0x%08x, state14_new = 0x%08x", dut.state_reg[14], dut.state_new[14]); $display("state15_reg = 0x%08x, state15_new = 0x%08x", dut.state_reg[15], dut.state_new[15]); - $display("state_we = 0x%01x", dut.state_we); + $display("init_state = 0x%01x, update_state = 0x%01x, state_we = 0x%01x", + dut.init_state, dut.update_state, dut.state_we); $display(""); end // Display the qround input and outputs. if (display_qround) begin - $display("a = %08x, b = %08x, c = %08x, d = %08x", dut.qr0_a, dut.qr0_b, dut.qr0_c, dut.qr0_d); - $display("qr0_a_prim = %08x, qr0_b_prim = %08x, qr0_c_prim = %08x, qr0_d_prim = %08x", dut.qr0_a_prim, dut.qr0_b_prim, dut.qr0_c_prim, dut.qr0_d_prim); + $display("QR0:"); + $display("a = 0x%08x, b = 0x%08x, c = 0x%08x, d = 0x%08x", + dut.qr0_a, dut.qr0_b, dut.qr0_c, dut.qr0_d); + $display("a_prim = 0x%08x, b_prim = 0x%08x, c_prim = 0x%08x, d_prim = 0x%08x", + dut.qr0_a_prim, dut.qr0_b_prim, dut.qr0_c_prim, dut.qr0_d_prim); + $display("a0 = 0x%08x, a1 = 0x%08x", dut.qr0.qr.a0, dut.qr0.qr.a1); + $display("a0_reg = 0x%08x, a0_new = 0x%08x", dut.qr0.a0_reg, dut.qr0.a0_new); $display(""); end + $display(""); end // dut_monitor @@ -415,21 +425,21 @@ module tb_chacha_core(); dump_state(); // Wait for valid flag and check results. - @(posedge dut.data_out_valid); + @(posedge tb_core_data_out_valid); dump_state(); if (tb_core_data_out == expected) begin $display("*** TC %0d-%0d successful", major, minor); + $display("Got: 0x%064x", tb_core_data_out); $display(""); end else begin $display("*** ERROR: TC %0d-%0d not successful", major, minor); - $display("Expected: 0x%064x", expected); $display("Got: 0x%064x", tb_core_data_out); + $display("Expected: 0x%064x", expected); $display(""); - error_ctr = error_ctr + 1; end end @@ -510,7 +520,7 @@ module tb_chacha_core(); $display(" -- Testbench for chacha_core started --"); $display(""); - set_display_prefs(0, 0, 1, 1, 0); + set_display_prefs(1, 1, 1, 1, 1); qr_tests(); init_dut(); $display("*** State at init:"); |