2 * yosys -- Yosys Open SYnthesis Suite
4 * Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
5 * 2019 Eddie Hung <eddie@fpgeh.com>
7 * Permission to use, copy, modify, and/or distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 // ============================================================================
23 // Box containing MUXF7.[AB] + MUXF8,
24 // Necessary to make these an atomic unit so that
25 // ABC cannot optimise just one of the MUXF7 away
26 // and expect to save on its delay
27 (* abc_box_id = 3, lib_whitebox *)
28 module \$__XILINX_MUXF78 (output O, input I0, I1, I2, I3, S0, S1);
29 assign O = S1 ? (S0 ? I3 : I2)
33 // Box to emulate comb/seq behaviour of RAMD{32,64} and SRL{16,32}
34 // Necessary since RAMD* and SRL* have both combinatorial (i.e.
35 // same-cycle read operation) and sequential (write operation
36 // is only committed on the next clock edge).
37 // To model the combinatorial path, such cells have to be split
38 // into comb and seq parts, with this box modelling only the former.
40 module \$__ABC_LUT6 (input A, input [5:0] S, output Y);
42 // Box to emulate comb/seq behaviour of RAMD128
44 module \$__ABC_LUT7 (input A, input [6:0] S, output Y);
47 // Boxes used to represent the comb/seq behaviour of DSP48E1
48 // With abc_map.v responsible for disconnecting inputs to
49 // the combinatorial DSP48E1 model by a register (e.g.
50 // disconnecting A when AREG, MREG or PREG is enabled)
51 // this blackbox captures the existence of a replacement
52 // path between AREG/BREG/CREG/etc. and P/PCOUT.
53 // Since the Aq/ADq/Bq/etc. inputs are assumed to arrive at
54 // the box at zero time, the combinatorial delay through
55 // these muxes thus represents the clock-to-q delay at
57 // Doing so should means that ABC is able to analyse the
58 // worst-case delay through to P.
59 // However, the true value of being as complete as this is
60 // questionable since if AREG=1 and BREG=0 (as below)
61 // then the worse-case path would very likely be through B
62 // and very unlikely to be through AREG.Q...?
71 // | DSP48E1 |P | |--- P
72 // | AREG=1 |-------|__/
77 module \$__ABC_DSP48E1_MULT_P_MUX (input Aq, ADq, Bq, Cq, Dq, Mq, input [47:0] P, input Pq, output [47:0] O);
80 module \$__ABC_DSP48E1_MULT_PCOUT_MUX (input Aq, ADq, Bq, Cq, Dq, Mq, input [47:0] P, input Pq, output [47:0] O);
84 module \$__ABC_DSP48E1_MULT (
87 output reg CARRYCASCOUT,
88 output reg [3:0] CARRYOUT,
89 output reg MULTSIGNOUT,
91 output reg signed [47:0] P,
92 output PATTERNBDETECT,
96 input signed [29:0] A,
99 input signed [17:0] B,
104 input [2:0] CARRYINSEL,
135 parameter integer ACASCREG = 1;
136 parameter integer ADREG = 1;
137 parameter integer ALUMODEREG = 1;
138 parameter integer AREG = 1;
139 parameter AUTORESET_PATDET = "NO_RESET";
140 parameter A_INPUT = "DIRECT";
141 parameter integer BCASCREG = 1;
142 parameter integer BREG = 1;
143 parameter B_INPUT = "DIRECT";
144 parameter integer CARRYINREG = 1;
145 parameter integer CARRYINSELREG = 1;
146 parameter integer CREG = 1;
147 parameter integer DREG = 1;
148 parameter integer INMODEREG = 1;
149 parameter integer MREG = 1;
150 parameter integer OPMODEREG = 1;
151 parameter integer PREG = 1;
152 parameter SEL_MASK = "MASK";
153 parameter SEL_PATTERN = "PATTERN";
154 parameter USE_DPORT = "FALSE";
155 parameter USE_MULT = "MULTIPLY";
156 parameter USE_PATTERN_DETECT = "NO_PATDET";
157 parameter USE_SIMD = "ONE48";
158 parameter [47:0] MASK = 48'h3FFFFFFFFFFF;
159 parameter [47:0] PATTERN = 48'h000000000000;
160 parameter [3:0] IS_ALUMODE_INVERTED = 4'b0;
161 parameter [0:0] IS_CARRYIN_INVERTED = 1'b0;
162 parameter [0:0] IS_CLK_INVERTED = 1'b0;
163 parameter [4:0] IS_INMODE_INVERTED = 5'b0;
164 parameter [6:0] IS_OPMODE_INVERTED = 7'b0;