w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
migui_nexys4d_mig.vhd
Go to the documentation of this file.
1--*****************************************************************************
2-- (c) Copyright 2009 - 2012 Xilinx, Inc. All rights reserved.
3--
4-- This file contains confidential and proprietary information
5-- of Xilinx, Inc. and is protected under U.S. and
6-- international copyright and other intellectual property
7-- laws.
8--
9-- DISCLAIMER
10-- This disclaimer is not a license and does not grant any
11-- rights to the materials distributed herewith. Except as
12-- otherwise provided in a valid license issued to you by
13-- Xilinx, and to the maximum extent permitted by applicable
14-- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
15-- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
16-- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
17-- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
18-- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
19-- (2) Xilinx shall not be liable (whether in contract or tort,
20-- including negligence, or under any other theory of
21-- liability) for any loss or damage of any kind or nature
22-- related to, arising under or in connection with these
23-- materials, including for any direct, or any indirect,
24-- special, incidental, or consequential loss or damage
25-- (including loss of data, profits, goodwill, or any type of
26-- loss or damage suffered as a result of any action brought
27-- by a third party) even if such damage or loss was
28-- reasonably foreseeable or Xilinx had been advised of the
29-- possibility of the same.
30--
31-- CRITICAL APPLICATIONS
32-- Xilinx products are not designed or intended to be fail-
33-- safe, or for use in any application requiring fail-safe
34-- performance, such as life-support or safety devices or
35-- systems, Class III medical devices, nuclear facilities,
36-- applications related to the deployment of airbags, or any
37-- other applications that could lead to death, personal
38-- injury, or severe property or environmental damage
39-- (individually and collectively, "Critical
40-- Applications"). Customer assumes the sole risk and
41-- liability of any use of Xilinx products in Critical
42-- Applications, subject only to applicable laws and
43-- regulations governing limitations on product liability.
44--
45-- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
46-- PART OF THIS FILE AT ALL TIMES.
47--
48--*****************************************************************************
49-- ____ ____
50-- / /\/ /
51-- /___/ \ / Vendor : Xilinx
52-- \ \ \/ Version : 4.2
53-- \ \ Application : MIG
54-- / / Filename : migui_nexys4d_mig.vhd
55-- /___/ /\ Date Last Modified : $Date: 2011/06/02 08:35:03 $
56-- \ \ / \ Date Created : Wed Feb 01 2012
57-- \___\/\___\
58--
59-- Device : 7 Series
60-- Design Name : DDR2 SDRAM
61-- Purpose :
62-- Top-level module. This module can be instantiated in the
63-- system and interconnect as shown in user design wrapper file (user top module).
64-- In addition to the memory controller, the module instantiates:
65-- 1. Clock generation/distribution, reset logic
66-- 2. IDELAY control block
67-- 3. Debug logic
68-- Reference :
69-- Revision History :
70--*****************************************************************************
71
72library ieee;
73use ieee.std_logic_1164.all;
74use ieee.numeric_std.all;
75
76
77entity migui_nexys4d_mig is
78 generic (
79
80 RST_ACT_LOW : integer := 0;
81 -- =1 for active low reset,
82 -- =0 for active high.
83 --***************************************************************************
84 -- The following parameters refer to width of various ports
85 --***************************************************************************
86 BANK_WIDTH : integer := 3;
87 -- # of memory Bank Address bits.
88 CK_WIDTH : integer := 1;
89 -- # of CK/CK# outputs to memory.
90 COL_WIDTH : integer := 10;
91 -- # of memory Column Address bits.
92 CS_WIDTH : integer := 1;
93 -- # of unique CS outputs to memory.
94 nCS_PER_RANK : integer := 1;
95 -- # of unique CS outputs per rank for phy
96 CKE_WIDTH : integer := 1;
97 -- # of CKE outputs to memory.
98 DATA_BUF_ADDR_WIDTH : integer := 5;
99 DQ_CNT_WIDTH : integer := 4;
100 -- = ceil(log2(DQ_WIDTH))
101 DQ_PER_DM : integer := 8;
102 DM_WIDTH : integer := 2;
103 -- # of DM (data mask)
104 DQ_WIDTH : integer := 16;
105 -- # of DQ (data)
106 DQS_WIDTH : integer := 2;
107 DQS_CNT_WIDTH : integer := 1;
108 -- = ceil(log2(DQS_WIDTH))
109 DRAM_WIDTH : integer := 8;
110 -- # of DQ per DQS
111 ECC : string := "OFF";
112 ECC_TEST : string := "OFF";
113 PAYLOAD_WIDTH : integer := 16;
114 MEM_ADDR_ORDER : string := "ROW_BANK_COLUMN";
115 --Possible Parameters
116 --1.BANK_ROW_COLUMN : Address mapping is
117 -- in form of Bank Row Column.
118 --2.ROW_BANK_COLUMN : Address mapping is
119 -- in the form of Row Bank Column.
120 --3.TG_TEST : Scrambles Address bits
121 -- for distributed Addressing.
122
123 --nBANK_MACHS : integer := 4;
124 nBANK_MACHS : integer := 2;
125 RANKS : integer := 1;
126 -- # of Ranks.
127 ODT_WIDTH : integer := 1;
128 -- # of ODT outputs to memory.
129 ROW_WIDTH : integer := 13;
130 -- # of memory Row Address bits.
131 ADDR_WIDTH : integer := 27;
132 -- # = RANK_WIDTH + BANK_WIDTH
133 -- + ROW_WIDTH + COL_WIDTH;
134 -- Chip Select is always tied to low for
135 -- single rank devices
136 USE_CS_PORT : integer := 1;
137 -- # = 1, When Chip Select (CS#) output is enabled
138 -- = 0, When Chip Select (CS#) output is disabled
139 -- If CS_N disabled, user must connect
140 -- DRAM CS_N input(s) to ground
141 USE_DM_PORT : integer := 1;
142 -- # = 1, When Data Mask option is enabled
143 -- = 0, When Data Mask option is disbaled
144 -- When Data Mask option is disabled in
145 -- MIG Controller Options page, the logic
146 -- related to Data Mask should not get
147 -- synthesized
148 USE_ODT_PORT : integer := 1;
149 -- # = 1, When ODT output is enabled
150 -- = 0, When ODT output is disabled
151 PHY_CONTROL_MASTER_BANK : integer := 0;
152 -- The bank index where master PHY_CONTROL resides,
153 -- equal to the PLL residing bank
154 MEM_DENSITY : string := "1Gb";
155 -- Indicates the density of the Memory part
156 -- Added for the sake of Vivado simulations
157 MEM_SPEEDGRADE : string := "25E";
158 -- Indicates the Speed grade of Memory Part
159 -- Added for the sake of Vivado simulations
160 MEM_DEVICE_WIDTH : integer := 16;
161 -- Indicates the device width of the Memory Part
162 -- Added for the sake of Vivado simulations
163
164 --***************************************************************************
165 -- The following parameters are mode register settings
166 --***************************************************************************
167 AL : string := "0";
168 -- DDR3 SDRAM:
169 -- Additive Latency (Mode Register 1).
170 -- # = "0", "CL-1", "CL-2".
171 -- DDR2 SDRAM:
172 -- Additive Latency (Extended Mode Register).
173 nAL : integer := 0;
174 -- # Additive Latency in number of clock
175 -- cycles.
176 BURST_MODE : string := "8";
177 -- DDR3 SDRAM:
178 -- Burst Length (Mode Register 0).
179 -- # = "8", "4", "OTF".
180 -- DDR2 SDRAM:
181 -- Burst Length (Mode Register).
182 -- # = "8", "4".
183 BURST_TYPE : string := "SEQ";
184 -- DDR3 SDRAM: Burst Type (Mode Register 0).
185 -- DDR2 SDRAM: Burst Type (Mode Register).
186 -- # = "SEQ" - (Sequential),
187 -- = "INT" - (Interleaved).
188 CL : integer := 5;
189 -- in number of clock cycles
190 -- DDR3 SDRAM: CAS Latency (Mode Register 0).
191 -- DDR2 SDRAM: CAS Latency (Mode Register).
192 OUTPUT_DRV : string := "HIGH";
193 -- Output Drive Strength (Extended Mode Register).
194 -- # = "HIGH" - FULL,
195 -- = "LOW" - REDUCED.
196 RTT_NOM : string := "50";
197 -- RTT (Nominal) (Extended Mode Register).
198 -- = "150" - 150 Ohms,
199 -- = "75" - 75 Ohms,
200 -- = "50" - 50 Ohms.
201 ADDR_CMD_MODE : string := "1T" ;
202 -- # = "1T", "2T".
203 REG_CTRL : string := "OFF";
204 -- # = "ON" - RDIMMs,
205 -- = "OFF" - Components, SODIMMs, UDIMMs.
206
207 --***************************************************************************
208 -- The following parameters are multiplier and divisor factors for PLLE2.
209 -- Based on the selected design frequency these parameters vary.
210 --***************************************************************************
211 CLKIN_PERIOD : integer := 9999;
212 -- Input Clock Period
213 CLKFBOUT_MULT : integer := 12;
214 -- write PLL VCO multiplier
215 DIVCLK_DIVIDE : integer := 1;
216 -- write PLL VCO divisor
217 CLKOUT0_PHASE : real := 0.0;
218 -- Phase for PLL output clock (CLKOUT0)
219 CLKOUT0_DIVIDE : integer := 2;
220 -- VCO output divisor for PLL output clock (CLKOUT0)
221 CLKOUT1_DIVIDE : integer := 4;
222 -- VCO output divisor for PLL output clock (CLKOUT1)
223 CLKOUT2_DIVIDE : integer := 64;
224 -- VCO output divisor for PLL output clock (CLKOUT2)
225 CLKOUT3_DIVIDE : integer := 16;
226 -- VCO output divisor for PLL output clock (CLKOUT3)
227 MMCM_VCO : integer := 1200;
228 -- Max Freq (MHz) of MMCM VCO
229 MMCM_MULT_F : integer := 15;
230 -- write MMCM VCO multiplier
231 MMCM_DIVCLK_DIVIDE : integer := 1;
232 -- write MMCM VCO divisor
233
234 --***************************************************************************
235 -- Memory Timing Parameters. These parameters varies based on the selected
236 -- memory part.
237 --***************************************************************************
238 tCKE : integer := 7500;
239 -- memory tCKE paramter in pS
240 tFAW : integer := 45000;
241 -- memory tRAW paramter in pS.
242 tPRDI : integer := 1000000;
243 -- memory tPRDI paramter in pS.
244 tRAS : integer := 40000;
245 -- memory tRAS paramter in pS.
246 tRCD : integer := 15000;
247 -- memory tRCD paramter in pS.
248 tREFI : integer := 7800000;
249 -- memory tREFI paramter in pS.
250 tRFC : integer := 127500;
251 -- memory tRFC paramter in pS.
252 tRP : integer := 12500;
253 -- memory tRP paramter in pS.
254 tRRD : integer := 10000;
255 -- memory tRRD paramter in pS.
256 tRTP : integer := 7500;
257 -- memory tRTP paramter in pS.
258 tWTR : integer := 7500;
259 -- memory tWTR paramter in pS.
260 tZQI : integer := 128000000;
261 -- memory tZQI paramter in nS.
262 tZQCS : integer := 64;
263 -- memory tZQCS paramter in clock cycles.
264
265 --***************************************************************************
266 -- Simulation parameters
267 --***************************************************************************
268 SIM_BYPASS_INIT_CAL : string := "OFF";
269 -- # = "OFF" - Complete memory init &
270 -- calibration sequence
271 -- # = "SKIP" - Not supported
272 -- # = "FAST" - Complete memory init & use
273 -- abbreviated calib sequence
274
275 SIMULATION : string := "FALSE";
276 -- Should be TRUE during design simulations and
277 -- FALSE during implementations
278
279 --***************************************************************************
280 -- The following parameters varies based on the pin out entered in MIG GUI.
281 -- Do not change any of these parameters directly by editing the RTL.
282 -- Any changes required should be done through GUI and the design regenerated.
283 --***************************************************************************
284 BYTE_LANES_B0 : std_logic_vector(3 downto 0) := "1111";
285 -- Byte lanes used in an IO column.
286 BYTE_LANES_B1 : std_logic_vector(3 downto 0) := "0000";
287 -- Byte lanes used in an IO column.
288 BYTE_LANES_B2 : std_logic_vector(3 downto 0) := "0000";
289 -- Byte lanes used in an IO column.
290 BYTE_LANES_B3 : std_logic_vector(3 downto 0) := "0000";
291 -- Byte lanes used in an IO column.
292 BYTE_LANES_B4 : std_logic_vector(3 downto 0) := "0000";
293 -- Byte lanes used in an IO column.
294 DATA_CTL_B0 : std_logic_vector(3 downto 0) := "0101";
295 -- Indicates Byte lane is data byte lane
296 -- or control Byte lane. '1' in a bit
297 -- position indicates a data byte lane and
298 -- a '0' indicates a control byte lane
299 DATA_CTL_B1 : std_logic_vector(3 downto 0) := "0000";
300 -- Indicates Byte lane is data byte lane
301 -- or control Byte lane. '1' in a bit
302 -- position indicates a data byte lane and
303 -- a '0' indicates a control byte lane
304 DATA_CTL_B2 : std_logic_vector(3 downto 0) := "0000";
305 -- Indicates Byte lane is data byte lane
306 -- or control Byte lane. '1' in a bit
307 -- position indicates a data byte lane and
308 -- a '0' indicates a control byte lane
309 DATA_CTL_B3 : std_logic_vector(3 downto 0) := "0000";
310 -- Indicates Byte lane is data byte lane
311 -- or control Byte lane. '1' in a bit
312 -- position indicates a data byte lane and
313 -- a '0' indicates a control byte lane
314 DATA_CTL_B4 : std_logic_vector(3 downto 0) := "0000";
315 -- Indicates Byte lane is data byte lane
316 -- or control Byte lane. '1' in a bit
317 -- position indicates a data byte lane and
318 -- a '0' indicates a control byte lane
319 PHY_0_BITLANES : std_logic_vector(47 downto 0) := X"FFC3F7FFF3FE";
320 PHY_1_BITLANES : std_logic_vector(47 downto 0) := X"000000000000";
321 PHY_2_BITLANES : std_logic_vector(47 downto 0) := X"000000000000";
322
323 -- control/address/data pin mapping parameters
325 : std_logic_vector(143 downto 0) := X"000000000000000000000000000000000003";
327 : std_logic_vector(191 downto 0) := X"00000000001003301A01903203A034018036012011017015";
328 BANK_MAP : std_logic_vector(35 downto 0) := X"01301601B";
329 CAS_MAP : std_logic_vector(11 downto 0) := X"039";
330 CKE_ODT_BYTE_MAP : std_logic_vector(7 downto 0) := X"00";
331 CKE_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000038";
332 ODT_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000035";
333 CS_MAP : std_logic_vector(119 downto 0) := X"000000000000000000000000000037";
334 PARITY_MAP : std_logic_vector(11 downto 0) := X"000";
335 RAS_MAP : std_logic_vector(11 downto 0) := X"014";
336 WE_MAP : std_logic_vector(11 downto 0) := X"03B";
338 : std_logic_vector(143 downto 0) := X"000000000000000000000000000000000200";
339 DATA0_MAP : std_logic_vector(95 downto 0) := X"008004009007005001006003";
340 DATA1_MAP : std_logic_vector(95 downto 0) := X"022028020024027025026021";
341 DATA2_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
342 DATA3_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
343 DATA4_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
344 DATA5_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
345 DATA6_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
346 DATA7_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
347 DATA8_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
348 DATA9_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
349 DATA10_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
350 DATA11_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
351 DATA12_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
352 DATA13_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
353 DATA14_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
354 DATA15_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
355 DATA16_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
356 DATA17_MAP : std_logic_vector(95 downto 0) := X"000000000000000000000000";
357 MASK0_MAP : std_logic_vector(107 downto 0) := X"000000000000000000000029002";
358 MASK1_MAP : std_logic_vector(107 downto 0) := X"000000000000000000000000000";
359
360 SLOT_0_CONFIG : std_logic_vector(7 downto 0) := "00000001";
361 -- Mapping of Ranks.
362 SLOT_1_CONFIG : std_logic_vector(7 downto 0) := "00000000";
363 -- Mapping of Ranks.
364
365 --***************************************************************************
366 -- IODELAY and PHY related parameters
367 --***************************************************************************
368 IBUF_LPWR_MODE : string := "OFF";
369 -- to phy_top
370 DATA_IO_IDLE_PWRDWN : string := "ON";
371 -- # = "ON", "OFF"
372 BANK_TYPE : string := "HR_IO";
373 -- # = "HP_IO", "HPL_IO", "HR_IO", "HRL_IO"
374 DATA_IO_PRIM_TYPE : string := "HR_LP";
375 -- # = "HP_LP", "HR_LP", "DEFAULT"
376 CKE_ODT_AUX : string := "FALSE";
377 USER_REFRESH : string := "OFF";
378 WRLVL : string := "OFF";
379 -- # = "ON" - DDR3 SDRAM
380 -- = "OFF" - DDR2 SDRAM.
381 ORDERING : string := "STRICT";
382 -- # = "NORM", "STRICT", "RELAXED".
383 CALIB_ROW_ADD : std_logic_vector(15 downto 0) := X"0000";
384 -- Calibration row address will be used for
385 -- calibration read and write operations
386 CALIB_COL_ADD : std_logic_vector(11 downto 0) := X"000";
387 -- Calibration column address will be used for
388 -- calibration read and write operations
389 CALIB_BA_ADD : std_logic_vector(2 downto 0) := "000";
390 -- Calibration bank address will be used for
391 -- calibration read and write operations
392 TCQ : integer := 100;
393
394 IODELAY_GRP0 : string := "MIGUI_NEXYS4D_IODELAY_MIG0";
395 -- It is associated to a set of IODELAYs with
396 -- an IDELAYCTRL that have same IODELAY CONTROLLER
397 -- clock frequency (200MHz).
398 IODELAY_GRP1 : string := "MIGUI_NEXYS4D_IODELAY_MIG1";
399 -- It is associated to a set of IODELAYs with
400 -- an IDELAYCTRL that have same IODELAY CONTROLLER
401 -- clock frequency (300MHz/400MHz).
402 SYSCLK_TYPE : string := "NO_BUFFER";
403 -- System clock type DIFFERENTIAL, SINGLE_ENDED,
404 -- NO_BUFFER
405 REFCLK_TYPE : string := "NO_BUFFER";
406 -- Reference clock type DIFFERENTIAL, SINGLE_ENDED
407 -- NO_BUFFER, USE_SYSTEM_CLOCK
408 SYS_RST_PORT : string := "FALSE";
409 -- "TRUE" - if pin is selected for sys_rst
410 -- and IBUF will be instantiated.
411 -- "FALSE" - if pin is not selected for sys_rst
412 FPGA_SPEED_GRADE : integer := 1;
413 -- FPGA speed grade
414 REF_CLK_MMCM_IODELAY_CTRL : string := "FALSE";
415
416 CMD_PIPE_PLUS1 : string := "ON";
417 -- add pipeline stage between MC and PHY
418 DRAM_TYPE : string := "DDR2";
419 CAL_WIDTH : string := "HALF";
420 STARVE_LIMIT : integer := 2;
421 -- # = 2,3,4.
422
423 --***************************************************************************
424 -- Referece clock frequency parameters
425 --***************************************************************************
426 REFCLK_FREQ : real := 200.0;
427 -- IODELAYCTRL reference clock frequency
428 DIFF_TERM_REFCLK : string := "TRUE";
429 -- Differential Termination for idelay
430 -- reference clock input pins
431 --***************************************************************************
432 -- System clock frequency parameters
433 --***************************************************************************
434 tCK : integer := 3333;
435 -- memory tCK paramter.
436 -- # = Clock Period in pS.
437 nCK_PER_CLK : integer := 4;
438 -- # of memory CKs per fabric CLK
439 DIFF_TERM_SYSCLK : string := "TRUE";
440 -- Differential Termination for System
441 -- clock input pins
442
443 --***************************************************************************
444 -- Debug parameters
445 --***************************************************************************
446 DEBUG_PORT : string := "OFF";
447 -- # = "ON" Enable debug signals/controls.
448 -- = "OFF" Disable debug signals/controls.
449
450 --***************************************************************************
451 -- Temparature monitor parameter
452 --***************************************************************************
453 TEMP_MON_CONTROL : string := "EXTERNAL"
454 -- # = "INTERNAL", "EXTERNAL"
455
456-- RST_ACT_LOW : integer := 0
457 -- =1 for active low reset,
458 -- =0 for active high.
459 );
460 port (
461
462 -- Inouts
463 ddr2_dq : inout std_logic_vector(DQ_WIDTH-1 downto 0);
464 ddr2_dqs_p : inout std_logic_vector(DQS_WIDTH-1 downto 0);
465 ddr2_dqs_n : inout std_logic_vector(DQS_WIDTH-1 downto 0);
466
467 -- Outputs
468 ddr2_addr : out std_logic_vector(ROW_WIDTH-1 downto 0);
469 ddr2_ba : out std_logic_vector(BANK_WIDTH-1 downto 0);
470 ddr2_ras_n : out std_logic;
471 ddr2_cas_n : out std_logic;
472 ddr2_we_n : out std_logic;
473 ddr2_ck_p : out std_logic_vector(CK_WIDTH-1 downto 0);
474 ddr2_ck_n : out std_logic_vector(CK_WIDTH-1 downto 0);
475 ddr2_cke : out std_logic_vector(CKE_WIDTH-1 downto 0);
476 ddr2_cs_n : out std_logic_vector((CS_WIDTH*nCS_PER_RANK)-1 downto 0);
477 ddr2_dm : out std_logic_vector(DM_WIDTH-1 downto 0);
478 ddr2_odt : out std_logic_vector(ODT_WIDTH-1 downto 0);
479
480 -- Inputs
481 -- Single-ended system clock
482 sys_clk_i : in std_logic;
483 -- Single-ended iodelayctrl clk (reference clock)
484 clk_ref_i : in std_logic;
485 -- user interface signals
486 app_addr : in std_logic_vector(ADDR_WIDTH-1 downto 0);
487 app_cmd : in std_logic_vector(2 downto 0);
488 app_en : in std_logic;
489 app_wdf_data : in std_logic_vector((nCK_PER_CLK*2*PAYLOAD_WIDTH)-1 downto 0);
490 app_wdf_end : in std_logic;
491 app_wdf_mask : in std_logic_vector((nCK_PER_CLK*2*PAYLOAD_WIDTH/8)-1 downto 0) ;
492 app_wdf_wren : in std_logic;
493 app_rd_data : out std_logic_vector((nCK_PER_CLK*2*PAYLOAD_WIDTH)-1 downto 0);
494 app_rd_data_end : out std_logic;
495 app_rd_data_valid : out std_logic;
496 app_rdy : out std_logic;
497 app_wdf_rdy : out std_logic;
498 app_sr_req : in std_logic;
499 app_ref_req : in std_logic;
500 app_zq_req : in std_logic;
501 app_sr_active : out std_logic;
502 app_ref_ack : out std_logic;
503 app_zq_ack : out std_logic;
504 ui_clk : out std_logic;
505 ui_clk_sync_rst : out std_logic;
506
507
508 init_calib_complete : out std_logic;
509 device_temp_i : in std_logic_vector(11 downto 0);
510 -- The 12 MSB bits of the temperature sensor transfer
511 -- function need to be connected to this port. This port
512 -- will be synchronized w.r.t. to fabric clock internally.
513
514
515 -- System reset - Default polarity of sys_rst pin is Active Low.
516 -- System reset polarity will change based on the option
517 -- selected in GUI.
518 sys_rst : in std_logic
519 );
520
521end entity migui_nexys4d_mig;
522
524
525
526 -- clogb2 function - ceiling of log base 2
527 function clogb2 (size : integer) return integer is
528 variable base : integer := 1;
529 variable inp : integer := 0;
530 begin
531 inp := size - 1;
532 while (inp > 1) loop
533 inp := inp/2 ;
534 base := base + 1;
535 end loop;
536 return base;
537 end function;
538 constant DATA_WIDTH : integer := 16;
539
540 function ECCWIDTH return integer is
541 begin
542 if(ECC = "OFF") then
543 return 0;
544 else
545 if(DATA_WIDTH <= 4) then
546 return 4;
547 elsif(DATA_WIDTH <= 10) then
548 return 5;
549 elsif(DATA_WIDTH <= 26) then
550 return 6;
551 elsif(DATA_WIDTH <= 57) then
552 return 7;
553 elsif(DATA_WIDTH <= 120) then
554 return 8;
555 elsif(DATA_WIDTH <= 247) then
556 return 9;
557 else
558 return 10;
559 end if;
560 end if;
561 end function;
562
563 constant RANK_WIDTH : integer := clogb2(RANKS);
564
565 function XWIDTH return integer is
566 begin
567 if(CS_WIDTH = 1) then
568 return 0;
569 else
570 return RANK_WIDTH;
571 end if;
572 end function;
573
574 constant TAPSPERKCLK : integer := 56;
575
576 function TEMP_MON return string is
577 begin
578 if(SIMULATION = "FALSE") then
579 return "ON";
580 else
581 return "OFF";
582 end if;
583 end function;
584
585
586
587 constant BM_CNT_WIDTH : integer := clogb2(nBANK_MACHS);
588 constant ECC_WIDTH : integer := ECCWIDTH;
589 constant DATA_BUF_OFFSET_WIDTH : integer := 1;
590 constant MC_ERR_ADDR_WIDTH : integer := XWIDTH + BANK_WIDTH + ROW_WIDTH
592 constant APP_DATA_WIDTH : integer := 2 * nCK_PER_CLK * PAYLOAD_WIDTH;
593 constant APP_MASK_WIDTH : integer := APP_DATA_WIDTH / 8;
594 constant TEMP_MON_EN : string := TEMP_MON;
595 -- Enable or disable the temp monitor module
596 constant tTEMPSAMPLE : integer := 10000000; -- sample every 10 us
597 constant XADC_CLK_PERIOD : integer := 5000; -- Use 200 MHz IODELAYCTRL clock
598
599
600
601
602
603
604 component mig_7series_v4_2_iodelay_ctrl is
605 generic(
606 TCQ : integer;
607 IODELAY_GRP0 : string;
608 IODELAY_GRP1 : string;
609 REFCLK_TYPE : string;
610 SYSCLK_TYPE : string;
611 SYS_RST_PORT : string;
612 RST_ACT_LOW : integer;
613 DIFF_TERM_REFCLK : string;
614 FPGA_SPEED_GRADE : integer;
615 REF_CLK_MMCM_IODELAY_CTRL : string
616 );
617 port (
618 clk_ref_p : in std_logic;
619 clk_ref_n : in std_logic;
620 clk_ref_i : in std_logic;
621 sys_rst : in std_logic;
622 clk_ref : out std_logic_vector(1 downto 0);
623 sys_rst_o : out std_logic;
624 iodelay_ctrl_rdy : out std_logic_vector(1 downto 0)
625 );
626 end component mig_7series_v4_2_iodelay_ctrl;
627
628 component mig_7series_v4_2_clk_ibuf is
629 generic (
630 SYSCLK_TYPE : string;
631 DIFF_TERM_SYSCLK : string
632 );
633 port (
634 sys_clk_p : in std_logic;
635 sys_clk_n : in std_logic;
636 sys_clk_i : in std_logic;
637 mmcm_clk : out std_logic
638 );
639 end component mig_7series_v4_2_clk_ibuf;
640
641 component mig_7series_v4_2_infrastructure is
642 generic (
643 SIMULATION : string := "FALSE";
644 TCQ : integer;
645 CLKIN_PERIOD : integer;
646 nCK_PER_CLK : integer;
647 SYSCLK_TYPE : string;
648 UI_EXTRA_CLOCKS : string := "FALSE";
649 CLKFBOUT_MULT : integer;
650 DIVCLK_DIVIDE : integer;
651 CLKOUT0_PHASE : real;
652 CLKOUT0_DIVIDE : integer;
653 CLKOUT1_DIVIDE : integer;
654 CLKOUT2_DIVIDE : integer;
655 CLKOUT3_DIVIDE : integer;
656 MMCM_VCO : integer;
657 MMCM_MULT_F : integer;
658 MMCM_DIVCLK_DIVIDE : integer;
659 MMCM_CLKOUT0_EN : string := "FALSE";
660 MMCM_CLKOUT1_EN : string := "FALSE";
661 MMCM_CLKOUT2_EN : string := "FALSE";
662 MMCM_CLKOUT3_EN : string := "FALSE";
663 MMCM_CLKOUT4_EN : string := "FALSE";
664 MMCM_CLKOUT0_DIVIDE : integer := 1;
665 MMCM_CLKOUT1_DIVIDE : integer := 1;
666 MMCM_CLKOUT2_DIVIDE : integer := 1;
667 MMCM_CLKOUT3_DIVIDE : integer := 1;
668 MMCM_CLKOUT4_DIVIDE : integer := 1;
669 RST_ACT_LOW : integer;
670 tCK : integer;
671 MEM_TYPE : string
672 );
673 port (
674 mmcm_clk : in std_logic;
675 sys_rst : in std_logic;
676 iodelay_ctrl_rdy : in std_logic_vector(1 downto 0);
677 psen : in std_logic;
678 psincdec : in std_logic;
679 clk : out std_logic;
680 clk_div2 : out std_logic;
681 rst_div2 : out std_logic;
682 mem_refclk : out std_logic;
683 freq_refclk : out std_logic;
684 sync_pulse : out std_logic;
685 mmcm_ps_clk : out std_logic;
686 poc_sample_pd : out std_logic;
687 iddr_rst : out std_logic;
688 psdone : out std_logic;
689-- auxout_clk : out std_logic;
690 ui_addn_clk_0 : out std_logic;
691 ui_addn_clk_1 : out std_logic;
692 ui_addn_clk_2 : out std_logic;
693 ui_addn_clk_3 : out std_logic;
694 ui_addn_clk_4 : out std_logic;
695 pll_locked : out std_logic;
696 mmcm_locked : out std_logic;
697 rstdiv0 : out std_logic;
698 rst_phaser_ref : out std_logic;
699 ref_dll_lock : in std_logic
700 );
701 end component mig_7series_v4_2_infrastructure;
702
703 component mig_7series_v4_2_tempmon is
704 generic (
705 TCQ : integer;
706 TEMP_MON_CONTROL : string;
707 XADC_CLK_PERIOD : integer;
708 tTEMPSAMPLE : integer
709 );
710 port (
711 clk : in std_logic;
712 xadc_clk : in std_logic;
713 rst : in std_logic;
714 device_temp_i : in std_logic_vector(11 downto 0);
715 device_temp : out std_logic_vector(11 downto 0)
716 );
717 end component mig_7series_v4_2_tempmon;
718
719 component mig_7series_v4_2_memc_ui_top_std is
720 generic (
721 TCQ : integer;
722 DDR3_VDD_OP_VOLT : string := "135";
723 PAYLOAD_WIDTH : integer;
724 ADDR_CMD_MODE : string;
725 AL : string;
726 BANK_WIDTH : integer;
727 BM_CNT_WIDTH : integer;
728 BURST_MODE : string;
729 BURST_TYPE : string;
730 CA_MIRROR : string := "FALSE";
731 CK_WIDTH : integer;
732 CL : integer;
733 COL_WIDTH : integer;
734 CMD_PIPE_PLUS1 : string;
735 CS_WIDTH : integer;
736 CKE_WIDTH : integer;
737 CWL : integer := 5;
738 DATA_WIDTH : integer;
739 DATA_BUF_ADDR_WIDTH : integer;
740 DATA_BUF_OFFSET_WIDTH : integer := 1;
741 DDR2_DQSN_ENABLE : string := "YES";
742 DM_WIDTH : integer;
743 DQ_CNT_WIDTH : integer;
744 DQ_WIDTH : integer;
745 DQS_CNT_WIDTH : integer;
746 DQS_WIDTH : integer;
747 DRAM_TYPE : string;
748 DRAM_WIDTH : integer;
749 ECC : string;
750 ECC_WIDTH : integer;
751 ECC_TEST : string;
752 MC_ERR_ADDR_WIDTH : integer;
753 MASTER_PHY_CTL : integer;
754 nAL : integer;
755 nBANK_MACHS : integer;
756 nCK_PER_CLK : integer;
757 nCS_PER_RANK : integer;
758 ORDERING : string;
759 IBUF_LPWR_MODE : string;
760 BANK_TYPE : string;
761 DATA_IO_PRIM_TYPE : string;
762 DATA_IO_IDLE_PWRDWN : string;
763 IODELAY_GRP0 : string;
764 IODELAY_GRP1 : string;
765 FPGA_SPEED_GRADE : integer;
766 OUTPUT_DRV : string;
767 REG_CTRL : string;
768 RTT_NOM : string;
769 RTT_WR : string := "120";
770 STARVE_LIMIT : integer;
771 tCK : integer;
772 tCKE : integer;
773 tFAW : integer;
774 tPRDI : integer;
775 tRAS : integer;
776 tRCD : integer;
777 tREFI : integer;
778 tRFC : integer;
779 tRP : integer;
780 tRRD : integer;
781 tRTP : integer;
782 tWTR : integer;
783 tZQI : integer;
784 tZQCS : integer;
785 USER_REFRESH : string;
786 TEMP_MON_EN : string;
787 WRLVL : string;
788 DEBUG_PORT : string;
789 CAL_WIDTH : string;
790 RANK_WIDTH : integer;
791 RANKS : integer;
792 ODT_WIDTH : integer;
793 ROW_WIDTH : integer;
794 ADDR_WIDTH : integer;
795 APP_MASK_WIDTH : integer;
796 APP_DATA_WIDTH : integer;
797 BYTE_LANES_B0 : std_logic_vector(3 downto 0);
798 BYTE_LANES_B1 : std_logic_vector(3 downto 0);
799 BYTE_LANES_B2 : std_logic_vector(3 downto 0);
800 BYTE_LANES_B3 : std_logic_vector(3 downto 0);
801 BYTE_LANES_B4 : std_logic_vector(3 downto 0);
802 DATA_CTL_B0 : std_logic_vector(3 downto 0);
803 DATA_CTL_B1 : std_logic_vector(3 downto 0);
804 DATA_CTL_B2 : std_logic_vector(3 downto 0);
805 DATA_CTL_B3 : std_logic_vector(3 downto 0);
806 DATA_CTL_B4 : std_logic_vector(3 downto 0);
807 PHY_0_BITLANES : std_logic_vector(47 downto 0);
808 PHY_1_BITLANES : std_logic_vector(47 downto 0);
809 PHY_2_BITLANES : std_logic_vector(47 downto 0);
810 CK_BYTE_MAP : std_logic_vector(143 downto 0);
811 ADDR_MAP : std_logic_vector(191 downto 0);
812 BANK_MAP : std_logic_vector(35 downto 0);
813 CAS_MAP : std_logic_vector(11 downto 0);
814 CKE_ODT_BYTE_MAP : std_logic_vector(7 downto 0);
815 CKE_MAP : std_logic_vector(95 downto 0);
816 ODT_MAP : std_logic_vector(95 downto 0);
817 CKE_ODT_AUX : string;
818 CS_MAP : std_logic_vector(119 downto 0);
819 PARITY_MAP : std_logic_vector(11 downto 0);
820 RAS_MAP : std_logic_vector(11 downto 0);
821 WE_MAP : std_logic_vector(11 downto 0);
822 DQS_BYTE_MAP : std_logic_vector(143 downto 0);
823 DATA0_MAP : std_logic_vector(95 downto 0);
824 DATA1_MAP : std_logic_vector(95 downto 0);
825 DATA2_MAP : std_logic_vector(95 downto 0);
826 DATA3_MAP : std_logic_vector(95 downto 0);
827 DATA4_MAP : std_logic_vector(95 downto 0);
828 DATA5_MAP : std_logic_vector(95 downto 0);
829 DATA6_MAP : std_logic_vector(95 downto 0);
830 DATA7_MAP : std_logic_vector(95 downto 0);
831 DATA8_MAP : std_logic_vector(95 downto 0);
832 DATA9_MAP : std_logic_vector(95 downto 0);
833 DATA10_MAP : std_logic_vector(95 downto 0);
834 DATA11_MAP : std_logic_vector(95 downto 0);
835 DATA12_MAP : std_logic_vector(95 downto 0);
836 DATA13_MAP : std_logic_vector(95 downto 0);
837 DATA14_MAP : std_logic_vector(95 downto 0);
838 DATA15_MAP : std_logic_vector(95 downto 0);
839 DATA16_MAP : std_logic_vector(95 downto 0);
840 DATA17_MAP : std_logic_vector(95 downto 0);
841 MASK0_MAP : std_logic_vector(107 downto 0);
842 MASK1_MAP : std_logic_vector(107 downto 0);
843 SLOT_0_CONFIG : std_logic_vector(7 downto 0);
844 SLOT_1_CONFIG : std_logic_vector(7 downto 0);
845 MEM_ADDR_ORDER : string;
846 CALIB_ROW_ADD : std_logic_vector(15 downto 0);
847 CALIB_COL_ADD : std_logic_vector(11 downto 0);
848 CALIB_BA_ADD : std_logic_vector(2 downto 0);
849 SIM_BYPASS_INIT_CAL : string;
850 REFCLK_FREQ : real;
851 USE_CS_PORT : integer;
852 USE_DM_PORT : integer;
853 USE_ODT_PORT : integer;
854 IDELAY_ADJ : string;
855 FINE_PER_BIT : string;
856 CENTER_COMP_MODE : string;
857 PI_VAL_ADJ : string;
858 TAPSPERKCLK : integer := 56;
859 SKIP_CALIB : string;
860 FPGA_VOLT_TYPE : string
861 );
862 port (
863 clk : in std_logic;
864 clk_div2 : in std_logic;
865 rst_div2 : in std_logic;
866 clk_ref : in std_logic_vector(1 downto 0);
867 mem_refclk : in std_logic;
868 freq_refclk : in std_logic;
869 pll_lock : in std_logic;
870 sync_pulse : in std_logic;
871 mmcm_ps_clk : in std_logic;
872 poc_sample_pd : in std_logic;
873 rst : in std_logic;
874
875 ddr_dq : inout std_logic_vector(DQ_WIDTH-1 downto 0);
876 ddr_dqs_n : inout std_logic_vector(DQS_WIDTH-1 downto 0);
877 ddr_dqs : inout std_logic_vector(DQS_WIDTH-1 downto 0);
878 ddr_addr : out std_logic_vector(ROW_WIDTH-1 downto 0);
879 ddr_ba : out std_logic_vector(BANK_WIDTH-1 downto 0);
880 ddr_cas_n : out std_logic;
881 ddr_ck_n : out std_logic_vector(CK_WIDTH-1 downto 0);
882 ddr_ck : out std_logic_vector(CK_WIDTH-1 downto 0);
883 ddr_cke : out std_logic_vector(CKE_WIDTH-1 downto 0);
884 ddr_cs_n : out std_logic_vector((CS_WIDTH*nCS_PER_RANK)-1 downto 0);
885 ddr_dm : out std_logic_vector(DM_WIDTH-1 downto 0);
886 ddr_odt : out std_logic_vector(ODT_WIDTH-1 downto 0);
887 ddr_ras_n : out std_logic;
888 ddr_reset_n : out std_logic;
889 ddr_parity : out std_logic;
890 ddr_we_n : out std_logic;
891
892 bank_mach_next : out std_logic_vector(BM_CNT_WIDTH-1 downto 0);
893
894 app_addr : in std_logic_vector(ADDR_WIDTH-1 downto 0);
895 app_cmd : in std_logic_vector(2 downto 0);
896 app_en : in std_logic;
897 app_hi_pri : in std_logic;
898 app_wdf_data : in std_logic_vector((nCK_PER_CLK*2*PAYLOAD_WIDTH)-1 downto 0);
899 app_wdf_end : in std_logic;
900 app_wdf_mask : in std_logic_vector(((nCK_PER_CLK*2*PAYLOAD_WIDTH)/8)-1 downto 0);
901 app_wdf_wren : in std_logic;
902 app_correct_en_i : in std_logic;
903 app_raw_not_ecc : in std_logic_vector((2*nCK_PER_CLK)-1 downto 0);
904 app_ecc_multiple_err : out std_logic_vector((2*nCK_PER_CLK)-1 downto 0);
905 app_ecc_single_err : out std_logic_vector((2*nCK_PER_CLK)-1 downto 0);
906 app_rd_data : out std_logic_vector((nCK_PER_CLK*2*PAYLOAD_WIDTH)-1 downto 0);
907 app_rd_data_end : out std_logic;
908 app_rd_data_valid : out std_logic;
909 app_rdy : out std_logic;
910 app_wdf_rdy : out std_logic;
911 app_sr_req : in std_logic;
912 app_sr_active : out std_logic;
913 app_ref_req : in std_logic;
914 app_ref_ack : out std_logic;
915 app_zq_req : in std_logic;
916 app_zq_ack : out std_logic;
917
918 calib_tap_req : out std_logic;
919 calib_tap_addr : in std_logic_vector(6 downto 0);
920 calib_tap_load : in std_logic;
921 calib_tap_val : in std_logic_vector(7 downto 0);
922 calib_tap_load_done : in std_logic;
923
924 device_temp : in std_logic_vector(11 downto 0);
925
926 psen : out std_logic;
927 psincdec : out std_logic;
928 psdone : in std_logic;
929
930 dbg_idel_down_all : in std_logic;
931 dbg_idel_down_cpt : in std_logic;
932 dbg_idel_up_all : in std_logic;
933 dbg_idel_up_cpt : in std_logic;
934 dbg_sel_all_idel_cpt : in std_logic;
935 dbg_sel_idel_cpt : in std_logic_vector(DQS_CNT_WIDTH-1 downto 0);
936 dbg_cpt_first_edge_cnt : out std_logic_vector((6*DQS_WIDTH*RANKS)-1 downto 0);
937 dbg_cpt_second_edge_cnt : out std_logic_vector((6*DQS_WIDTH*RANKS)-1 downto 0);
938 dbg_rd_data_edge_detect : out std_logic_vector(DQS_WIDTH-1 downto 0);
939 dbg_rddata : out std_logic_vector((2*nCK_PER_CLK*DQ_WIDTH)-1 downto 0);
940 dbg_rdlvl_done : out std_logic_vector(1 downto 0);
941 dbg_rdlvl_err : out std_logic_vector(1 downto 0);
942 dbg_rdlvl_start : out std_logic_vector(1 downto 0);
943 dbg_tap_cnt_during_wrlvl : out std_logic_vector(5 downto 0);
944 dbg_wl_edge_detect_valid : out std_logic;
945 dbg_wrlvl_done : out std_logic;
946 dbg_wrlvl_err : out std_logic;
947 dbg_wrlvl_start : out std_logic;
948 dbg_final_po_fine_tap_cnt : out std_logic_vector((6*DQS_WIDTH)-1 downto 0);
949 dbg_final_po_coarse_tap_cnt : out std_logic_vector((3*DQS_WIDTH)-1 downto 0);
950 init_calib_complete : out std_logic;
951 dbg_sel_pi_incdec : in std_logic;
952 dbg_sel_po_incdec : in std_logic;
953 dbg_byte_sel : in std_logic_vector(DQS_CNT_WIDTH downto 0);
954 dbg_pi_f_inc : in std_logic;
955 dbg_pi_f_dec : in std_logic;
956 dbg_po_f_inc : in std_logic;
957 dbg_po_f_stg23_sel : in std_logic;
958 dbg_po_f_dec : in std_logic;
959 dbg_cpt_tap_cnt : out std_logic_vector((6*DQS_WIDTH*RANKS)-1 downto 0);
960 dbg_dq_idelay_tap_cnt : out std_logic_vector((5*DQS_WIDTH*RANKS)-1 downto 0);
961 dbg_rddata_valid : out std_logic;
962 dbg_wrlvl_fine_tap_cnt : out std_logic_vector((6*DQS_WIDTH)-1 downto 0);
963 dbg_wrlvl_coarse_tap_cnt : out std_logic_vector((3*DQS_WIDTH)-1 downto 0);
964 rst_phaser_ref : in std_logic;
965 ref_dll_lock : out std_logic;
966 iddr_rst : in std_logic;
967 dbg_rd_data_offset : out std_logic_vector((6*RANKS)-1 downto 0);
968 dbg_calib_top : out std_logic_vector(255 downto 0);
969 dbg_phy_wrlvl : out std_logic_vector(255 downto 0);
970 dbg_phy_rdlvl : out std_logic_vector(255 downto 0);
971 dbg_phy_wrcal : out std_logic_vector(99 downto 0);
972 dbg_phy_init : out std_logic_vector(255 downto 0);
973 dbg_prbs_rdlvl : out std_logic_vector(255 downto 0);
974 dbg_dqs_found_cal : out std_logic_vector(255 downto 0);
975 dbg_pi_counter_read_val : out std_logic_vector(5 downto 0);
976 dbg_po_counter_read_val : out std_logic_vector(8 downto 0);
977 dbg_pi_phaselock_start : out std_logic;
978 dbg_pi_phaselocked_done : out std_logic;
979 dbg_pi_phaselock_err : out std_logic;
980 dbg_pi_dqsfound_start : out std_logic;
981 dbg_pi_dqsfound_done : out std_logic;
982 dbg_pi_dqsfound_err : out std_logic;
983 dbg_wrcal_start : out std_logic;
984 dbg_wrcal_done : out std_logic;
985 dbg_wrcal_err : out std_logic;
986 dbg_pi_dqs_found_lanes_phy4lanes : out std_logic_vector(11 downto 0);
987 dbg_pi_phase_locked_phy4lanes : out std_logic_vector(11 downto 0);
988 dbg_calib_rd_data_offset_1 : out std_logic_vector((6*RANKS)-1 downto 0);
989 dbg_calib_rd_data_offset_2 : out std_logic_vector((6*RANKS)-1 downto 0);
990 dbg_data_offset : out std_logic_vector(5 downto 0);
991 dbg_data_offset_1 : out std_logic_vector(5 downto 0);
992 dbg_data_offset_2 : out std_logic_vector(5 downto 0);
993 dbg_oclkdelay_calib_start : out std_logic;
994 dbg_oclkdelay_calib_done : out std_logic;
995 dbg_phy_oclkdelay_cal : out std_logic_vector(255 downto 0);
996 dbg_oclkdelay_rd_data : out std_logic_vector((DRAM_WIDTH*16)-1 downto 0);
997 dbg_prbs_final_dqs_tap_cnt_r : out std_logic_vector((6*DQS_WIDTH*RANKS)-1 downto 0);
998 dbg_prbs_first_edge_taps : out std_logic_vector((6*DQS_WIDTH*RANKS)-1 downto 0);
999 dbg_prbs_second_edge_taps : out std_logic_vector((6*DQS_WIDTH*RANKS)-1 downto 0);
1000 dbg_poc : out std_logic_vector (1023 downto 0)
1001 );
1002 end component mig_7series_v4_2_memc_ui_top_std;
1003
1004
1005 -- Signal declarations
1006
1007 signal bank_mach_next : std_logic_vector(BM_CNT_WIDTH-1 downto 0);
1008 signal clk : std_logic;
1009 signal clk_ref : std_logic_vector(1 downto 0);
1010 signal iodelay_ctrl_rdy : std_logic_vector(1 downto 0);
1011 signal clk_ref_in : std_logic;
1012 signal sys_rst_o : std_logic;
1013 signal clk_div2 : std_logic;
1014 signal rst_div2 : std_logic;
1015 signal freq_refclk : std_logic;
1016 signal mem_refclk : std_logic;
1017 signal pll_locked : std_logic;
1018 signal sync_pulse : std_logic;
1019 signal mmcm_ps_clk : std_logic;
1020 signal poc_sample_pd : std_logic;
1021 signal psen : std_logic;
1022 signal psincdec : std_logic;
1023 signal psdone : std_logic;
1024 signal iddr_rst : std_logic;
1025 signal ref_dll_lock : std_logic;
1026 signal rst_phaser_ref : std_logic;
1027
1028 signal rst : std_logic;
1029
1030 signal app_ecc_multiple_err : std_logic_vector((2*nCK_PER_CLK)-1 downto 0);
1031 signal app_ecc_single_err : std_logic_vector((2*nCK_PER_CLK)-1 downto 0);
1032 signal ddr2_reset_n : std_logic;
1033
1034 signal ddr2_parity : std_logic;
1035
1036 signal init_calib_complete_i : std_logic;
1037
1038 signal sys_clk_p : std_logic;
1039 signal sys_clk_n : std_logic;
1040 signal mmcm_clk : std_logic;
1041 signal clk_ref_p : std_logic;
1042 signal clk_ref_n : std_logic;
1043 signal device_temp_s : std_logic_vector(11 downto 0);
1044
1045 -- Debug port signals
1046 signal dbg_idel_down_all : std_logic;
1047 signal dbg_idel_down_cpt : std_logic;
1048 signal dbg_idel_up_all : std_logic;
1049 signal dbg_idel_up_cpt : std_logic;
1050 signal dbg_sel_all_idel_cpt : std_logic;
1051 signal dbg_sel_idel_cpt : std_logic_vector(DQS_CNT_WIDTH-1 downto 0);
1052 signal dbg_po_f_stg23_sel : std_logic;
1053 signal dbg_sel_pi_incdec : std_logic;
1054 signal dbg_sel_po_incdec : std_logic;
1055 signal dbg_byte_sel : std_logic_vector(DQS_CNT_WIDTH downto 0);
1056 signal dbg_pi_f_inc : std_logic;
1057 signal dbg_po_f_inc : std_logic;
1058 signal dbg_pi_f_dec : std_logic;
1059 signal dbg_po_f_dec : std_logic;
1060 signal dbg_pi_counter_read_val : std_logic_vector(5 downto 0);
1061 signal dbg_po_counter_read_val : std_logic_vector(8 downto 0);
1062 signal dbg_prbs_final_dqs_tap_cnt_r : std_logic_vector(11 downto 0);
1063 signal dbg_prbs_first_edge_taps : std_logic_vector(11 downto 0);
1064 signal dbg_prbs_second_edge_taps : std_logic_vector(11 downto 0);
1065 signal dbg_cpt_tap_cnt : std_logic_vector((6*DQS_WIDTH*RANKS)-1 downto 0);
1066 signal dbg_dq_idelay_tap_cnt : std_logic_vector((5*DQS_WIDTH*RANKS)-1 downto 0);
1067 signal dbg_calib_top : std_logic_vector(255 downto 0);
1068 signal dbg_cpt_first_edge_cnt : std_logic_vector((6*DQS_WIDTH*RANKS)-1 downto 0);
1069 signal dbg_cpt_second_edge_cnt : std_logic_vector((6*DQS_WIDTH*RANKS)-1 downto 0);
1070 signal dbg_rd_data_offset : std_logic_vector((6*RANKS)-1 downto 0);
1071 signal dbg_phy_rdlvl : std_logic_vector(255 downto 0);
1072 signal dbg_phy_wrcal : std_logic_vector(99 downto 0);
1073 signal dbg_final_po_fine_tap_cnt : std_logic_vector((6*DQS_WIDTH)-1 downto 0);
1074 signal dbg_final_po_coarse_tap_cnt : std_logic_vector((3*DQS_WIDTH)-1 downto 0);
1075 signal dbg_phy_wrlvl : std_logic_vector(255 downto 0);
1076 signal dbg_phy_init : std_logic_vector(255 downto 0);
1077 signal dbg_prbs_rdlvl : std_logic_vector(255 downto 0);
1078 signal dbg_dqs_found_cal : std_logic_vector(255 downto 0);
1079 signal dbg_pi_phaselock_start : std_logic;
1080 signal dbg_pi_phaselocked_done : std_logic;
1081 signal dbg_pi_phaselock_err : std_logic;
1082 signal dbg_pi_dqsfound_start : std_logic;
1083 signal dbg_pi_dqsfound_done : std_logic;
1084 signal dbg_pi_dqsfound_err : std_logic;
1085 signal dbg_wrcal_start : std_logic;
1086 signal dbg_wrcal_done : std_logic;
1087 signal dbg_wrcal_err : std_logic;
1088 signal dbg_pi_dqs_found_lanes_phy4lanes : std_logic_vector(11 downto 0);
1089 signal dbg_pi_phase_locked_phy4lanes : std_logic_vector(11 downto 0);
1090 signal dbg_oclkdelay_calib_start : std_logic;
1091 signal dbg_oclkdelay_calib_done : std_logic;
1092 signal dbg_phy_oclkdelay_cal : std_logic_vector(255 downto 0);
1093 signal dbg_oclkdelay_rd_data : std_logic_vector((DRAM_WIDTH*16)-1 downto 0);
1094 signal dbg_rd_data_edge_detect : std_logic_vector(DQS_WIDTH-1 downto 0);
1095 signal dbg_rddata : std_logic_vector((2*nCK_PER_CLK*DQ_WIDTH)-1 downto 0);
1096 signal dbg_rddata_valid : std_logic;
1097 signal dbg_rdlvl_done : std_logic_vector(1 downto 0);
1098 signal dbg_rdlvl_err : std_logic_vector(1 downto 0);
1099 signal dbg_rdlvl_start : std_logic_vector(1 downto 0);
1100 signal dbg_wrlvl_fine_tap_cnt : std_logic_vector((6*DQS_WIDTH)-1 downto 0);
1101 signal dbg_wrlvl_coarse_tap_cnt : std_logic_vector((3*DQS_WIDTH)-1 downto 0);
1102 signal dbg_tap_cnt_during_wrlvl : std_logic_vector(5 downto 0);
1103 signal dbg_wl_edge_detect_valid : std_logic;
1104 signal dbg_wrlvl_done : std_logic;
1105 signal dbg_wrlvl_err : std_logic;
1106 signal dbg_wrlvl_start : std_logic;
1107 signal dbg_rddata_r : std_logic_vector(63 downto 0);
1108 signal dbg_rddata_valid_r : std_logic;
1109 signal ocal_tap_cnt : std_logic_vector(53 downto 0);
1110 signal dbg_dqs : std_logic_vector(4 downto 0);
1111 signal dbg_bit : std_logic_vector(8 downto 0);
1112 signal rd_data_edge_detect_r : std_logic_vector(8 downto 0);
1113 signal wl_po_fine_cnt : std_logic_vector(53 downto 0);
1114 signal wl_po_coarse_cnt : std_logic_vector(26 downto 0);
1115 signal dbg_calib_rd_data_offset_1 : std_logic_vector((6*RANKS)-1 downto 0);
1116 signal dbg_calib_rd_data_offset_2 : std_logic_vector((6*RANKS)-1 downto 0);
1117 signal dbg_data_offset : std_logic_vector(5 downto 0);
1118 signal dbg_data_offset_1 : std_logic_vector(5 downto 0);
1119 signal dbg_data_offset_2 : std_logic_vector(5 downto 0);
1120 signal all_zeros : std_logic_vector((2*nCK_PER_CLK)-1 downto 0) := (others => '0');
1121
1122 signal ddr2_ila_basic_int : std_logic_vector(119 downto 0);
1123 signal ddr2_ila_wrpath_int : std_logic_vector(390 downto 0);
1124 signal ddr2_ila_rdpath_int : std_logic_vector(1023 downto 0);
1125 signal dbg_prbs_final_dqs_tap_cnt_r_int : std_logic_vector(11 downto 0);
1126 signal dbg_prbs_first_edge_taps_int : std_logic_vector(11 downto 0);
1127 signal dbg_prbs_second_edge_taps_int : std_logic_vector(11 downto 0);
1128
1129
1130begin
1131
1132--***************************************************************************
1133
1134
1135
1136
1137
1138 ui_clk <= clk;
1140
1141 sys_clk_p <= '0';
1142 sys_clk_n <= '0';
1143 clk_ref_p <= '0';
1144 clk_ref_n <= '0';
1146
1147
1148
1149 clk_ref_in_use_sys_clk : if (REFCLK_TYPE = "USE_SYSTEM_CLOCK") generate
1151 end generate;
1152
1153 clk_ref_in_others : if (REFCLK_TYPE /= "USE_SYSTEM_CLOCK") generate
1155 end generate;
1156
1157 u_iodelay_ctrl : mig_7series_v4_2_iodelay_ctrl
1158 generic map
1159 (
1160 TCQ => TCQ,
1161 IODELAY_GRP0 => IODELAY_GRP0,
1162 IODELAY_GRP1 => IODELAY_GRP1,
1163 REFCLK_TYPE => REFCLK_TYPE,
1164 SYSCLK_TYPE => SYSCLK_TYPE,
1165 SYS_RST_PORT => SYS_RST_PORT,
1166 RST_ACT_LOW => RST_ACT_LOW,
1167 DIFF_TERM_REFCLK => DIFF_TERM_REFCLK,
1168 FPGA_SPEED_GRADE => FPGA_SPEED_GRADE,
1169 REF_CLK_MMCM_IODELAY_CTRL => REF_CLK_MMCM_IODELAY_CTRL
1170 )
1171 port map
1172 (
1173 -- Outputs
1174 iodelay_ctrl_rdy => iodelay_ctrl_rdy,
1175 sys_rst_o => sys_rst_o,
1176 clk_ref => clk_ref,
1177 -- Inputs
1178 clk_ref_p => clk_ref_p,
1179 clk_ref_n => clk_ref_n,
1180 clk_ref_i => clk_ref_in,
1181 sys_rst => sys_rst
1182 );
1183 u_ddr2_clk_ibuf : mig_7series_v4_2_clk_ibuf
1184 generic map
1185 (
1186 SYSCLK_TYPE => SYSCLK_TYPE,
1187 DIFF_TERM_SYSCLK => DIFF_TERM_SYSCLK
1188 )
1189 port map
1190 (
1191 sys_clk_p => sys_clk_p,
1192 sys_clk_n => sys_clk_n,
1193 sys_clk_i => sys_clk_i,
1194 mmcm_clk => mmcm_clk
1195 );
1196 -- Temperature monitoring logic
1197
1198 temp_mon_enabled : if (TEMP_MON_EN = "ON") generate
1199 u_tempmon : mig_7series_v4_2_tempmon
1200 generic map
1201 (
1202 TCQ => TCQ,
1203 TEMP_MON_CONTROL => TEMP_MON_CONTROL,
1204 XADC_CLK_PERIOD => XADC_CLK_PERIOD,
1205 tTEMPSAMPLE => tTEMPSAMPLE
1206 )
1207 port map
1208 (
1209 clk => clk,
1210 xadc_clk => clk_ref(0),
1211 rst => rst,
1212 device_temp_i => device_temp_i,
1213 device_temp => device_temp_s
1214 );
1215 end generate;
1216
1217 temp_mon_disabled : if (TEMP_MON_EN /= "ON") generate
1218 device_temp_s <= (others => '0');
1219 end generate;
1220
1221
1222 u_ddr2_infrastructure : mig_7series_v4_2_infrastructure
1223 generic map
1224 (
1225 TCQ => TCQ,
1226 nCK_PER_CLK => nCK_PER_CLK,
1227 CLKIN_PERIOD => CLKIN_PERIOD,
1228 SYSCLK_TYPE => SYSCLK_TYPE,
1229 CLKFBOUT_MULT => CLKFBOUT_MULT,
1230 DIVCLK_DIVIDE => DIVCLK_DIVIDE,
1231 CLKOUT0_PHASE => CLKOUT0_PHASE,
1232 CLKOUT0_DIVIDE => CLKOUT0_DIVIDE,
1233 CLKOUT1_DIVIDE => CLKOUT1_DIVIDE,
1234 CLKOUT2_DIVIDE => CLKOUT2_DIVIDE,
1235 CLKOUT3_DIVIDE => CLKOUT3_DIVIDE,
1236 MMCM_VCO => MMCM_VCO,
1237 MMCM_MULT_F => MMCM_MULT_F,
1238 MMCM_DIVCLK_DIVIDE => MMCM_DIVCLK_DIVIDE,
1239 RST_ACT_LOW => RST_ACT_LOW,
1240 tCK => tCK,
1241 MEM_TYPE => DRAM_TYPE
1242 )
1243 port map
1244 (
1245 -- Outputs
1246 rstdiv0 => rst,
1247 clk => clk,
1248 clk_div2 => clk_div2,
1249 rst_div2 => rst_div2,
1250 mem_refclk => mem_refclk,
1251 freq_refclk => freq_refclk,
1252 sync_pulse => sync_pulse,
1253 psen => psen,
1254 psincdec => psincdec,
1255 mmcm_ps_clk => mmcm_ps_clk,
1256 poc_sample_pd => poc_sample_pd,
1257 iddr_rst => iddr_rst,
1258 psdone => psdone,
1259-- auxout_clk => open,
1260 ui_addn_clk_0 => open,
1261 ui_addn_clk_1 => open,
1262 ui_addn_clk_2 => open,
1263 ui_addn_clk_3 => open,
1264 ui_addn_clk_4 => open,
1265 pll_locked => pll_locked,
1266 mmcm_locked => open,
1267 rst_phaser_ref => rst_phaser_ref,
1268 -- Inputs
1269 mmcm_clk => mmcm_clk,
1270 sys_rst => sys_rst_o,
1271 iodelay_ctrl_rdy => iodelay_ctrl_rdy,
1272 ref_dll_lock => ref_dll_lock
1273 );
1274
1275
1276 u_memc_ui_top_std : mig_7series_v4_2_memc_ui_top_std
1277 generic map (
1278 TCQ => TCQ,
1279 ADDR_CMD_MODE => ADDR_CMD_MODE,
1280 AL => AL,
1281 PAYLOAD_WIDTH => PAYLOAD_WIDTH,
1282 BANK_WIDTH => BANK_WIDTH,
1283 BM_CNT_WIDTH => BM_CNT_WIDTH,
1284 BURST_MODE => BURST_MODE,
1285 BURST_TYPE => BURST_TYPE,
1286 CK_WIDTH => CK_WIDTH,
1287 COL_WIDTH => COL_WIDTH,
1288 CMD_PIPE_PLUS1 => CMD_PIPE_PLUS1,
1289 CS_WIDTH => CS_WIDTH,
1290 nCS_PER_RANK => nCS_PER_RANK,
1291 CKE_WIDTH => CKE_WIDTH,
1292 DATA_WIDTH => DATA_WIDTH,
1293 DATA_BUF_ADDR_WIDTH => DATA_BUF_ADDR_WIDTH,
1294 DM_WIDTH => DM_WIDTH,
1295 DQ_CNT_WIDTH => DQ_CNT_WIDTH,
1296 DQ_WIDTH => DQ_WIDTH,
1297 DQS_CNT_WIDTH => DQS_CNT_WIDTH,
1298 DQS_WIDTH => DQS_WIDTH,
1299 DRAM_TYPE => DRAM_TYPE,
1300 DRAM_WIDTH => DRAM_WIDTH,
1301 ECC => ECC,
1302 ECC_WIDTH => ECC_WIDTH,
1303 ECC_TEST => ECC_TEST,
1304 MC_ERR_ADDR_WIDTH => MC_ERR_ADDR_WIDTH,
1305 REFCLK_FREQ => REFCLK_FREQ,
1306 nAL => nAL,
1307 nBANK_MACHS => nBANK_MACHS,
1308 CKE_ODT_AUX => CKE_ODT_AUX,
1309 nCK_PER_CLK => nCK_PER_CLK,
1310 ORDERING => ORDERING,
1311 OUTPUT_DRV => OUTPUT_DRV,
1312 IBUF_LPWR_MODE => IBUF_LPWR_MODE,
1313 DATA_IO_IDLE_PWRDWN => DATA_IO_IDLE_PWRDWN,
1314 BANK_TYPE => BANK_TYPE,
1315 DATA_IO_PRIM_TYPE => DATA_IO_PRIM_TYPE,
1316 IODELAY_GRP0 => IODELAY_GRP0,
1317 IODELAY_GRP1 => IODELAY_GRP1,
1318 FPGA_SPEED_GRADE => FPGA_SPEED_GRADE,
1319 REG_CTRL => REG_CTRL,
1320 RTT_NOM => RTT_NOM,
1321 CL => CL,
1322 tCK => tCK,
1323 tCKE => tCKE,
1324 tFAW => tFAW,
1325 tPRDI => tPRDI,
1326 tRAS => tRAS,
1327 tRCD => tRCD,
1328 tREFI => tREFI,
1329 tRFC => tRFC,
1330 tRP => tRP,
1331 tRRD => tRRD,
1332 tRTP => tRTP,
1333 tWTR => tWTR,
1334 tZQI => tZQI,
1335 tZQCS => tZQCS,
1336 USER_REFRESH => USER_REFRESH,
1337 TEMP_MON_EN => TEMP_MON_EN,
1338 WRLVL => WRLVL,
1339 DEBUG_PORT => DEBUG_PORT,
1340 CAL_WIDTH => CAL_WIDTH,
1341 RANK_WIDTH => RANK_WIDTH,
1342 RANKS => RANKS,
1343 ODT_WIDTH => ODT_WIDTH,
1344 ROW_WIDTH => ROW_WIDTH,
1345 ADDR_WIDTH => ADDR_WIDTH,
1346 APP_DATA_WIDTH => APP_DATA_WIDTH,
1347 APP_MASK_WIDTH => APP_MASK_WIDTH,
1348 SIM_BYPASS_INIT_CAL => SIM_BYPASS_INIT_CAL,
1349 BYTE_LANES_B0 => BYTE_LANES_B0,
1350 BYTE_LANES_B1 => BYTE_LANES_B1,
1351 BYTE_LANES_B2 => BYTE_LANES_B2,
1352 BYTE_LANES_B3 => BYTE_LANES_B3,
1353 BYTE_LANES_B4 => BYTE_LANES_B4,
1354 DATA_CTL_B0 => DATA_CTL_B0,
1355 DATA_CTL_B1 => DATA_CTL_B1,
1356 DATA_CTL_B2 => DATA_CTL_B2,
1357 DATA_CTL_B3 => DATA_CTL_B3,
1358 DATA_CTL_B4 => DATA_CTL_B4,
1359 PHY_0_BITLANES => PHY_0_BITLANES,
1360 PHY_1_BITLANES => PHY_1_BITLANES,
1361 PHY_2_BITLANES => PHY_2_BITLANES,
1362 CK_BYTE_MAP => CK_BYTE_MAP,
1363 ADDR_MAP => ADDR_MAP,
1364 BANK_MAP => BANK_MAP,
1365 CAS_MAP => CAS_MAP,
1366 CKE_ODT_BYTE_MAP => CKE_ODT_BYTE_MAP,
1367 CKE_MAP => CKE_MAP,
1368 ODT_MAP => ODT_MAP,
1369 CS_MAP => CS_MAP,
1370 PARITY_MAP => PARITY_MAP,
1371 RAS_MAP => RAS_MAP,
1372 WE_MAP => WE_MAP,
1373 DQS_BYTE_MAP => DQS_BYTE_MAP,
1374 DATA0_MAP => DATA0_MAP,
1375 DATA1_MAP => DATA1_MAP,
1376 DATA2_MAP => DATA2_MAP,
1377 DATA3_MAP => DATA3_MAP,
1378 DATA4_MAP => DATA4_MAP,
1379 DATA5_MAP => DATA5_MAP,
1380 DATA6_MAP => DATA6_MAP,
1381 DATA7_MAP => DATA7_MAP,
1382 DATA8_MAP => DATA8_MAP,
1383 DATA9_MAP => DATA9_MAP,
1384 DATA10_MAP => DATA10_MAP,
1385 DATA11_MAP => DATA11_MAP,
1386 DATA12_MAP => DATA12_MAP,
1387 DATA13_MAP => DATA13_MAP,
1388 DATA14_MAP => DATA14_MAP,
1389 DATA15_MAP => DATA15_MAP,
1390 DATA16_MAP => DATA16_MAP,
1391 DATA17_MAP => DATA17_MAP,
1392 MASK0_MAP => MASK0_MAP,
1393 MASK1_MAP => MASK1_MAP,
1394 CALIB_ROW_ADD => CALIB_ROW_ADD,
1395 CALIB_COL_ADD => CALIB_COL_ADD,
1396 CALIB_BA_ADD => CALIB_BA_ADD,
1397 SLOT_0_CONFIG => SLOT_0_CONFIG,
1398 SLOT_1_CONFIG => SLOT_1_CONFIG,
1399 MEM_ADDR_ORDER => MEM_ADDR_ORDER,
1400 STARVE_LIMIT => STARVE_LIMIT,
1401 USE_CS_PORT => USE_CS_PORT,
1402 USE_DM_PORT => USE_DM_PORT,
1403 USE_ODT_PORT => USE_ODT_PORT,
1404 IDELAY_ADJ => "OFF",
1405 FINE_PER_BIT => "OFF",
1406 CENTER_COMP_MODE => "OFF",
1407 PI_VAL_ADJ => "OFF",
1408 MASTER_PHY_CTL => PHY_CONTROL_MASTER_BANK,
1409 TAPSPERKCLK => TAPSPERKCLK,
1410 SKIP_CALIB => "FALSE",
1411 FPGA_VOLT_TYPE => "N"
1412 )
1413 port map (
1414 clk => clk,
1415 clk_div2 => clk_div2,
1416 rst_div2 => rst_div2,
1417 clk_ref => clk_ref,
1418 mem_refclk => mem_refclk, --memory clock
1419 freq_refclk => freq_refclk,
1420 pll_lock => pll_locked,
1421 sync_pulse => sync_pulse,
1422 rst => rst,
1423 rst_phaser_ref => rst_phaser_ref,
1424 ref_dll_lock => ref_dll_lock,
1425 iddr_rst => iddr_rst,
1426 mmcm_ps_clk => mmcm_ps_clk,
1427 poc_sample_pd => poc_sample_pd,
1428
1429-- Memory interface ports
1430 ddr_dq => ddr2_dq,
1431 ddr_dqs_n => ddr2_dqs_n,
1432 ddr_dqs => ddr2_dqs_p,
1433 ddr_addr => ddr2_addr,
1434 ddr_ba => ddr2_ba,
1435 ddr_cas_n => ddr2_cas_n,
1436 ddr_ck_n => ddr2_ck_n,
1437 ddr_ck => ddr2_ck_p,
1438 ddr_cke => ddr2_cke,
1439 ddr_cs_n => ddr2_cs_n,
1440 ddr_dm => ddr2_dm,
1441 ddr_odt => ddr2_odt,
1442 ddr_ras_n => ddr2_ras_n,
1443 ddr_reset_n => ddr2_reset_n,
1444 ddr_parity => ddr2_parity,
1445 ddr_we_n => ddr2_we_n,
1446 bank_mach_next => bank_mach_next,
1447
1448-- Application interface ports
1449 app_addr => app_addr,
1450 app_cmd => app_cmd,
1451 app_en => app_en,
1452 app_hi_pri => '0',
1453 app_wdf_data => app_wdf_data,
1454 app_wdf_end => app_wdf_end,
1455 app_wdf_mask => app_wdf_mask,
1456 app_wdf_wren => app_wdf_wren,
1457 app_ecc_multiple_err => app_ecc_multiple_err,
1458 app_ecc_single_err => app_ecc_single_err,
1459 app_rd_data => app_rd_data,
1460 app_rd_data_end => app_rd_data_end,
1461 app_rd_data_valid => app_rd_data_valid,
1462 app_rdy => app_rdy,
1463 app_wdf_rdy => app_wdf_rdy,
1464 app_sr_req => app_sr_req,
1465 app_sr_active => app_sr_active,
1466 app_ref_req => app_ref_req,
1467 app_ref_ack => app_ref_ack,
1468 app_zq_req => app_zq_req,
1469 app_zq_ack => app_zq_ack,
1470 app_raw_not_ecc => all_zeros,
1471 app_correct_en_i => '1',
1472
1473 psen => psen,
1474 psincdec => psincdec,
1475 psdone => psdone,
1476 device_temp => device_temp_s,
1477
1478 -- Ports to be used when SKIP_CALIB="TRUE"
1479 calib_tap_req => open,
1480 calib_tap_addr => (others => '0'),
1481 calib_tap_load => '0',
1482 calib_tap_val => (others => '0'),
1483 calib_tap_load_done => '0',
1484
1485-- Debug logic ports
1486 dbg_idel_up_all => dbg_idel_up_all,
1487 dbg_idel_down_all => dbg_idel_down_all,
1488 dbg_idel_up_cpt => dbg_idel_up_cpt,
1489 dbg_idel_down_cpt => dbg_idel_down_cpt,
1490 dbg_sel_idel_cpt => dbg_sel_idel_cpt,
1491 dbg_sel_all_idel_cpt => dbg_sel_all_idel_cpt,
1492 dbg_sel_pi_incdec => dbg_sel_pi_incdec,
1493 dbg_sel_po_incdec => dbg_sel_po_incdec,
1494 dbg_byte_sel => dbg_byte_sel,
1495 dbg_pi_f_inc => dbg_pi_f_inc,
1496 dbg_pi_f_dec => dbg_pi_f_dec,
1497 dbg_po_f_inc => dbg_po_f_inc,
1498 dbg_po_f_stg23_sel => dbg_po_f_stg23_sel,
1499 dbg_po_f_dec => dbg_po_f_dec,
1500 dbg_cpt_tap_cnt => dbg_cpt_tap_cnt,
1501 dbg_dq_idelay_tap_cnt => dbg_dq_idelay_tap_cnt,
1502 dbg_calib_top => dbg_calib_top,
1503 dbg_cpt_first_edge_cnt => dbg_cpt_first_edge_cnt,
1504 dbg_cpt_second_edge_cnt => dbg_cpt_second_edge_cnt,
1505 dbg_rd_data_offset => dbg_rd_data_offset,
1506 dbg_phy_rdlvl => dbg_phy_rdlvl,
1507 dbg_phy_wrcal => dbg_phy_wrcal,
1508 dbg_final_po_fine_tap_cnt => dbg_final_po_fine_tap_cnt,
1509 dbg_final_po_coarse_tap_cnt => dbg_final_po_coarse_tap_cnt,
1510 dbg_rd_data_edge_detect => dbg_rd_data_edge_detect,
1511 dbg_rddata => dbg_rddata,
1512 dbg_rddata_valid => dbg_rddata_valid,
1513 dbg_rdlvl_done => dbg_rdlvl_done,
1514 dbg_rdlvl_err => dbg_rdlvl_err,
1515 dbg_rdlvl_start => dbg_rdlvl_start,
1516 dbg_wrlvl_fine_tap_cnt => dbg_wrlvl_fine_tap_cnt,
1517 dbg_wrlvl_coarse_tap_cnt => dbg_wrlvl_coarse_tap_cnt,
1518 dbg_tap_cnt_during_wrlvl => dbg_tap_cnt_during_wrlvl,
1519 dbg_wl_edge_detect_valid => dbg_wl_edge_detect_valid,
1520 dbg_wrlvl_done => dbg_wrlvl_done,
1521 dbg_wrlvl_err => dbg_wrlvl_err,
1522 dbg_wrlvl_start => dbg_wrlvl_start,
1523 dbg_phy_wrlvl => dbg_phy_wrlvl,
1524 dbg_phy_init => dbg_phy_init,
1525 dbg_prbs_rdlvl => dbg_prbs_rdlvl,
1526 dbg_dqs_found_cal => dbg_dqs_found_cal,
1527 dbg_pi_counter_read_val => dbg_pi_counter_read_val,
1528 dbg_po_counter_read_val => dbg_po_counter_read_val,
1529 dbg_pi_phaselock_start => dbg_pi_phaselock_start,
1530 dbg_pi_phaselocked_done => dbg_pi_phaselocked_done,
1531 dbg_pi_phaselock_err => dbg_pi_phaselock_err,
1532 dbg_pi_phase_locked_phy4lanes => dbg_pi_phase_locked_phy4lanes,
1533 dbg_pi_dqsfound_start => dbg_pi_dqsfound_start,
1534 dbg_pi_dqsfound_done => dbg_pi_dqsfound_done,
1535 dbg_pi_dqsfound_err => dbg_pi_dqsfound_err,
1536 dbg_pi_dqs_found_lanes_phy4lanes => dbg_pi_dqs_found_lanes_phy4lanes,
1537 dbg_calib_rd_data_offset_1 => dbg_calib_rd_data_offset_1,
1538 dbg_calib_rd_data_offset_2 => dbg_calib_rd_data_offset_2,
1539 dbg_data_offset => dbg_data_offset,
1540 dbg_data_offset_1 => dbg_data_offset_1,
1541 dbg_data_offset_2 => dbg_data_offset_2,
1542 dbg_wrcal_start => dbg_wrcal_start,
1543 dbg_wrcal_done => dbg_wrcal_done,
1544 dbg_wrcal_err => dbg_wrcal_err,
1545 dbg_phy_oclkdelay_cal => dbg_phy_oclkdelay_cal,
1546 dbg_oclkdelay_rd_data => dbg_oclkdelay_rd_data,
1547 dbg_oclkdelay_calib_start => dbg_oclkdelay_calib_start,
1548 dbg_oclkdelay_calib_done => dbg_oclkdelay_calib_done,
1549 dbg_prbs_final_dqs_tap_cnt_r => dbg_prbs_final_dqs_tap_cnt_r_int,
1550 dbg_prbs_first_edge_taps => dbg_prbs_first_edge_taps_int,
1551 dbg_prbs_second_edge_taps => dbg_prbs_second_edge_taps_int,
1552 init_calib_complete => init_calib_complete_i,
1553 dbg_poc => open
1554 );
1555
1556
1557
1558
1559
1560
1561
1562 --*********************************************************************
1563 -- Resetting all RTL debug inputs as the debug ports are not enabled
1564 --*********************************************************************
1565 dbg_idel_down_all <= '0';
1566 dbg_idel_down_cpt <= '0';
1567 dbg_idel_up_all <= '0';
1568 dbg_idel_up_cpt <= '0';
1569 dbg_sel_all_idel_cpt <= '0';
1570 dbg_sel_idel_cpt <= (others => '0');
1571 dbg_byte_sel <= (others => '0');
1572 dbg_sel_pi_incdec <= '0';
1573 dbg_pi_f_inc <= '0';
1574 dbg_pi_f_dec <= '0';
1575 dbg_po_f_inc <= '0';
1576 dbg_po_f_dec <= '0';
1577 dbg_po_f_stg23_sel <= '0';
1578 dbg_sel_po_incdec <= '0';
1579
1580
1581
1582end architecture arch_migui_nexys4d_mig;
1583
1584
mig_7series_v4_2_memc_ui_top_std u_memc_ui_top_stdu_memc_ui_top_std
integer := clogb2( nBANK_MACHS ) BM_CNT_WIDTH
std_logic_vector( 11 downto 0) dbg_pi_phase_locked_phy4lanes
std_logic_vector( 8 downto 0) rd_data_edge_detect_r
std_logic_vector( 119 downto 0) ddr2_ila_basic_int
std_logic_vector(( 6* DQS_WIDTH)- 1 downto 0) dbg_final_po_fine_tap_cnt
std_logic_vector( 11 downto 0) dbg_prbs_final_dqs_tap_cnt_r
std_logic_vector( 255 downto 0) dbg_prbs_rdlvl
std_logic_vector( 1 downto 0) dbg_rdlvl_err
std_logic_vector( 11 downto 0) dbg_pi_dqs_found_lanes_phy4lanes
std_logic_vector( 11 downto 0) dbg_prbs_first_edge_taps
std_logic_vector( 1 downto 0) iodelay_ctrl_rdy
std_logic_vector( 1 downto 0) dbg_rdlvl_done
mig_7series_v4_2_iodelay_ctrl u_iodelay_ctrlu_iodelay_ctrl
integer := XWIDTH+ BANK_WIDTH+ ROW_WIDTH+ COL_WIDTH+ DATA_BUF_OFFSET_WIDTH MC_ERR_ADDR_WIDTH
std_logic_vector( 11 downto 0) device_temp_s
std_logic_vector( 1 downto 0) dbg_rdlvl_start
std_logic_vector( 1023 downto 0) ddr2_ila_rdpath_int
std_logic_vector( 255 downto 0) dbg_dqs_found_cal
std_logic_vector( DQS_CNT_WIDTH downto 0) dbg_byte_sel
mig_7series_v4_2_clk_ibuf u_ddr2_clk_ibufu_ddr2_clk_ibuf
std_logic_vector(( 2* nCK_PER_CLK)- 1 downto 0) app_ecc_single_err
std_logic_vector(( DRAM_WIDTH* 16)- 1 downto 0) dbg_oclkdelay_rd_data
std_logic_vector( 53 downto 0) ocal_tap_cnt
std_logic_vector( 63 downto 0) dbg_rddata_r
std_logic_vector(( 5* DQS_WIDTH* RANKS)- 1 downto 0) dbg_dq_idelay_tap_cnt
std_logic_vector( 255 downto 0) dbg_phy_rdlvl
std_logic_vector( 5 downto 0) dbg_data_offset
std_logic_vector( 5 downto 0) dbg_pi_counter_read_val
std_logic_vector(( 2* nCK_PER_CLK* DQ_WIDTH)- 1 downto 0) dbg_rddata
std_logic_vector(( 6* DQS_WIDTH* RANKS)- 1 downto 0) dbg_cpt_tap_cnt
mig_7series_v4_2_tempmon u_tempmonu_tempmon
std_logic_vector( 390 downto 0) ddr2_ila_wrpath_int
mig_7series_v4_2_infrastructure u_ddr2_infrastructureu_ddr2_infrastructure
std_logic_vector( DQS_WIDTH- 1 downto 0) dbg_rd_data_edge_detect
std_logic_vector( 255 downto 0) dbg_calib_top
std_logic_vector( 255 downto 0) dbg_phy_oclkdelay_cal
std_logic_vector(( 2* nCK_PER_CLK)- 1 downto 0) app_ecc_multiple_err
std_logic_vector( 11 downto 0) dbg_prbs_second_edge_taps_int
std_logic_vector(( 6* RANKS)- 1 downto 0) dbg_calib_rd_data_offset_1
std_logic_vector( 5 downto 0) dbg_data_offset_2
std_logic_vector( 5 downto 0) dbg_tap_cnt_during_wrlvl
std_logic_vector( 255 downto 0) dbg_phy_wrlvl
std_logic_vector( 11 downto 0) dbg_prbs_second_edge_taps
std_logic_vector(( 6* DQS_WIDTH* RANKS)- 1 downto 0) dbg_cpt_second_edge_cnt
std_logic_vector(( 6* DQS_WIDTH)- 1 downto 0) dbg_wrlvl_fine_tap_cnt
std_logic_vector( 53 downto 0) wl_po_fine_cnt
std_logic_vector(( 3* DQS_WIDTH)- 1 downto 0) dbg_final_po_coarse_tap_cnt
std_logic_vector( BM_CNT_WIDTH- 1 downto 0) bank_mach_next
std_logic_vector(( 6* RANKS)- 1 downto 0) dbg_rd_data_offset
integer := APP_DATA_WIDTH/ 8 APP_MASK_WIDTH
std_logic_vector(( 2* nCK_PER_CLK)- 1 downto 0) :=( others => '0') all_zeros
std_logic_vector(( 3* DQS_WIDTH)- 1 downto 0) dbg_wrlvl_coarse_tap_cnt
std_logic_vector( 26 downto 0) wl_po_coarse_cnt
integer := 2* nCK_PER_CLK* PAYLOAD_WIDTH APP_DATA_WIDTH
std_logic_vector(( 6* RANKS)- 1 downto 0) dbg_calib_rd_data_offset_2
std_logic_vector( 11 downto 0) dbg_prbs_first_edge_taps_int
std_logic_vector( 255 downto 0) dbg_phy_init
std_logic_vector( 99 downto 0) dbg_phy_wrcal
std_logic_vector( 5 downto 0) dbg_data_offset_1
std_logic_vector( 11 downto 0) dbg_prbs_final_dqs_tap_cnt_r_int
std_logic_vector( DQS_CNT_WIDTH- 1 downto 0) dbg_sel_idel_cpt
std_logic_vector(( 6* DQS_WIDTH* RANKS)- 1 downto 0) dbg_cpt_first_edge_cnt
std_logic_vector( 8 downto 0) dbg_po_counter_read_val
BYTE_LANES_B4 std_logic_vector( 3 downto 0) := "0000"
in app_sr_req std_logic
FPGA_SPEED_GRADE integer := 1
DATA_CTL_B0 std_logic_vector( 3 downto 0) := "0101"
DATA_CTL_B3 std_logic_vector( 3 downto 0) := "0000"
in device_temp_i std_logic_vector( 11 downto 0)
SIMULATION string := "FALSE"
USE_ODT_PORT integer := 1
PHY_1_BITLANES std_logic_vector( 47 downto 0) := X"000000000000"
tREFI integer := 7800000
DATA0_MAP std_logic_vector( 95 downto 0) := X"008004009007005001006003"
tCK integer := 3333
out app_rd_data std_logic_vector(( nCK_PER_CLK* 2* PAYLOAD_WIDTH)- 1 downto 0)
PAYLOAD_WIDTH integer := 16
BYTE_LANES_B1 std_logic_vector( 3 downto 0) := "0000"
CS_MAP std_logic_vector( 119 downto 0) := X"000000000000000000000000000037"
nBANK_MACHS integer := 2
REFCLK_TYPE string := "NO_BUFFER"
in app_cmd std_logic_vector( 2 downto 0)
nCK_PER_CLK integer := 4
DIFF_TERM_REFCLK string := "TRUE"
out app_zq_ack std_logic
DATA_CTL_B4 std_logic_vector( 3 downto 0) := "0000"
IBUF_LPWR_MODE string := "OFF"
MMCM_VCO integer := 1200
ROW_WIDTH integer := 13
in app_wdf_end std_logic
IODELAY_GRP0 string := "MIGUI_NEXYS4D_IODELAY_MIG0"
BYTE_LANES_B2 std_logic_vector( 3 downto 0) := "0000"
in app_zq_req std_logic
CLKFBOUT_MULT integer := 12
tRTP integer := 7500
RST_ACT_LOW integer := 0
MMCM_DIVCLK_DIVIDE integer := 1
DATA3_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
BYTE_LANES_B0 std_logic_vector( 3 downto 0) := "1111"
out ddr2_cke std_logic_vector( CKE_WIDTH- 1 downto 0)
ODT_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000035"
out ddr2_we_n std_logic
out ddr2_cas_n std_logic
out app_wdf_rdy std_logic
tZQI integer := 128000000
RAS_MAP std_logic_vector( 11 downto 0) := X"014"
USER_REFRESH string := "OFF"
DQ_CNT_WIDTH integer := 4
tWTR integer := 7500
MEM_DEVICE_WIDTH integer := 16
tRP integer := 12500
BANK_TYPE string := "HR_IO"
DATA7_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
MMCM_MULT_F integer := 15
inout ddr2_dqs_p std_logic_vector( DQS_WIDTH- 1 downto 0)
CKE_ODT_BYTE_MAP std_logic_vector( 7 downto 0) := X"00"
out ddr2_addr std_logic_vector( ROW_WIDTH- 1 downto 0)
DATA_IO_PRIM_TYPE string := "HR_LP"
out app_rd_data_end std_logic
CAS_MAP std_logic_vector( 11 downto 0) := X"039"
out ddr2_ba std_logic_vector( BANK_WIDTH- 1 downto 0)
CK_BYTE_MAP std_logic_vector( 143 downto 0) := X"000000000000000000000000000000000003"
DATA11_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
ADDR_WIDTH integer := 27
tRCD integer := 15000
CKE_WIDTH integer := 1
DIVCLK_DIVIDE integer := 1
BURST_TYPE string := "SEQ"
DATA10_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
tRRD integer := 10000
out init_calib_complete std_logic
in sys_clk_i std_logic
CALIB_ROW_ADD std_logic_vector( 15 downto 0) := X"0000"
CKE_ODT_AUX string := "FALSE"
WE_MAP std_logic_vector( 11 downto 0) := X"03B"
DATA15_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
tFAW integer := 45000
in clk_ref_i std_logic
out ddr2_ck_n std_logic_vector( CK_WIDTH- 1 downto 0)
in app_ref_req std_logic
USE_DM_PORT integer := 1
DATA_IO_IDLE_PWRDWN string := "ON"
out app_sr_active std_logic
CAL_WIDTH string := "HALF"
DATA12_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
MEM_ADDR_ORDER string := "ROW_BANK_COLUMN"
DATA16_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
PHY_0_BITLANES std_logic_vector( 47 downto 0) := X"FFC3F7FFF3FE"
DRAM_TYPE string := "DDR2"
out app_rd_data_valid std_logic
STARVE_LIMIT integer := 2
CLKOUT1_DIVIDE integer := 4
WRLVL string := "OFF"
ECC string := "OFF"
REF_CLK_MMCM_IODELAY_CTRL string := "FALSE"
inout ddr2_dq std_logic_vector( DQ_WIDTH- 1 downto 0)
TEMP_MON_CONTROL string := "EXTERNAL"
DIFF_TERM_SYSCLK string := "TRUE"
tRAS integer := 40000
out ddr2_odt std_logic_vector( ODT_WIDTH- 1 downto 0)
DATA_CTL_B2 std_logic_vector( 3 downto 0) := "0000"
DATA6_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
BANK_MAP std_logic_vector( 35 downto 0) := X"01301601B"
DQ_WIDTH integer := 16
out ui_clk std_logic
CLKIN_PERIOD integer := 9999
DATA4_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
CLKOUT3_DIVIDE integer := 16
tRFC integer := 127500
tCKE integer := 7500
RTT_NOM string := "50"
REFCLK_FREQ real := 200.0
MEM_SPEEDGRADE string := "25E"
DQS_BYTE_MAP std_logic_vector( 143 downto 0) := X"000000000000000000000000000000000200"
MASK1_MAP std_logic_vector( 107 downto 0) := X"000000000000000000000000000"
DATA_BUF_ADDR_WIDTH integer := 5
OUTPUT_DRV string := "HIGH"
ADDR_CMD_MODE string := "1T"
CLKOUT2_DIVIDE integer := 64
BANK_WIDTH integer := 3
DATA17_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
SYS_RST_PORT string := "FALSE"
PHY_CONTROL_MASTER_BANK integer := 0
SLOT_0_CONFIG std_logic_vector( 7 downto 0) := "00000001"
PHY_2_BITLANES std_logic_vector( 47 downto 0) := X"000000000000"
inout ddr2_dqs_n std_logic_vector( DQS_WIDTH- 1 downto 0)
out app_ref_ack std_logic
CALIB_COL_ADD std_logic_vector( 11 downto 0) := X"000"
CALIB_BA_ADD std_logic_vector( 2 downto 0) := "000"
DATA1_MAP std_logic_vector( 95 downto 0) := X"022028020024027025026021"
nCS_PER_RANK integer := 1
in app_addr std_logic_vector( ADDR_WIDTH- 1 downto 0)
ECC_TEST string := "OFF"
DATA8_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
SIM_BYPASS_INIT_CAL string := "OFF"
out ddr2_dm std_logic_vector( DM_WIDTH- 1 downto 0)
in app_wdf_mask std_logic_vector(( nCK_PER_CLK* 2* PAYLOAD_WIDTH/ 8)- 1 downto 0)
CKE_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000038"
CLKOUT0_DIVIDE integer := 2
DATA_CTL_B1 std_logic_vector( 3 downto 0) := "0000"
DEBUG_PORT string := "OFF"
out ddr2_ras_n std_logic
DATA2_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
COL_WIDTH integer := 10
MEM_DENSITY string := "1Gb"
REG_CTRL string := "OFF"
ORDERING string := "STRICT"
out ddr2_cs_n std_logic_vector(( CS_WIDTH* nCS_PER_RANK)- 1 downto 0)
IODELAY_GRP1 string := "MIGUI_NEXYS4D_IODELAY_MIG1"
DATA14_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
in app_wdf_wren std_logic
MASK0_MAP std_logic_vector( 107 downto 0) := X"000000000000000000000029002"
ADDR_MAP std_logic_vector( 191 downto 0) := X"00000000001003301A01903203A034018036012011017015"
CMD_PIPE_PLUS1 string := "ON"
PARITY_MAP std_logic_vector( 11 downto 0) := X"000"
BYTE_LANES_B3 std_logic_vector( 3 downto 0) := "0000"
out ddr2_ck_p std_logic_vector( CK_WIDTH- 1 downto 0)
out ui_clk_sync_rst std_logic
DATA5_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
SYSCLK_TYPE string := "NO_BUFFER"
DQS_CNT_WIDTH integer := 1
SLOT_1_CONFIG std_logic_vector( 7 downto 0) := "00000000"
in app_wdf_data std_logic_vector(( nCK_PER_CLK* 2* PAYLOAD_WIDTH)- 1 downto 0)
DATA13_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
tPRDI integer := 1000000
USE_CS_PORT integer := 1
DATA9_MAP std_logic_vector( 95 downto 0) := X"000000000000000000000000"
BURST_MODE string := "8"
out app_rdy std_logic