diff options
author | Pavel V. Shatov (Meister) <meisterpaul1@yandex.ru> | 2019-10-21 12:51:30 +0300 |
---|---|---|
committer | Pavel V. Shatov (Meister) <meisterpaul1@yandex.ru> | 2019-10-21 12:51:30 +0300 |
commit | 36339014ec3d3ad3bb4622392d5075d674e7dbeb (patch) | |
tree | eea7babe9c56490cf718733831368c1ccb114bf1 /rtl/modexpng_core_top.v | |
parent | 3213b3ef3c1d40dfa416b6be409cfa3d15af0930 (diff) |
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.
Diffstat (limited to 'rtl/modexpng_core_top.v')
-rw-r--r-- | rtl/modexpng_core_top.v | 14 |
1 files changed, 13 insertions, 1 deletions
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; |