aboutsummaryrefslogtreecommitdiff
path: root/rtl/modexpng_io_manager.v
diff options
context:
space:
mode:
Diffstat (limited to 'rtl/modexpng_io_manager.v')
-rw-r--r--rtl/modexpng_io_manager.v28
1 files changed, 16 insertions, 12 deletions
diff --git a/rtl/modexpng_io_manager.v b/rtl/modexpng_io_manager.v
index 59f4709..da2bdac 100644
--- a/rtl/modexpng_io_manager.v
+++ b/rtl/modexpng_io_manager.v
@@ -52,8 +52,8 @@ module modexpng_io_manager
io_out_addr,
io_out_dout,
- wrk_narrow_x_din_x_trunc,
- wrk_narrow_x_din_y_trunc,
+ wrk_narrow_x_din_x_lsb,
+ wrk_narrow_x_din_y_lsb,
ladder_steps,
ladder_d,
@@ -124,8 +124,8 @@ module modexpng_io_manager
output [BANK_ADDR_W + OP_ADDR_W -1:0] io_out_addr;
output [ WORD_W -1:0] io_out_dout;
- output [ WORD_W -1:0] wrk_narrow_x_din_x_trunc;
- output [ WORD_W -1:0] wrk_narrow_x_din_y_trunc;
+ input [ WORD_W -1:0] wrk_narrow_x_din_x_lsb;
+ input [ WORD_W -1:0] wrk_narrow_x_din_y_lsb;
input [ BIT_INDEX_W -1:0] ladder_steps;
output ladder_d;
@@ -481,7 +481,7 @@ module modexpng_io_manager
if (opcode_is_input_narrow && sel_crt_is_x) {narrow_x_din_x, narrow_y_din_x} <= {2{io_in_dout_mux}};
if (opcode_is_input_narrow && sel_crt_is_y) {narrow_x_din_y, narrow_y_din_y} <= {2{io_in_dout_mux}};
//
- if (opcode_is_output) out_dout <= sel_crt_is_x ? wrk_narrow_x_din_x_trunc : wrk_narrow_x_din_y_trunc;
+ if (opcode_is_output) out_dout <= sel_crt_is_x ? wrk_narrow_x_din_x_lsb: wrk_narrow_x_din_y_lsb;
//
end
//
@@ -490,7 +490,7 @@ module modexpng_io_manager
if (opcode_is_input_narrow && sel_crt_is_x && sel_in_needs_extra) {narrow_x_din_x, narrow_y_din_x} <= {2{io_in_dout_mux}};
if (opcode_is_input_narrow && sel_crt_is_y && sel_in_needs_extra) {narrow_x_din_y, narrow_y_din_y} <= {2{io_in_dout_mux}};
//
- if (opcode_is_output) out_dout <= sel_crt_is_x ? wrk_narrow_x_din_x_trunc : wrk_narrow_x_din_y_trunc;
+ if (opcode_is_output) out_dout <= sel_crt_is_x ? wrk_narrow_x_din_x_lsb : wrk_narrow_x_din_y_lsb;
//
end
//
@@ -697,14 +697,18 @@ module modexpng_io_manager
//
// BEGIN DEBUG
//
+ `ifdef MODEXPNG_ENABLE_DEBUG
always @(posedge clk)
//
- if ((io_fsm_state == IO_FSM_STATE_STOP) && opcode_is_ladder)
- $display("[%4d] / %d / %d / %d", ladder_index, ladder_d_r, ladder_p_r, ladder_q_r);
-
- //
- // END DEBUG
- //
+ if (io_fsm_state == IO_FSM_STATE_STOP) begin
+ if (opcode_is_ladder_init) begin
+ $display("[step] | D | P | Q");
+ $display("-------+---+---+---");
+ end else if (opcode_is_ladder_step)
+ $display("[%4d] | %d | %d | %d", ladder_index, ladder_d_r, ladder_p_r, ladder_q_r);
+ end
+ //
+ `endif
endmodule