1 |
9 |
eejlny |
------------------------------------------------------------------------
|
2 |
|
|
-- LPM 220 Component Declaration Package (Support string type generic)
|
3 |
|
|
-- These models are based on LPM version 220 (EIA-IS103 October 1998).
|
4 |
|
|
------------------------------------------------------------------------
|
5 |
|
|
-- Version Quartus v1.1 (lpm 220) Date 01/23/01
|
6 |
|
|
--
|
7 |
|
|
-- 01/23/01: Adding use_eab=on support for lpm_ram_io, lpm_ram_dp and
|
8 |
|
|
-- lpm_ram_dq.
|
9 |
|
|
------------------------------------------------------------------------
|
10 |
|
|
-- Version 2.1.1 (lpm 220) Date 07/27/00
|
11 |
|
|
--
|
12 |
|
|
-- LPM_LATCH:
|
13 |
|
|
-- Changed Data port to be initialized with 0's.
|
14 |
|
|
-- LPM_DIVIDE:
|
15 |
|
|
-- Added LPM_REMAINDERPOSITIVE parameter. This is a non-LPM 220
|
16 |
|
|
-- standard parameter. It defaults to TRUE for LPM 220 behaviour.
|
17 |
|
|
-- LPM_ADD_SUB:
|
18 |
|
|
-- Changed default value of CIN port to HIGH (0) when subtract.
|
19 |
|
|
-- This behaviour is different from LPM 220 specification, which
|
20 |
|
|
-- probably states the incorrect default value.
|
21 |
|
|
------------------------------------------------------------------------
|
22 |
|
|
-- Version 2.1 (lpm 220) Date 04/05/00
|
23 |
|
|
--
|
24 |
|
|
-- LPM_CONSTANT:
|
25 |
|
|
-- Changed LPM_WIDTH type from positive to natural.
|
26 |
|
|
-- LPM_INV:
|
27 |
|
|
-- Changed LPM_WIDTH type from positive to natural.
|
28 |
|
|
-- LPM_AND:
|
29 |
|
|
-- Changed LPM_WIDTH and LPM_SIZE type from positive to natural.
|
30 |
|
|
-- LPM_OR:
|
31 |
|
|
-- Changed LPM_WIDTH and LPM_SIZE type from positive to natural.
|
32 |
|
|
-- LPM_XOR:
|
33 |
|
|
-- Changed LPM_WIDTH and LPM_SIZE type from positive to natural.
|
34 |
|
|
-- LPM_BUSTRI:
|
35 |
|
|
-- Changed LPM_WIDTH type from positive to natural.
|
36 |
|
|
-- LPM_MUX:
|
37 |
|
|
-- Changed LPM_WIDTH, LPM_SIZE and LPM_WIDTHS type from positive
|
38 |
|
|
-- to natural.
|
39 |
|
|
-- Changed LPM_PIPELINE type from integer to natural.
|
40 |
|
|
-- LPM_DECODE:
|
41 |
|
|
-- Changed LPM_WIDTH and LPM_DECODES type from positive to natural.
|
42 |
|
|
-- Changed LPM_PIPELINE type from integer to natural.
|
43 |
|
|
-- LPM_CLSHIFT:
|
44 |
|
|
-- Changed LPM_WIDTH and LPM_WIDTHDIST type from positive to
|
45 |
|
|
-- natural.
|
46 |
|
|
-- LPM_ADD_SUB:
|
47 |
|
|
-- Changed LPM_WIDTH type from positive to natural.
|
48 |
|
|
-- Changed LPM_PIPELINE type from integer to natural.
|
49 |
|
|
-- LPM_COMPARE:
|
50 |
|
|
-- Changed LPM_WIDTH type from positive to natural.
|
51 |
|
|
-- Changed LPM_PIPELINE type from integer to natural.
|
52 |
|
|
-- LPM_MULT:
|
53 |
|
|
-- Changed LPM_WIDTHA, LPM_WIDTHB and LPM_WIDTHP type from positive
|
54 |
|
|
-- to natural.
|
55 |
|
|
-- Changed LPM_PIPELINE type from integer to natural.
|
56 |
|
|
-- LPM_DIVIDE:
|
57 |
|
|
-- Changed LPM_WIDTHN and LPM_WIDTHD from positive to natural.
|
58 |
|
|
-- Changed LPM_PIPELINE type from integer to natural.
|
59 |
|
|
-- LPM_ABS:
|
60 |
|
|
-- Changed LPM_WIDTH type from positive to natural.
|
61 |
|
|
-- LPM_COUNTER:
|
62 |
|
|
-- Changed LPM_WIDTH type from positive to natural.
|
63 |
|
|
-- LPM_LATCH:
|
64 |
|
|
-- Changed LPM_WIDTH type from positive to natural.
|
65 |
|
|
-- LPM_FF:
|
66 |
|
|
-- Changed LPM_WIDTH type from positive to natural.
|
67 |
|
|
-- LPM_SHIFTREG:
|
68 |
|
|
-- Changed LPM_WIDTH type from positive to natural.
|
69 |
|
|
-- LPM_RAM_DQ:
|
70 |
|
|
-- Changed LPM_WIDTH and LPM_WIDTHAD from positive to natural.
|
71 |
|
|
-- LPM_RAM_DP:
|
72 |
|
|
-- Changed LPM_WIDTH and LPM_WIDTHAD from positive to natural.
|
73 |
|
|
-- LPM_RAM_IO:
|
74 |
|
|
-- Changed LPM_WIDTH and LPM_WIDTHAD from positive to natural.
|
75 |
|
|
-- LPM_ROM:
|
76 |
|
|
-- Changed LPM_WIDTH and LPM_WIDTHAD from positive to natural.
|
77 |
|
|
-- LPM_FIFO:
|
78 |
|
|
-- Changed LPM_WIDTH, LPM_WIDTHU and LPM_NUMWORDS from positive to
|
79 |
|
|
-- natural.
|
80 |
|
|
-- LPM_FIFO_DC:
|
81 |
|
|
-- Changed LPM_WIDTH, LPM_WIDTHU and LPM_NUMWORDS from positive to
|
82 |
|
|
-- natural.
|
83 |
|
|
-- LPM_TTABLE:
|
84 |
|
|
-- Changed LPM_WIDTHIN and LPM_WIDTHOUT from positive to natural.
|
85 |
|
|
-- LPM_FSM:
|
86 |
|
|
-- Changed LPM_WIDTHIN, LPM_WIDTHOUT and LPM_WIDTHS from positive
|
87 |
|
|
-- to natural.
|
88 |
|
|
-- LPM_INPAD:
|
89 |
|
|
-- Changed LPM_WIDTH type from positive to natural.
|
90 |
|
|
-- LPM_OUTPAD:
|
91 |
|
|
-- Changed LPM_WIDTH type from positive to natural.
|
92 |
|
|
-- LPM_BIPAD:
|
93 |
|
|
-- Changed LPM_WIDTH type from positive to natural.
|
94 |
|
|
------------------------------------------------------------------------
|
95 |
|
|
-- Version 1.8 (lpm 220) Date 10/21/99
|
96 |
|
|
--
|
97 |
|
|
-- Fixed str_to_int() to correctly convert string to integer.
|
98 |
|
|
------------------------------------------------------------------------
|
99 |
|
|
-- Version 1.7 (lpm 220) Date 07/13/99
|
100 |
|
|
--
|
101 |
|
|
-- Changed OutEnab and WE in LPM_RAM_IO to default to 'Z'.
|
102 |
|
|
------------------------------------------------------------------------
|
103 |
|
|
-- Version 1.6 (lpm 220) Date 06/14/99
|
104 |
|
|
--
|
105 |
|
|
-- Added LPM_HINT and LPM_TYPE to all, if not existed.
|
106 |
|
|
-- Changed all clock signals default value to '0'.
|
107 |
|
|
-- Changed default values of parameters to comply with the spec.
|
108 |
|
|
--
|
109 |
|
|
-- LPM_BUSTRI:
|
110 |
|
|
-- Renamed TRDATA to TRIDATA.
|
111 |
|
|
-- LPM_MULT:
|
112 |
|
|
-- Changed LPM_WIDTHS type from positive to natural, default to 0.
|
113 |
|
|
-- LPM_DIVIDE:
|
114 |
|
|
-- Discarded LPM_WIDTHD and LPM_WIDTHR.
|
115 |
|
|
-- LPM_COUNTER:
|
116 |
|
|
-- Discarded EQ.
|
117 |
|
|
-- Added CIN and COUT.
|
118 |
|
|
-- Changed LPM_MODULUS type from integer to natural.
|
119 |
|
|
-- LPM_FF:
|
120 |
|
|
-- Added LPM_PVALUE, default to "UNUSED".
|
121 |
|
|
-- Changed LPM_FFTYPE default value from "FFTYPE_DFF" to "DFF".
|
122 |
|
|
-- LPM_SHIFTREG:
|
123 |
|
|
-- Added LPM_PVALUE, default to "UNUSED".
|
124 |
|
|
-- LPM_RAM_DQ:
|
125 |
|
|
-- Changed LPM_NUMWORDS type from integer to natrual.
|
126 |
|
|
-- Changed WE to have no default value.
|
127 |
|
|
-- LPM_RAM_DP:
|
128 |
|
|
-- Changed LPM_NUMWORDS type from integer to natrual.
|
129 |
|
|
-- Changed RDCLKEN default value from '0' to '1'.
|
130 |
|
|
-- LPM_RAM_IO:
|
131 |
|
|
-- Changed LPM_NUMWORDS type from integer to natrual.
|
132 |
|
|
-- LPM_ROM:
|
133 |
|
|
-- Changed LPM_NUMWORDS type from integer to natrual.
|
134 |
|
|
-- LPM_FIFO:
|
135 |
|
|
-- Added LPM_WIDTHU default value '1'.
|
136 |
|
|
-- Added ACLR and SCLR default value '0'.
|
137 |
|
|
-- LPM_FSM:
|
138 |
|
|
-- Added LPM_PVALUE, default to "UNUSED".
|
139 |
|
|
-- Added TESTENAB and TESTIN, default to '0'.
|
140 |
|
|
-- Added TESTOUT.
|
141 |
|
|
------------------------------------------------------------------------
|
142 |
|
|
-- Version 1.5 (lpm 220) Date 05/10/99
|
143 |
|
|
--
|
144 |
|
|
-- Added 0 default value to LPM_NUMWORD parameter in LPM_RAM_DQ,
|
145 |
|
|
-- LPM_RAM_IO, and LPM_ROM. Also added 0 default value to LPM_MODULUS.
|
146 |
|
|
------------------------------------------------------------------------
|
147 |
|
|
-- Version 1.4 (lpm 220) Date 02/05/99
|
148 |
|
|
--
|
149 |
|
|
-- Removed the constant declarations for string type parameters.
|
150 |
|
|
-- Changed LPM_NUMWORDS type from string to positive.
|
151 |
|
|
-- Added LPM_DIVIDE, LPM_RAM_DP, LPM_FIFO, and LPM_SCFIFO functions.
|
152 |
|
|
------------------------------------------------------------------------
|
153 |
|
|
-- Version 1.3 Date 07/30/97
|
154 |
|
|
------------------------------------------------------------------------
|
155 |
|
|
-- Excluded:
|
156 |
|
|
--
|
157 |
|
|
-- 1. LPM_POLARITY.
|
158 |
|
|
-- 2. SCAN pins are eliminated from storage functions.
|
159 |
|
|
------------------------------------------------------------------------
|
160 |
|
|
-- Assumptions:
|
161 |
|
|
--
|
162 |
|
|
-- LPM_SVALUE, LPM_AVALUE, LPM_MODULUS, and LPM_NUMWORDS, LPM_HINT,
|
163 |
|
|
-- LPM_STRENGTH, LPM_DIRECTION, and LPM_PVALUE default value is
|
164 |
|
|
-- string "UNUSED".
|
165 |
|
|
------------------------------------------------------------------------
|
166 |
|
|
|
167 |
|
|
library IEEE;
|
168 |
|
|
use IEEE.std_logic_1164.all;
|
169 |
|
|
|
170 |
|
|
package LPM_COMPONENTS is
|
171 |
|
|
|
172 |
|
|
constant L_CONSTANT : string := "LPM_CONSTANT";
|
173 |
|
|
constant L_INV : string := "LPM_INV";
|
174 |
|
|
constant L_AND : string := "LPM_AND";
|
175 |
|
|
constant L_OR : string := "LPM_OR";
|
176 |
|
|
constant L_XOR : string := "LPM_XOR";
|
177 |
|
|
constant L_BUSTRI : string := "LPM_BUSTRI";
|
178 |
|
|
constant L_MUX : string := "LPM_MUX";
|
179 |
|
|
constant L_DECODE : string := "LPM_DECODE";
|
180 |
|
|
constant L_CLSHIFT : string := "LPM_CLSHIFT";
|
181 |
|
|
constant L_ADD_SUB : string := "LPM_ADD_SUB";
|
182 |
|
|
constant L_COMPARE : string := "LPM_COMPARE";
|
183 |
|
|
constant L_MULT : string := "LPM_MULT";
|
184 |
|
|
constant L_DIVIDE : string := "LPM_DIVIDE";
|
185 |
|
|
constant L_ABS : string := "LPM_ABS";
|
186 |
|
|
constant L_COUNTER : string := "LPM_COUNTER";
|
187 |
|
|
constant L_LATCH : string := "LPM_LATCH";
|
188 |
|
|
constant L_FF : string := "LPM_FF";
|
189 |
|
|
constant L_SHIFTREG : string := "LPM_SHIFTREG";
|
190 |
|
|
constant L_RAM_DQ : string := "LPM_RAM_DQ";
|
191 |
|
|
constant L_RAM_DP : string := "LPM_RAM_DP";
|
192 |
|
|
constant L_RAM_IO : string := "LPM_RAM_IO";
|
193 |
|
|
constant L_ROM : string := "LPM_ROM";
|
194 |
|
|
constant L_FIFO : string := "LPM_FIFO";
|
195 |
|
|
constant L_FIFO_DC : string := "LPM_FIFO_DC";
|
196 |
|
|
constant L_TTABLE : string := "LPM_TTABLE";
|
197 |
|
|
constant L_FSM : string := "LPM_FSM";
|
198 |
|
|
constant L_INPAD : string := "LPM_INPAD";
|
199 |
|
|
constant L_OUTPAD : string := "LPM_OUTPAD";
|
200 |
|
|
constant L_BIPAD : string := "LPM_BIPAD";
|
201 |
|
|
type STD_LOGIC_2D is array (NATURAL RANGE <>, NATURAL RANGE <>) of STD_LOGIC;
|
202 |
|
|
function str_to_int(S : string) return integer;
|
203 |
|
|
|
204 |
|
|
|
205 |
|
|
------------------------------------------------------------------------
|
206 |
|
|
-- GATES ---------------------------------------------------------------
|
207 |
|
|
------------------------------------------------------------------------
|
208 |
|
|
|
209 |
|
|
component LPM_CONSTANT
|
210 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
211 |
|
|
LPM_CVALUE : natural;
|
212 |
|
|
LPM_STRENGTH : string := "UNUSED";
|
213 |
|
|
LPM_TYPE : string := L_CONSTANT;
|
214 |
|
|
LPM_HINT : string := "UNUSED");
|
215 |
|
|
port (RESULT : out std_logic_vector(LPM_WIDTH-1 downto 0));
|
216 |
|
|
end component;
|
217 |
|
|
|
218 |
|
|
component LPM_INV
|
219 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
220 |
|
|
LPM_TYPE : string := L_INV;
|
221 |
|
|
LPM_HINT : string := "UNUSED");
|
222 |
|
|
port (DATA : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
223 |
|
|
RESULT : out std_logic_vector(LPM_WIDTH-1 downto 0));
|
224 |
|
|
end component;
|
225 |
|
|
|
226 |
|
|
component LPM_AND
|
227 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
228 |
|
|
LPM_SIZE : natural; -- MUST be greater than 0
|
229 |
|
|
LPM_TYPE : string := L_AND;
|
230 |
|
|
LPM_HINT : string := "UNUSED");
|
231 |
|
|
port (DATA : in std_logic_2D(LPM_SIZE-1 downto 0, LPM_WIDTH-1 downto 0);
|
232 |
|
|
RESULT : out std_logic_vector(LPM_WIDTH-1 downto 0));
|
233 |
|
|
end component;
|
234 |
|
|
|
235 |
|
|
component LPM_OR
|
236 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
237 |
|
|
LPM_SIZE : natural; -- MUST be greater than 0
|
238 |
|
|
LPM_TYPE : string := L_OR;
|
239 |
|
|
LPM_HINT : string := "UNUSED");
|
240 |
|
|
port (DATA : in std_logic_2D(LPM_SIZE-1 downto 0, LPM_WIDTH-1 downto 0);
|
241 |
|
|
RESULT : out std_logic_vector(LPM_WIDTH-1 downto 0));
|
242 |
|
|
end component;
|
243 |
|
|
|
244 |
|
|
component LPM_XOR
|
245 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
246 |
|
|
LPM_SIZE : natural; -- MUST be greater than 0
|
247 |
|
|
LPM_TYPE : string := L_XOR;
|
248 |
|
|
LPM_HINT : string := "UNUSED");
|
249 |
|
|
port (DATA : in std_logic_2D(LPM_SIZE-1 downto 0, LPM_WIDTH-1 downto 0);
|
250 |
|
|
RESULT : out std_logic_vector(LPM_WIDTH-1 downto 0));
|
251 |
|
|
end component;
|
252 |
|
|
|
253 |
|
|
component LPM_BUSTRI
|
254 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
255 |
|
|
LPM_TYPE : string := L_BUSTRI;
|
256 |
|
|
LPM_HINT : string := "UNUSED");
|
257 |
|
|
port (DATA : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
258 |
|
|
ENABLEDT : in std_logic := '0';
|
259 |
|
|
ENABLETR : in std_logic := '0';
|
260 |
|
|
RESULT : out std_logic_vector(LPM_WIDTH-1 downto 0);
|
261 |
|
|
TRIDATA : inout std_logic_vector(LPM_WIDTH-1 downto 0));
|
262 |
|
|
end component;
|
263 |
|
|
|
264 |
|
|
component LPM_MUX
|
265 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
266 |
|
|
LPM_SIZE : natural; -- MUST be greater than 0
|
267 |
|
|
LPM_WIDTHS : natural; -- MUST be greater than 0
|
268 |
|
|
LPM_PIPELINE : natural := 0;
|
269 |
|
|
LPM_TYPE : string := L_MUX;
|
270 |
|
|
LPM_HINT : string := "UNUSED");
|
271 |
|
|
port (DATA : in std_logic_2D(LPM_SIZE-1 downto 0, LPM_WIDTH-1 downto 0);
|
272 |
|
|
ACLR : in std_logic := '0';
|
273 |
|
|
CLOCK : in std_logic := '0';
|
274 |
|
|
CLKEN : in std_logic := '1';
|
275 |
|
|
SEL : in std_logic_vector(LPM_WIDTHS-1 downto 0);
|
276 |
|
|
RESULT : out std_logic_vector(LPM_WIDTH-1 downto 0));
|
277 |
|
|
end component;
|
278 |
|
|
|
279 |
|
|
component LPM_DECODE
|
280 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
281 |
|
|
LPM_DECODES : natural; -- MUST be greater than 0
|
282 |
|
|
LPM_PIPELINE : natural := 0;
|
283 |
|
|
LPM_TYPE : string := L_DECODE;
|
284 |
|
|
LPM_HINT : string := "UNUSED");
|
285 |
|
|
port (DATA : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
286 |
|
|
CLOCK : in std_logic := '0';
|
287 |
|
|
CLKEN : in std_logic := '1';
|
288 |
|
|
ACLR : in std_logic := '0';
|
289 |
|
|
ENABLE : in std_logic := '1';
|
290 |
|
|
EQ : out std_logic_vector(LPM_DECODES-1 downto 0));
|
291 |
|
|
end component;
|
292 |
|
|
|
293 |
|
|
component LPM_CLSHIFT
|
294 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
295 |
|
|
LPM_WIDTHDIST : natural; -- MUST be greater than 0
|
296 |
|
|
LPM_SHIFTTYPE : string := "LOGICAL";
|
297 |
|
|
LPM_TYPE : string := L_CLSHIFT;
|
298 |
|
|
LPM_HINT : string := "UNUSED");
|
299 |
|
|
port (DATA : in STD_LOGIC_VECTOR(LPM_WIDTH-1 downto 0);
|
300 |
|
|
DISTANCE : in STD_LOGIC_VECTOR(LPM_WIDTHDIST-1 downto 0);
|
301 |
|
|
DIRECTION : in STD_LOGIC := '0';
|
302 |
|
|
RESULT : out STD_LOGIC_VECTOR(LPM_WIDTH-1 downto 0);
|
303 |
|
|
UNDERFLOW : out STD_LOGIC;
|
304 |
|
|
OVERFLOW : out STD_LOGIC);
|
305 |
|
|
end component;
|
306 |
|
|
|
307 |
|
|
|
308 |
|
|
------------------------------------------------------------------------
|
309 |
|
|
-- ARITHMETIC COMPONENTS -----------------------------------------------
|
310 |
|
|
------------------------------------------------------------------------
|
311 |
|
|
|
312 |
|
|
component LPM_ADD_SUB
|
313 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
314 |
|
|
LPM_DIRECTION : string := "UNUSED";
|
315 |
|
|
LPM_REPRESENTATION: string := "SIGNED";
|
316 |
|
|
LPM_PIPELINE : natural := 0;
|
317 |
|
|
LPM_TYPE : string := L_ADD_SUB;
|
318 |
|
|
LPM_HINT : string := "UNUSED");
|
319 |
|
|
port (DATAA : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
320 |
|
|
DATAB : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
321 |
|
|
ACLR : in std_logic := '0';
|
322 |
|
|
CLOCK : in std_logic := '0';
|
323 |
|
|
CLKEN : in std_logic := '1';
|
324 |
|
|
CIN : in std_logic := 'Z';
|
325 |
|
|
ADD_SUB : in std_logic := '1';
|
326 |
|
|
RESULT : out std_logic_vector(LPM_WIDTH-1 downto 0);
|
327 |
|
|
COUT : out std_logic;
|
328 |
|
|
OVERFLOW : out std_logic);
|
329 |
|
|
end component;
|
330 |
|
|
|
331 |
|
|
component LPM_COMPARE
|
332 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
333 |
|
|
LPM_REPRESENTATION : string := "UNSIGNED";
|
334 |
|
|
LPM_PIPELINE : natural := 0;
|
335 |
|
|
LPM_TYPE: string := L_COMPARE;
|
336 |
|
|
LPM_HINT : string := "UNUSED");
|
337 |
|
|
port (DATAA : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
338 |
|
|
DATAB : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
339 |
|
|
ACLR : in std_logic := '0';
|
340 |
|
|
CLOCK : in std_logic := '0';
|
341 |
|
|
CLKEN : in std_logic := '1';
|
342 |
|
|
AGB : out std_logic;
|
343 |
|
|
AGEB : out std_logic;
|
344 |
|
|
AEB : out std_logic;
|
345 |
|
|
ANEB : out std_logic;
|
346 |
|
|
ALB : out std_logic;
|
347 |
|
|
ALEB : out std_logic);
|
348 |
|
|
end component;
|
349 |
|
|
|
350 |
|
|
component LPM_MULT
|
351 |
|
|
generic (LPM_WIDTHA : natural; -- MUST be greater than 0
|
352 |
|
|
LPM_WIDTHB : natural; -- MUST be greater than 0
|
353 |
|
|
LPM_WIDTHS : natural := 0;
|
354 |
|
|
LPM_WIDTHP : natural; -- MUST be greater than 0
|
355 |
|
|
LPM_REPRESENTATION : string := "UNSIGNED";
|
356 |
|
|
LPM_PIPELINE : natural := 0;
|
357 |
|
|
LPM_TYPE: string := L_MULT;
|
358 |
|
|
LPM_HINT : string := "UNUSED");
|
359 |
|
|
port (DATAA : in std_logic_vector(LPM_WIDTHA-1 downto 0);
|
360 |
|
|
DATAB : in std_logic_vector(LPM_WIDTHB-1 downto 0);
|
361 |
|
|
ACLR : in std_logic := '0';
|
362 |
|
|
CLOCK : in std_logic := '0';
|
363 |
|
|
CLKEN : in std_logic := '1';
|
364 |
|
|
SUM : in std_logic_vector(LPM_WIDTHS-1 downto 0) := (OTHERS => '0');
|
365 |
|
|
RESULT : out std_logic_vector(LPM_WIDTHP-1 downto 0));
|
366 |
|
|
end component;
|
367 |
|
|
|
368 |
|
|
component LPM_DIVIDE
|
369 |
|
|
generic (LPM_WIDTHN : natural; -- MUST be greater than 0
|
370 |
|
|
LPM_WIDTHD : natural; -- MUST be greater than 0
|
371 |
|
|
LPM_NREPRESENTATION : string := "UNSIGNED";
|
372 |
|
|
LPM_DREPRESENTATION : string := "UNSIGNED";
|
373 |
|
|
LPM_REMAINDERPOSITIVE : string := "TRUE";
|
374 |
|
|
LPM_PIPELINE : natural := 0;
|
375 |
|
|
LPM_TYPE : string := L_DIVIDE;
|
376 |
|
|
LPM_HINT : string := "UNUSED");
|
377 |
|
|
port (NUMER : in std_logic_vector(LPM_WIDTHN-1 downto 0);
|
378 |
|
|
DENOM : in std_logic_vector(LPM_WIDTHD-1 downto 0);
|
379 |
|
|
ACLR : in std_logic := '0';
|
380 |
|
|
CLOCK : in std_logic := '0';
|
381 |
|
|
CLKEN : in std_logic := '1';
|
382 |
|
|
QUOTIENT : out std_logic_vector(LPM_WIDTHN-1 downto 0);
|
383 |
|
|
REMAIN : out std_logic_vector(LPM_WIDTHD-1 downto 0));
|
384 |
|
|
end component;
|
385 |
|
|
|
386 |
|
|
component LPM_ABS
|
387 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
388 |
|
|
LPM_TYPE: string := L_ABS;
|
389 |
|
|
LPM_HINT : string := "UNUSED");
|
390 |
|
|
port (DATA : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
391 |
|
|
RESULT : out std_logic_vector(LPM_WIDTH-1 downto 0);
|
392 |
|
|
OVERFLOW : out std_logic);
|
393 |
|
|
end component;
|
394 |
|
|
|
395 |
|
|
component LPM_COUNTER
|
396 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
397 |
|
|
LPM_MODULUS : natural := 0;
|
398 |
|
|
LPM_DIRECTION : string := "UNUSED";
|
399 |
|
|
LPM_AVALUE : string := "UNUSED";
|
400 |
|
|
LPM_SVALUE : string := "UNUSED";
|
401 |
|
|
LPM_PVALUE : string := "UNUSED";
|
402 |
|
|
LPM_TYPE: string := L_COUNTER;
|
403 |
|
|
LPM_HINT : string := "UNUSED");
|
404 |
|
|
port (DATA : in std_logic_vector(LPM_WIDTH-1 downto 0):= (OTHERS => '0');
|
405 |
|
|
CLOCK : in std_logic ;
|
406 |
|
|
CLK_EN : in std_logic := '1';
|
407 |
|
|
CNT_EN : in std_logic := '1';
|
408 |
|
|
UPDOWN : in std_logic := '1';
|
409 |
|
|
SLOAD : in std_logic := '0';
|
410 |
|
|
SSET : in std_logic := '0';
|
411 |
|
|
SCLR : in std_logic := '0';
|
412 |
|
|
ALOAD : in std_logic := '0';
|
413 |
|
|
ASET : in std_logic := '0';
|
414 |
|
|
ACLR : in std_logic := '0';
|
415 |
|
|
CIN : in std_logic := '1';
|
416 |
|
|
COUT : out std_logic := '0';
|
417 |
|
|
Q : out std_logic_vector(LPM_WIDTH-1 downto 0));
|
418 |
|
|
end component;
|
419 |
|
|
|
420 |
|
|
|
421 |
|
|
------------------------------------------------------------------------
|
422 |
|
|
-- STORAGE COMPONENTS --------------------------------------------------
|
423 |
|
|
------------------------------------------------------------------------
|
424 |
|
|
|
425 |
|
|
component LPM_LATCH
|
426 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
427 |
|
|
LPM_AVALUE : string := "UNUSED";
|
428 |
|
|
LPM_PVALUE : string := "UNUSED";
|
429 |
|
|
LPM_TYPE: string := L_LATCH;
|
430 |
|
|
LPM_HINT : string := "UNUSED");
|
431 |
|
|
port (DATA : in std_logic_vector(LPM_WIDTH-1 downto 0) := (OTHERS => '0');
|
432 |
|
|
GATE : in std_logic;
|
433 |
|
|
ASET : in std_logic := '0';
|
434 |
|
|
ACLR : in std_logic := '0';
|
435 |
|
|
Q : out std_logic_vector(LPM_WIDTH-1 downto 0));
|
436 |
|
|
end component;
|
437 |
|
|
|
438 |
|
|
component LPM_FF
|
439 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
440 |
|
|
LPM_AVALUE : string := "UNUSED";
|
441 |
|
|
LPM_SVALUE : string := "UNUSED";
|
442 |
|
|
LPM_PVALUE : string := "UNUSED";
|
443 |
|
|
LPM_FFTYPE: string := "DFF";
|
444 |
|
|
LPM_TYPE: string := L_FF;
|
445 |
|
|
LPM_HINT : string := "UNUSED");
|
446 |
|
|
port (DATA : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
447 |
|
|
CLOCK : in std_logic;
|
448 |
|
|
ENABLE : in std_logic := '1';
|
449 |
|
|
SLOAD : in std_logic := '0';
|
450 |
|
|
SCLR : in std_logic := '0';
|
451 |
|
|
SSET : in std_logic := '0';
|
452 |
|
|
ALOAD : in std_logic := '0';
|
453 |
|
|
ACLR : in std_logic := '0';
|
454 |
|
|
ASET : in std_logic := '0';
|
455 |
|
|
Q : out std_logic_vector(LPM_WIDTH-1 downto 0));
|
456 |
|
|
end component;
|
457 |
|
|
|
458 |
|
|
component LPM_SHIFTREG
|
459 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
460 |
|
|
LPM_AVALUE : string := "UNUSED";
|
461 |
|
|
LPM_SVALUE : string := "UNUSED";
|
462 |
|
|
LPM_PVALUE : string := "UNUSED";
|
463 |
|
|
LPM_DIRECTION: string := "UNUSED";
|
464 |
|
|
LPM_TYPE: string := L_SHIFTREG;
|
465 |
|
|
LPM_HINT : string := "UNUSED");
|
466 |
|
|
port (DATA : in std_logic_vector(LPM_WIDTH-1 downto 0) := (OTHERS => '0');
|
467 |
|
|
CLOCK : in std_logic;
|
468 |
|
|
ENABLE : in std_logic := '1';
|
469 |
|
|
SHIFTIN : in std_logic := '1';
|
470 |
|
|
LOAD : in std_logic := '0';
|
471 |
|
|
SCLR : in std_logic := '0';
|
472 |
|
|
SSET : in std_logic := '0';
|
473 |
|
|
ACLR : in std_logic := '0';
|
474 |
|
|
ASET : in std_logic := '0';
|
475 |
|
|
Q : out std_logic_vector(LPM_WIDTH-1 downto 0);
|
476 |
|
|
SHIFTOUT : out std_logic);
|
477 |
|
|
end component;
|
478 |
|
|
|
479 |
|
|
component LPM_RAM_DQ
|
480 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
481 |
|
|
LPM_WIDTHAD : natural; -- MUST be greater than 0
|
482 |
|
|
LPM_NUMWORDS : natural := 0;
|
483 |
|
|
LPM_INDATA : string := "REGISTERED";
|
484 |
|
|
LPM_ADDRESS_CONTROL: string := "REGISTERED";
|
485 |
|
|
LPM_OUTDATA : string := "REGISTERED";
|
486 |
|
|
LPM_FILE : string := "UNUSED";
|
487 |
|
|
LPM_TYPE : string := L_RAM_DQ;
|
488 |
|
|
USE_EAB : string := "OFF";
|
489 |
|
|
INTENDED_DEVICE_FAMILY : string := "UNUSED";
|
490 |
|
|
LPM_HINT : string := "UNUSED");
|
491 |
|
|
port (DATA : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
492 |
|
|
ADDRESS : in std_logic_vector(LPM_WIDTHAD-1 downto 0);
|
493 |
|
|
INCLOCK : in std_logic := '0';
|
494 |
|
|
OUTCLOCK : in std_logic := '0';
|
495 |
|
|
WE : in std_logic;
|
496 |
|
|
Q : out std_logic_vector(LPM_WIDTH-1 downto 0));
|
497 |
|
|
end component;
|
498 |
|
|
|
499 |
|
|
component LPM_RAM_DP
|
500 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
501 |
|
|
LPM_WIDTHAD : natural; -- MUST be greater than 0
|
502 |
|
|
LPM_NUMWORDS : natural := 0;
|
503 |
|
|
LPM_INDATA : string := "REGISTERED";
|
504 |
|
|
LPM_OUTDATA : string := "REGISTERED";
|
505 |
|
|
LPM_RDADDRESS_CONTROL : string := "REGISTERED";
|
506 |
|
|
LPM_WRADDRESS_CONTROL : string := "REGISTERED";
|
507 |
|
|
LPM_FILE : string := "UNUSED";
|
508 |
|
|
LPM_TYPE : string := L_RAM_DP;
|
509 |
|
|
USE_EAB : string := "OFF";
|
510 |
|
|
INTENDED_DEVICE_FAMILY : string := "UNUSED";
|
511 |
|
|
RDEN_USED : string := "TRUE";
|
512 |
|
|
LPM_HINT : string := "UNUSED");
|
513 |
|
|
port (RDCLOCK : in std_logic := '0';
|
514 |
|
|
RDCLKEN : in std_logic := '1';
|
515 |
|
|
RDADDRESS : in std_logic_vector(LPM_WIDTHad-1 downto 0);
|
516 |
|
|
RDEN : in std_logic := '1';
|
517 |
|
|
DATA : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
518 |
|
|
WRADDRESS : in std_logic_vector(LPM_WIDTHad-1 downto 0);
|
519 |
|
|
WREN : in std_logic;
|
520 |
|
|
WRCLOCK : in std_logic := '0';
|
521 |
|
|
WRCLKEN : in std_logic := '1';
|
522 |
|
|
Q : out std_logic_vector(LPM_WIDTH-1 downto 0));
|
523 |
|
|
end component;
|
524 |
|
|
|
525 |
|
|
component LPM_RAM_IO
|
526 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
527 |
|
|
LPM_WIDTHAD : natural; -- MUST be greater than 0
|
528 |
|
|
LPM_NUMWORDS : natural := 0;
|
529 |
|
|
LPM_INDATA : string := "REGISTERED";
|
530 |
|
|
LPM_ADDRESS_CONTROL : string := "REGISTERED";
|
531 |
|
|
LPM_OUTDATA : string := "REGISTERED";
|
532 |
|
|
LPM_FILE : string := "UNUSED";
|
533 |
|
|
LPM_TYPE : string := L_RAM_IO;
|
534 |
|
|
INTENDED_DEVICE_FAMILY : string := "UNUSED";
|
535 |
|
|
USE_EAB : string := "OFF";
|
536 |
|
|
LPM_HINT : string := "UNUSED");
|
537 |
|
|
port (ADDRESS : in STD_LOGIC_VECTOR(LPM_WIDTHAD-1 downto 0);
|
538 |
|
|
INCLOCK : in STD_LOGIC := '0';
|
539 |
|
|
OUTCLOCK : in STD_LOGIC := '0';
|
540 |
|
|
MEMENAB : in STD_LOGIC := '1';
|
541 |
|
|
OUTENAB : in STD_LOGIC := 'Z';
|
542 |
|
|
WE : in STD_LOGIC := 'Z';
|
543 |
|
|
DIO : inout STD_LOGIC_VECTOR(LPM_WIDTH-1 downto 0));
|
544 |
|
|
end component;
|
545 |
|
|
|
546 |
|
|
component LPM_ROM
|
547 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
548 |
|
|
LPM_WIDTHAD : natural; -- MUST be greater than 0
|
549 |
|
|
LPM_NUMWORDS : natural := 0;
|
550 |
|
|
LPM_ADDRESS_CONTROL : string := "REGISTERED";
|
551 |
|
|
LPM_OUTDATA : string := "REGISTERED";
|
552 |
|
|
LPM_FILE : string;
|
553 |
|
|
LPM_TYPE : string := L_ROM;
|
554 |
|
|
INTENDED_DEVICE_FAMILY : string := "UNUSED";
|
555 |
|
|
LPM_HINT : string := "UNUSED");
|
556 |
|
|
port (ADDRESS : in STD_LOGIC_VECTOR(LPM_WIDTHAD-1 downto 0);
|
557 |
|
|
INCLOCK : in STD_LOGIC := '0';
|
558 |
|
|
OUTCLOCK : in STD_LOGIC := '0';
|
559 |
|
|
MEMENAB : in STD_LOGIC := '1';
|
560 |
|
|
Q : out STD_LOGIC_VECTOR(LPM_WIDTH-1 downto 0));
|
561 |
|
|
end component;
|
562 |
|
|
|
563 |
|
|
component LPM_FIFO
|
564 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
565 |
|
|
LPM_WIDTHU : natural := 1; -- MUST be greater than 0
|
566 |
|
|
LPM_NUMWORDS : natural; -- MUST be greater than 0
|
567 |
|
|
LPM_SHOWAHEAD : string := "OFF";
|
568 |
|
|
LPM_TYPE : string := L_FIFO;
|
569 |
|
|
LPM_HINT : string := "UNUSED");
|
570 |
|
|
port (DATA : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
571 |
|
|
CLOCK : in std_logic;
|
572 |
|
|
WRREQ : in std_logic;
|
573 |
|
|
RDREQ : in std_logic;
|
574 |
|
|
ACLR : in std_logic := '0';
|
575 |
|
|
SCLR : in std_logic := '0';
|
576 |
|
|
Q : out std_logic_vector(LPM_WIDTH-1 downto 0);
|
577 |
|
|
USEDW : out std_logic_vector(LPM_WIDTHU-1 downto 0);
|
578 |
|
|
FULL : out std_logic;
|
579 |
|
|
EMPTY : out std_logic);
|
580 |
|
|
end component;
|
581 |
|
|
|
582 |
|
|
component LPM_FIFO_DC
|
583 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
584 |
|
|
LPM_WIDTHU : natural := 1; -- MUST be greater than 0
|
585 |
|
|
LPM_NUMWORDS : natural; -- MUST be greater than 0
|
586 |
|
|
LPM_SHOWAHEAD : string := "OFF";
|
587 |
|
|
LPM_TYPE : string := L_FIFO_DC;
|
588 |
|
|
UNDERFLOW_CHECKING : string := "ON";
|
589 |
|
|
OVERFLOW_CHECKING : string := "ON";
|
590 |
|
|
LPM_HINT : string := "UNUSED");
|
591 |
|
|
port (DATA : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
592 |
|
|
WRCLOCK : in std_logic;
|
593 |
|
|
RDCLOCK : in std_logic;
|
594 |
|
|
WRREQ : in std_logic;
|
595 |
|
|
RDREQ : in std_logic;
|
596 |
|
|
ACLR : in std_logic := '0';
|
597 |
|
|
Q : out std_logic_vector(LPM_WIDTH-1 downto 0);
|
598 |
|
|
WRUSEDW : out std_logic_vector(LPM_WIDTHU-1 downto 0);
|
599 |
|
|
RDUSEDW : out std_logic_vector(LPM_WIDTHU-1 downto 0);
|
600 |
|
|
WRFULL : out std_logic;
|
601 |
|
|
RDFULL : out std_logic;
|
602 |
|
|
WREMPTY : out std_logic;
|
603 |
|
|
RDEMPTY : out std_logic);
|
604 |
|
|
end component;
|
605 |
|
|
|
606 |
|
|
|
607 |
|
|
------------------------------------------------------------------------
|
608 |
|
|
-- TABLE PRIMITIVES ----------------------------------------------------
|
609 |
|
|
------------------------------------------------------------------------
|
610 |
|
|
|
611 |
|
|
component LPM_TTABLE
|
612 |
|
|
generic (LPM_WIDTHIN : natural; -- MUST be greater than 0
|
613 |
|
|
LPM_WIDTHOUT : natural; -- MUST be greater than 0
|
614 |
|
|
LPM_FILE : string;
|
615 |
|
|
LPM_TRUTHTYPE : string := "FD";
|
616 |
|
|
LPM_TYPE : string := L_TTABLE;
|
617 |
|
|
LPM_HINT : string := "UNUSED");
|
618 |
|
|
port (DATA : in std_logic_vector(LPM_WIDTHIN-1 downto 0);
|
619 |
|
|
RESULT : out std_logic_vector(LPM_WIDTHOUT-1 downto 0));
|
620 |
|
|
end component;
|
621 |
|
|
|
622 |
|
|
component LPM_FSM
|
623 |
|
|
generic (LPM_WIDTHIN : natural; -- MUST be greater than 0
|
624 |
|
|
LPM_WIDTHOUT : natural; -- MUST be greater than 0
|
625 |
|
|
LPM_WIDTHS : natural := 1; -- MUST be greater than 0
|
626 |
|
|
LPM_FILE : string ;
|
627 |
|
|
LPM_PVALUE : string := "UNUSED";
|
628 |
|
|
LPM_AVALUE : string := "UNUSED";
|
629 |
|
|
LPM_TRUTHTYPE : string := "FD";
|
630 |
|
|
LPM_TYPE : string := L_FSM;
|
631 |
|
|
LPM_HINT : string := "UNUSED");
|
632 |
|
|
port (DATA : in std_logic_vector(LPM_WIDTHIN-1 downto 0);
|
633 |
|
|
CLOCK : in std_logic;
|
634 |
|
|
ASET : in std_logic := '0';
|
635 |
|
|
TESTENAB : in std_logic := '0';
|
636 |
|
|
TESTIN : in std_logic := '0';
|
637 |
|
|
TESTOUT : out std_logic;
|
638 |
|
|
STATE : out std_logic_vector(LPM_WIDTHS-1 downto 0);
|
639 |
|
|
RESULT : out std_logic_vector(LPM_WIDTHOUT-1 downto 0));
|
640 |
|
|
end component;
|
641 |
|
|
|
642 |
|
|
|
643 |
|
|
------------------------------------------------------------------------
|
644 |
|
|
-- PAD PRIMITIVES ------------------------------------------------------
|
645 |
|
|
------------------------------------------------------------------------
|
646 |
|
|
|
647 |
|
|
component LPM_INPAD
|
648 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
649 |
|
|
LPM_TYPE : string := L_INPAD;
|
650 |
|
|
LPM_HINT : string := "UNUSED");
|
651 |
|
|
port (PAD : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
652 |
|
|
RESULT : out std_logic_vector(LPM_WIDTH-1 downto 0));
|
653 |
|
|
end component;
|
654 |
|
|
|
655 |
|
|
component LPM_OUTPAD
|
656 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
657 |
|
|
LPM_TYPE : string := L_OUTPAD;
|
658 |
|
|
LPM_HINT : string := "UNUSED");
|
659 |
|
|
port (DATA : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
660 |
|
|
PAD : out std_logic_vector(LPM_WIDTH-1 downto 0));
|
661 |
|
|
end component;
|
662 |
|
|
|
663 |
|
|
component LPM_BIPAD
|
664 |
|
|
generic (LPM_WIDTH : natural; -- MUST be greater than 0
|
665 |
|
|
LPM_TYPE : string := L_BIPAD;
|
666 |
|
|
LPM_HINT : string := "UNUSED");
|
667 |
|
|
port (DATA : in std_logic_vector(LPM_WIDTH-1 downto 0);
|
668 |
|
|
ENABLE : in std_logic;
|
669 |
|
|
RESULT : out std_logic_vector(LPM_WIDTH-1 downto 0);
|
670 |
|
|
PAD : inout std_logic_vector(LPM_WIDTH-1 downto 0));
|
671 |
|
|
end component;
|
672 |
|
|
|
673 |
|
|
end;
|
674 |
|
|
|
675 |
|
|
|
676 |
|
|
package body LPM_COMPONENTS is
|
677 |
|
|
|
678 |
|
|
function str_to_int( s : string ) return integer is
|
679 |
|
|
variable len : integer := s'length;
|
680 |
|
|
variable ivalue : integer := 0;
|
681 |
|
|
variable digit : integer;
|
682 |
|
|
begin
|
683 |
|
|
for i in 1 to len loop
|
684 |
|
|
case s(i) is
|
685 |
|
|
when '0' =>
|
686 |
|
|
digit := 0;
|
687 |
|
|
when '1' =>
|
688 |
|
|
digit := 1;
|
689 |
|
|
when '2' =>
|
690 |
|
|
digit := 2;
|
691 |
|
|
when '3' =>
|
692 |
|
|
digit := 3;
|
693 |
|
|
when '4' =>
|
694 |
|
|
digit := 4;
|
695 |
|
|
when '5' =>
|
696 |
|
|
digit := 5;
|
697 |
|
|
when '6' =>
|
698 |
|
|
digit := 6;
|
699 |
|
|
when '7' =>
|
700 |
|
|
digit := 7;
|
701 |
|
|
when '8' =>
|
702 |
|
|
digit := 8;
|
703 |
|
|
when '9' =>
|
704 |
|
|
digit := 9;
|
705 |
|
|
when others =>
|
706 |
|
|
ASSERT FALSE
|
707 |
|
|
REPORT "Illegal Character "& s(i) & "in string parameter! "
|
708 |
|
|
SEVERITY ERROR;
|
709 |
|
|
end case;
|
710 |
|
|
ivalue := ivalue * 10 + digit;
|
711 |
|
|
end loop;
|
712 |
|
|
return ivalue;
|
713 |
|
|
end;
|
714 |
|
|
|
715 |
|
|
end;
|