aboutsummaryrefslogtreecommitdiff
path: root/rtl
diff options
context:
space:
mode:
authorPavel V. Shatov (Meister) <meisterpaul1@yandex.ru>2020-01-20 23:57:42 +0300
committerPavel V. Shatov (Meister) <meisterpaul1@yandex.ru>2020-01-20 23:57:42 +0300
commit64928838b16fe4c7bb6855d57e5695876314e286 (patch)
treed91f545e56f4522e3a5b4116fe02fa24000eb0d5 /rtl
parentb8c0536da225a146eece91c17082e279243380dc (diff)
For the new general worker module to work we need dynamic switching of DSP
OPMODE, ALUMODE and CARRYINSEL ports, thus more defined constants.
Diffstat (limited to 'rtl')
-rw-r--r--rtl/modexpng_dsp48e1.vh51
1 files changed, 43 insertions, 8 deletions
diff --git a/rtl/modexpng_dsp48e1.vh b/rtl/modexpng_dsp48e1.vh
index 68c5335..8140917 100644
--- a/rtl/modexpng_dsp48e1.vh
+++ b/rtl/modexpng_dsp48e1.vh
@@ -30,12 +30,47 @@
//
//======================================================================
-localparam DSP48E1_A_W = 30;
-localparam DSP48E1_B_W = 18;
-localparam DSP48E1_C_W = 48;
-localparam DSP48E1_D_W = 25;
-localparam DSP48E1_P_W = 48;
-localparam DSP48E1_INMODE_W = 5;
-localparam DSP48E1_OPMODE_W = 7;
-localparam DSP48E1_ALUMODE_W = 4;
+localparam DSP48E1_A_W = 30;
+localparam DSP48E1_B_W = 18;
+localparam DSP48E1_C_W = 48;
+localparam DSP48E1_D_W = 25;
+localparam DSP48E1_P_W = 48;
+localparam DSP48E1_INMODE_W = 5;
+localparam DSP48E1_OPMODE_W = 7;
+localparam DSP48E1_ALUMODE_W = 4;
+localparam DSP48E1_CARRYINSEL_W = 3;
+localparam DSP48E1_CARRYOUT_W = 4;
+localparam DSP48E1_OPMODE_X_DNC = 2'bXX;
+localparam DSP48E1_OPMODE_X_0 = 2'b00;
+localparam DSP48E1_OPMODE_X_AB = 2'b11;
+
+localparam DSP48E1_OPMODE_Y_DNC = 2'bXX;
+localparam DSP48E1_OPMODE_Y_0 = 2'b00;
+localparam DSP48E1_OPMODE_Y_C = 2'b11;
+
+localparam DSP48E1_OPMODE_Z_DNC = 3'bXXX;
+localparam DSP48E1_OPMODE_Z_0 = 3'b000;
+localparam DSP48E1_OPMODE_Z_P17 = 3'b110;
+localparam DSP48E1_OPMODE_Z_PCIN17 = 3'b101;
+localparam DSP48E1_OPMODE_Z_P = 3'b010;
+localparam DSP48E1_OPMODE_Z_C = 3'b011;
+
+localparam DSP48E1_OPMODE_DNC = {DSP48E1_OPMODE_Z_DNC, DSP48E1_OPMODE_Y_DNC, DSP48E1_OPMODE_X_DNC};
+
+localparam DSP48E1_OPMODE_Z0_YC_XAB = {DSP48E1_OPMODE_Z_0, DSP48E1_OPMODE_Y_C, DSP48E1_OPMODE_X_AB};
+localparam DSP48E1_OPMODE_ZP17_YC_XAB = {DSP48E1_OPMODE_Z_P17, DSP48E1_OPMODE_Y_C, DSP48E1_OPMODE_X_AB};
+localparam DSP48E1_OPMODE_Z0_Y0_XAB = {DSP48E1_OPMODE_Z_0, DSP48E1_OPMODE_Y_0, DSP48E1_OPMODE_X_AB};
+localparam DSP48E1_OPMODE_ZPCIN17_YC_XAB = {DSP48E1_OPMODE_Z_PCIN17, DSP48E1_OPMODE_Y_C, DSP48E1_OPMODE_X_AB};
+localparam DSP48E1_OPMODE_Z0_YC_X0 = {DSP48E1_OPMODE_Z_0, DSP48E1_OPMODE_Y_C, DSP48E1_OPMODE_X_0};
+localparam DSP48E1_OPMODE_ZP17_YC_X0 = {DSP48E1_OPMODE_Z_P17, DSP48E1_OPMODE_Y_C, DSP48E1_OPMODE_X_0};
+localparam DSP48E1_OPMODE_ZP_YC_X0 = {DSP48E1_OPMODE_Z_P, DSP48E1_OPMODE_Y_C, DSP48E1_OPMODE_X_0};
+localparam DSP48E1_OPMODE_ZC_Y0_XAB = {DSP48E1_OPMODE_Z_C, DSP48E1_OPMODE_Y_0, DSP48E1_OPMODE_X_AB};
+
+localparam DSP48E1_CARRYINSEL_DNC = 3'bXXX;
+localparam DSP48E1_CARRYINSEL_CARRYIN = 3'b000;
+localparam DSP48E1_CARRYINSEL_CARRYCASCOUT = 3'b100;
+
+localparam DSP48E1_ALUMODE_DNC = 4'bXXXX;
+localparam DSP48E1_ALUMODE_Z_PLUS_X_AND_Y_AND_CIN = 4'b0000;
+localparam DSP48E1_ALUMODE_Z_MINUS_X_AND_Y_AND_CIN = 4'b0011;