From 8ee5a19240722f397d55f57a426992350f8019a3 Mon Sep 17 00:00:00 2001 From: "Pavel V. Shatov (Meister)" Date: Thu, 3 Oct 2019 16:42:24 +0300 Subject: 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). --- rtl/modexpng_core_top.v | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'rtl/modexpng_core_top.v') 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 // -- cgit v1.2.3