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 boxes thus represents the clock-to-q delay
56 // (arrival time) at P/PCOUT.
57 // Doing so should means that ABC is able to analyse the
58 // worst-case delay through to P, regardless of if it was
59 // through any combinatorial paths (e.g. B, below) or an
60 // internal register (A2REG).
61 // However, the true value of being as complete as this is
62 // questionable since if AREG=1 and BREG=0 (as below)
63 // then the worse-case path would very likely be through B
64 // and very unlikely to be through AREG.Q...?
72 // A >>--X X-| | +--| \
73 // | DSP48E1 |P | |--->> P
74 // | AREG=1 |-------|__/
78 `define ABC_DSP48E1_MUX(__NAME__) """
79 module __NAME__ (input Aq, ADq, Bq, Cq, Dq, Mq, input [47:0] P, input Pq, output [47:0] O);
82 (* abc_box_id=2100 *) `ABC_DSP48E1_MUX(\$__ABC_DSP48E1_MULT_P_MUX )
83 (* abc_box_id=2101 *) `ABC_DSP48E1_MUX(\$__ABC_DSP48E1_MULT_PCOUT_MUX )
84 (* abc_box_id=2102 *) `ABC_DSP48E1_MUX(\$__ABC_DSP48E1_MULT_DPORT_P_MUX )
85 (* abc_box_id=2103 *) `ABC_DSP48E1_MUX(\$__ABC_DSP48E1_MULT_DPORT_PCOUT_MUX )
86 (* abc_box_id=2104 *) `ABC_DSP48E1_MUX(\$__ABC_DSP48E1_P_MUX )
87 (* abc_box_id=2105 *) `ABC_DSP48E1_MUX(\$__ABC_DSP48E1_PCOUT_MUX )
89 `define ABC_DSP48E1(__NAME__) """
90 module \$__ABC_DSP48E1_MULT (
93 output reg CARRYCASCOUT,
94 output reg [3:0] CARRYOUT,
95 output reg MULTSIGNOUT,
97 output reg signed [47:0] P,
98 output PATTERNBDETECT,
102 input signed [29:0] A,
105 input signed [17:0] B,
110 input [2:0] CARRYINSEL,
141 parameter integer ACASCREG = 1;
142 parameter integer ADREG = 1;
143 parameter integer ALUMODEREG = 1;
144 parameter integer AREG = 1;
145 parameter AUTORESET_PATDET = "NO_RESET";
146 parameter A_INPUT = "DIRECT";
147 parameter integer BCASCREG = 1;
148 parameter integer BREG = 1;
149 parameter B_INPUT = "DIRECT";
150 parameter integer CARRYINREG = 1;
151 parameter integer CARRYINSELREG = 1;
152 parameter integer CREG = 1;
153 parameter integer DREG = 1;
154 parameter integer INMODEREG = 1;
155 parameter integer MREG = 1;
156 parameter integer OPMODEREG = 1;
157 parameter integer PREG = 1;
158 parameter SEL_MASK = "MASK";
159 parameter SEL_PATTERN = "PATTERN";
160 parameter USE_DPORT = "FALSE";
161 parameter USE_MULT = "MULTIPLY";
162 parameter USE_PATTERN_DETECT = "NO_PATDET";
163 parameter USE_SIMD = "ONE48";
164 parameter [47:0] MASK = 48'h3FFFFFFFFFFF;
165 parameter [47:0] PATTERN = 48'h000000000000;
166 parameter [3:0] IS_ALUMODE_INVERTED = 4'b0;
167 parameter [0:0] IS_CARRYIN_INVERTED = 1'b0;
168 parameter [0:0] IS_CLK_INVERTED = 1'b0;
169 parameter [4:0] IS_INMODE_INVERTED = 5'b0;
170 parameter [6:0] IS_OPMODE_INVERTED = 7'b0;
173 (* abc_box_id=3000 *) `ABC_DSP48E1(\$__ABC_DSP48E1_MULT )
174 (* abc_box_id=3001 *) `ABC_DSP48E1(\$__ABC_DSP48E1_MULT_DPORT )
175 (* abc_box_id=3002 *) `ABC_DSP48E1(\$__ABC_DSP48E1 )