From 36339014ec3d3ad3bb4622392d5075d674e7dbeb Mon Sep 17 00:00:00 2001 From: "Pavel V. Shatov (Meister)" Date: Mon, 21 Oct 2019 12:51:30 +0300 Subject: Added the regular (not modular) addition operation required during the final step of the Garner's formula algorithm. Note, that the addition is "uneven" in the sense, that the first operand is full-size (as wide as the modulus), while the second one is only half the size. The adder internally banks the second input port during the second half of the addition. --- rtl/modexpng_core_top.v | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'rtl/modexpng_core_top.v') diff --git a/rtl/modexpng_core_top.v b/rtl/modexpng_core_top.v index 4c1f065..78e4668 100644 --- a/rtl/modexpng_core_top.v +++ b/rtl/modexpng_core_top.v @@ -91,7 +91,8 @@ module modexpng_core_top (uop_data_opcode == UOP_OPCODE_COPY_LADDERS_X2Y ) || (uop_data_opcode == UOP_OPCODE_CROSS_LADDERS_X2Y ) || (uop_data_opcode == UOP_OPCODE_MODULAR_SUBTRACT ) || - (uop_data_opcode == UOP_OPCODE_MERGE_LH ) ; + (uop_data_opcode == UOP_OPCODE_MERGE_LH ) || + (uop_data_opcode == UOP_OPCODE_REGULAR_ADD_UNEVEN ) ; wire uop_loop_now; @@ -1160,6 +1161,12 @@ module modexpng_core_top wrk_sel_narrow_in <= uop_data_sel_narrow_in; end // + UOP_OPCODE_REGULAR_ADD_UNEVEN: begin + wrk_sel_wide_in <= uop_data_sel_wide_in; + wrk_sel_narrow_in <= uop_data_sel_narrow_in; + wrk_sel_narrow_out <= uop_data_sel_narrow_out; + end + // endcase // end @@ -1227,6 +1234,11 @@ module modexpng_core_top io_mgr_ladder_steps <= crt_mode ? bit_index_last_pq : bit_index_last_n; end // + UOP_OPCODE_REGULAR_ADD_UNEVEN: begin + wrk_word_index_last <= word_index_last_n; + wrk_word_index_last_half <= word_index_last_pq; + end + // UOP_OPCODE_LADDER_STEP: begin io_mgr_word_index_last <= OP_ADDR_LADDER_LAST; io_mgr_ladder_steps <= crt_mode ? bit_index_last_pq : bit_index_last_n; -- cgit v1.2.3