aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/xilinx/cells_sim.v
diff options
context:
space:
mode:
Diffstat (limited to 'techlibs/xilinx/cells_sim.v')
-rw-r--r--techlibs/xilinx/cells_sim.v83
1 files changed, 80 insertions, 3 deletions
diff --git a/techlibs/xilinx/cells_sim.v b/techlibs/xilinx/cells_sim.v
index e9741555c..aa6a5ed52 100644
--- a/techlibs/xilinx/cells_sim.v
+++ b/techlibs/xilinx/cells_sim.v
@@ -2289,9 +2289,15 @@ module DSP48E1 (
output reg [3:0] CARRYOUT,
output reg MULTSIGNOUT,
output OVERFLOW,
+`ifdef YOSYS
+ (* abc9_arrival = \DSP48E1.P_arrival () *)
+`endif
output reg signed [47:0] P,
output reg PATTERNBDETECT,
output reg PATTERNDETECT,
+`ifdef YOSYS
+ (* abc9_arrival = \DSP48E1.PCOUT_arrival () *)
+`endif
output [47:0] PCOUT,
output UNDERFLOW,
input signed [29:0] A,
@@ -2364,6 +2370,77 @@ module DSP48E1 (
parameter [4:0] IS_INMODE_INVERTED = 5'b0;
parameter [6:0] IS_OPMODE_INVERTED = 7'b0;
+`ifdef YOSYS
+ function integer \DSP48E1.P_arrival ;
+ begin
+ \DSP48E1.P_arrival = 0;
+ if (USE_MULT == "MULTIPLY" && USE_DPORT == "FALSE") begin
+ if (PREG != 0) \DSP48E1.P_arrival = 329;
+ // Worst-case from CREG and MREG
+ else if (CREG != 0) \DSP48E1.P_arrival = 1687;
+ else if (MREG != 0) \DSP48E1.P_arrival = 1671;
+ // Worst-case from AREG and BREG
+ else if (AREG != 0) \DSP48E1.P_arrival = 2952;
+ else if (BREG != 0) \DSP48E1.P_arrival = 2813;
+ end
+ else if (USE_MULT == "MULTIPLY" && USE_DPORT == "TRUE") begin
+ if (PREG != 0) \DSP48E1.P_arrival = 329;
+ // Worst-case from CREG and MREG
+ else if (CREG != 0) \DSP48E1.P_arrival = 1687;
+ else if (MREG != 0) \DSP48E1.P_arrival = 1671;
+ // Worst-case from AREG, ADREG, BREG, DREG
+ else if (AREG != 0) \DSP48E1.P_arrival = 3935;
+ else if (DREG != 0) \DSP48E1.P_arrival = 3908;
+ else if (ADREG != 0) \DSP48E1.P_arrival = 2958;
+ else if (BREG != 0) \DSP48E1.P_arrival = 2813;
+ end
+ else if (USE_MULT == "NONE" && USE_DPORT == "FALSE") begin
+ if (PREG != 0) \DSP48E1.P_arrival = 329;
+ // Worst-case from AREG, BREG, CREG
+ else if (CREG != 0) \DSP48E1.P_arrival = 1687;
+ else if (AREG != 0) \DSP48E1.P_arrival = 1632;
+ else if (BREG != 0) \DSP48E1.P_arrival = 1616;
+ end
+ //else
+ // $error("Invalid DSP48E1 configuration");
+ end
+ endfunction
+ function integer \DSP48E1.PCOUT_arrival ;
+ begin
+ \DSP48E1.PCOUT_arrival = 0;
+ if (USE_MULT == "MULTIPLY" && USE_DPORT == "FALSE") begin
+ if (PREG != 0) \DSP48E1.PCOUT_arrival = 435;
+ // Worst-case from CREG and MREG
+ else if (CREG != 0) \DSP48E1.PCOUT_arrival = 1835;
+ else if (MREG != 0) \DSP48E1.PCOUT_arrival = 1819;
+ // Worst-case from AREG and BREG
+ else if (AREG != 0) \DSP48E1.PCOUT_arrival = 3098;
+ else if (BREG != 0) \DSP48E1.PCOUT_arrival = 2960;
+ end
+ else if (USE_MULT == "MULTIPLY" && USE_DPORT == "TRUE") begin
+ if (PREG != 0) \DSP48E1.PCOUT_arrival = 435;
+ // Worst-case from CREG and MREG
+ else if (CREG != 0) \DSP48E1.PCOUT_arrival = 1835;
+ else if (MREG != 0) \DSP48E1.PCOUT_arrival = 1819;
+ // Worst-case from AREG, ADREG, BREG, DREG
+ else if (AREG != 0) \DSP48E1.PCOUT_arrival = 4083;
+ else if (DREG != 0) \DSP48E1.PCOUT_arrival = 4056;
+ else if (BREG != 0) \DSP48E1.PCOUT_arrival = 2960;
+ else if (ADREG != 0) \DSP48E1.PCOUT_arrival = 2859;
+ end
+ else if (USE_MULT == "NONE" && USE_DPORT == "FALSE") begin
+ if (PREG != 0) \DSP48E1.PCOUT_arrival = 435;
+ // Worst-case from AREG, BREG, CREG
+ else if (CREG != 0) \DSP48E1.PCOUT_arrival = 1835;
+ else if (AREG != 0) \DSP48E1.PCOUT_arrival = 1780;
+ else if (BREG != 0) \DSP48E1.PCOUT_arrival = 1765;
+ end
+ //else
+ // $error("Invalid DSP48E1 configuration");
+ end
+ endfunction
+`endif
+
initial begin
`ifndef YOSYS
if (AUTORESET_PATDET != "NO_RESET") $fatal(1, "Unsupported AUTORESET_PATDET value");
@@ -2440,8 +2517,8 @@ module DSP48E1 (
if (CEB2) Br2 <= Br1;
end
end else if (BREG == 1) begin
- //initial Br1 = 25'b0;
- initial Br2 = 25'b0;
+ //initial Br1 = 18'b0;
+ initial Br2 = 18'b0;
always @(posedge CLK)
if (RSTB) begin
Br1 <= 18'b0;
@@ -2488,7 +2565,7 @@ module DSP48E1 (
endgenerate
// A/D input selection and pre-adder
- wire signed [29:0] Ar12_muxed = INMODEr[0] ? Ar1 : Ar2;
+ wire signed [24:0] Ar12_muxed = INMODEr[0] ? Ar1 : Ar2;
wire signed [24:0] Ar12_gated = INMODEr[1] ? 25'b0 : Ar12_muxed;
wire signed [24:0] Dr_gated = INMODEr[2] ? Dr : 25'b0;
wire signed [24:0] AD_result = INMODEr[3] ? (Dr_gated - Ar12_gated) : (Dr_gated + Ar12_gated);