aboutsummaryrefslogtreecommitdiff
path: root/rtl/modexpng_core_top.v
diff options
context:
space:
mode:
authorPavel V. Shatov (Meister) <meisterpaul1@yandex.ru>2019-10-03 16:42:24 +0300
committerPavel V. Shatov (Meister) <meisterpaul1@yandex.ru>2019-10-03 16:42:24 +0300
commit8ee5a19240722f397d55f57a426992350f8019a3 (patch)
treee13a9cf1559ea4c65214119373188e17313d8b57 /rtl/modexpng_core_top.v
parentaffada8d5da7426d22035360c3674ab3b3311ab5 (diff)
Expanded micro-operation parameters (added dedicated control bit to force the B input of
the modular multiplier to 1, this is necessary to bring numbers out of Montgomery domain).
Diffstat (limited to 'rtl/modexpng_core_top.v')
-rw-r--r--rtl/modexpng_core_top.v20
1 files changed, 14 insertions, 6 deletions
diff --git a/rtl/modexpng_core_top.v b/rtl/modexpng_core_top.v
index eb6826c..e117e5d 100644
--- a/rtl/modexpng_core_top.v
+++ b/rtl/modexpng_core_top.v
@@ -578,6 +578,9 @@ module modexpng_core_top
reg [BANK_ADDR_W -1:0] mmm_sel_narrow_in_x;
reg [BANK_ADDR_W -1:0] mmm_sel_narrow_in_y;
+ reg mmm_force_unity_b_x;
+ reg mmm_force_unity_b_y;
+
wire rdct_ena_x;
wire rdct_ena_y;
wire rdct_rdy_x;
@@ -594,6 +597,7 @@ module modexpng_core_top
.ladder_mode (mmm_ladder_mode_x),
.word_index_last (mmm_word_index_last_x),
.word_index_last_minus1 (mmm_word_index_last_minus1_x),
+ .force_unity_b (mmm_force_unity_b_x),
.sel_wide_in (mmm_sel_wide_in_x),
.sel_narrow_in (mmm_sel_narrow_in_x),
@@ -648,6 +652,7 @@ module modexpng_core_top
.ladder_mode (mmm_ladder_mode_y),
.word_index_last (mmm_word_index_last_y),
.word_index_last_minus1 (mmm_word_index_last_minus1_y),
+ .force_unity_b (mmm_force_unity_b_y),
.sel_wide_in (mmm_sel_wide_in_y),
.sel_narrow_in (mmm_sel_narrow_in_y),
@@ -812,7 +817,9 @@ module modexpng_core_top
//
// Parameters
- //
+ //
+ wire uop_aux_is_1 = uop_data_aux == UOP_AUX_1;
+
always @(posedge clk)
//
if (uop_fsm_state == UOP_FSM_STATE_DECODE) begin
@@ -844,11 +851,12 @@ module modexpng_core_top
UOP_LADDER_PQ: {mmm_ladder_mode_x, mmm_ladder_mode_y} <= 2'bXX;
endcase
//
- {mmm_sel_wide_in_x, mmm_sel_wide_in_y } <= {2{uop_data_sel_wide_in }};
- {mmm_sel_narrow_in_x, mmm_sel_narrow_in_y } <= {2{uop_data_sel_narrow_in }};
- {rdct_sel_wide_out_x, rdct_sel_wide_out_y } <= {2{uop_data_sel_wide_out }};
- {rdct_sel_narrow_out_x, rdct_sel_narrow_out_y} <= {2{uop_data_sel_narrow_out}};
-
+ {mmm_force_unity_b_x, mmm_force_unity_b_y } <= {2{uop_aux_is_1 ? 1'b0 : 1'b1}};
+ {mmm_sel_wide_in_x, mmm_sel_wide_in_y } <= {2{uop_data_sel_wide_in }};
+ {mmm_sel_narrow_in_x, mmm_sel_narrow_in_y } <= {2{uop_data_sel_narrow_in }};
+ {rdct_sel_wide_out_x, rdct_sel_wide_out_y } <= {2{uop_data_sel_wide_out }};
+ {rdct_sel_narrow_out_x, rdct_sel_narrow_out_y} <= {2{uop_data_sel_narrow_out }};
+
//
end
//