aboutsummaryrefslogtreecommitdiff
path: root/rtl
diff options
context:
space:
mode:
authorPavel V. Shatov (Meister) <meisterpaul1@yandex.ru>2019-10-01 15:11:04 +0300
committerPavel V. Shatov (Meister) <meisterpaul1@yandex.ru>2019-10-01 15:11:04 +0300
commit3ea94c872afe6309c43ac7eccf877734c33f5421 (patch)
tree620a0af37052eaa3053c941a98e67f393aafbd96 /rtl
parentecf0374b7bbf1c1ea56fea8f1acaeea85c3612d2 (diff)
Implemented the final stage of the Montgomery modular multiplication, i.e.
addition of AB and M then reduction by right-shift.
Diffstat (limited to 'rtl')
-rw-r--r--rtl/modexpng_parameters.vh6
-rw-r--r--rtl/modexpng_part_recombinator.v15
2 files changed, 18 insertions, 3 deletions
diff --git a/rtl/modexpng_parameters.vh b/rtl/modexpng_parameters.vh
index 57eef35..77b57f3 100644
--- a/rtl/modexpng_parameters.vh
+++ b/rtl/modexpng_parameters.vh
@@ -7,10 +7,10 @@ localparam [2:0] BANK_FAT_T1T2 = 3'd0;
localparam [2:0] BANK_FAT_ABL = 3'd1;
localparam [2:0] BANK_FAT_ABH = 3'd2;
localparam [2:0] BANK_FAT_N = 3'd3;
-localparam [2:0] BANK_FAT_ML = 3'd4;
-localparam [2:0] BANK_FAT_MH = 3'd5;
+localparam [2:0] BANK_FAT_ML = 3'd4; // not needed
+localparam [2:0] BANK_FAT_MH = 3'd5; // not needed
localparam [2:0] BANK_FAT_EXT = 3'd6; // 0 -> MH'
-localparam [2:0] BANK_FAT_UNUSED = 3'd7;
+localparam [2:0] BANK_FAT_UNUSED = 3'd7; // not needed
localparam [1:0] BANK_SLIM_T1T2 = 2'd0;
localparam [1:0] BANK_SLIM_N_COEFF = 2'd1;
diff --git a/rtl/modexpng_part_recombinator.v b/rtl/modexpng_part_recombinator.v
index 567ecd5..957ba8e 100644
--- a/rtl/modexpng_part_recombinator.v
+++ b/rtl/modexpng_part_recombinator.v
@@ -1095,6 +1095,7 @@ module modexpng_part_recombinator
end
//
end
+ //
endcase
//
2'd2: case (rcmb_xy_dout_valid)
@@ -1103,6 +1104,20 @@ module modexpng_part_recombinator
//
endcase
//
+ 2'd3: case (rcmb_xy_dout_valid)
+ //
+ 2'b00: begin
+ //
+ if (recomb_msb_flag_delay_2) begin
+ //
+ rdy_adv <= ~recomb_msb_flag_delay_1;
+ //
+ end
+ //
+ end
+ //
+ endcase
+ //
endcase
//
end