1 |
2 |
ZTEX |
//*****************************************************************************
|
2 |
|
|
// (c) Copyright 2008 - 2014 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 : %version
|
53 |
|
|
// \ \ Application : MIG
|
54 |
|
|
// / / Filename : mem_intfc.v
|
55 |
|
|
// /___/ /\ Date Last Modified : $date$
|
56 |
|
|
// \ \ / \ Date Created : Aug 03 2009
|
57 |
|
|
// \___\/\___\
|
58 |
|
|
//
|
59 |
|
|
//Device : 7-Series
|
60 |
|
|
//Design Name : DDR3 SDRAM
|
61 |
|
|
//Purpose : Top level memory interface block. Instantiates a clock
|
62 |
|
|
// and reset generator, the memory controller, the phy and
|
63 |
|
|
// the user interface blocks.
|
64 |
|
|
//Reference :
|
65 |
|
|
//Revision History :
|
66 |
|
|
//*****************************************************************************
|
67 |
|
|
|
68 |
|
|
`timescale 1 ps / 1 ps
|
69 |
|
|
|
70 |
|
|
module mig_7series_v2_3_mem_intfc #
|
71 |
|
|
(
|
72 |
|
|
parameter TCQ = 100,
|
73 |
|
|
parameter DDR3_VDD_OP_VOLT = "135", // Voltage mode used for DDR3
|
74 |
|
|
parameter PAYLOAD_WIDTH = 64,
|
75 |
|
|
parameter ADDR_CMD_MODE = "1T",
|
76 |
|
|
parameter AL = "0", // Additive Latency option
|
77 |
|
|
parameter BANK_WIDTH = 3, // # of bank bits
|
78 |
|
|
parameter BM_CNT_WIDTH = 2, // Bank machine counter width
|
79 |
|
|
parameter BURST_MODE = "8", // Burst length
|
80 |
|
|
parameter BURST_TYPE = "SEQ", // Burst type
|
81 |
|
|
parameter CA_MIRROR = "OFF", // C/A mirror opt for DDR3 dual rank
|
82 |
|
|
parameter CK_WIDTH = 1, // # of CK/CK# outputs to memory
|
83 |
|
|
// five fields, one per possible I/O bank, 4 bits in each field, 1 per lane
|
84 |
|
|
// data=1/ctl=0
|
85 |
|
|
parameter DATA_CTL_B0 = 4'hc,
|
86 |
|
|
parameter DATA_CTL_B1 = 4'hf,
|
87 |
|
|
parameter DATA_CTL_B2 = 4'hf,
|
88 |
|
|
parameter DATA_CTL_B3 = 4'hf,
|
89 |
|
|
parameter DATA_CTL_B4 = 4'hf,
|
90 |
|
|
// defines the byte lanes in I/O banks being used in the interface
|
91 |
|
|
// 1- Used, 0- Unused
|
92 |
|
|
parameter BYTE_LANES_B0 = 4'b1111,
|
93 |
|
|
parameter BYTE_LANES_B1 = 4'b0000,
|
94 |
|
|
parameter BYTE_LANES_B2 = 4'b0000,
|
95 |
|
|
parameter BYTE_LANES_B3 = 4'b0000,
|
96 |
|
|
parameter BYTE_LANES_B4 = 4'b0000,
|
97 |
|
|
// defines the bit lanes in I/O banks being used in the interface. Each
|
98 |
|
|
// parameter = 1 I/O bank = 4 byte lanes = 48 bit lanes. 1-Used, 0-Unused
|
99 |
|
|
parameter PHY_0_BITLANES = 48'h0000_0000_0000,
|
100 |
|
|
parameter PHY_1_BITLANES = 48'h0000_0000_0000,
|
101 |
|
|
parameter PHY_2_BITLANES = 48'h0000_0000_0000,
|
102 |
|
|
|
103 |
|
|
// control/address/data pin mapping parameters
|
104 |
|
|
parameter CK_BYTE_MAP
|
105 |
|
|
= 144'h00_00_00_00_00_00_00_00_00_00_00_00_00_00_00_00_00_00,
|
106 |
|
|
parameter ADDR_MAP
|
107 |
|
|
= 192'h000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000,
|
108 |
|
|
parameter BANK_MAP = 36'h000_000_000,
|
109 |
|
|
parameter CAS_MAP = 12'h000,
|
110 |
|
|
parameter CKE_ODT_BYTE_MAP = 8'h00,
|
111 |
|
|
parameter CKE_MAP = 96'h000_000_000_000_000_000_000_000,
|
112 |
|
|
parameter ODT_MAP = 96'h000_000_000_000_000_000_000_000,
|
113 |
|
|
parameter CKE_ODT_AUX = "FALSE",
|
114 |
|
|
parameter CS_MAP = 120'h000_000_000_000_000_000_000_000_000_000,
|
115 |
|
|
parameter PARITY_MAP = 12'h000,
|
116 |
|
|
parameter RAS_MAP = 12'h000,
|
117 |
|
|
parameter WE_MAP = 12'h000,
|
118 |
|
|
parameter DQS_BYTE_MAP
|
119 |
|
|
= 144'h00_00_00_00_00_00_00_00_00_00_00_00_00_00_00_00_00_00,
|
120 |
|
|
parameter DATA0_MAP = 96'h000_000_000_000_000_000_000_000,
|
121 |
|
|
parameter DATA1_MAP = 96'h000_000_000_000_000_000_000_000,
|
122 |
|
|
parameter DATA2_MAP = 96'h000_000_000_000_000_000_000_000,
|
123 |
|
|
parameter DATA3_MAP = 96'h000_000_000_000_000_000_000_000,
|
124 |
|
|
parameter DATA4_MAP = 96'h000_000_000_000_000_000_000_000,
|
125 |
|
|
parameter DATA5_MAP = 96'h000_000_000_000_000_000_000_000,
|
126 |
|
|
parameter DATA6_MAP = 96'h000_000_000_000_000_000_000_000,
|
127 |
|
|
parameter DATA7_MAP = 96'h000_000_000_000_000_000_000_000,
|
128 |
|
|
parameter DATA8_MAP = 96'h000_000_000_000_000_000_000_000,
|
129 |
|
|
parameter DATA9_MAP = 96'h000_000_000_000_000_000_000_000,
|
130 |
|
|
parameter DATA10_MAP = 96'h000_000_000_000_000_000_000_000,
|
131 |
|
|
parameter DATA11_MAP = 96'h000_000_000_000_000_000_000_000,
|
132 |
|
|
parameter DATA12_MAP = 96'h000_000_000_000_000_000_000_000,
|
133 |
|
|
parameter DATA13_MAP = 96'h000_000_000_000_000_000_000_000,
|
134 |
|
|
parameter DATA14_MAP = 96'h000_000_000_000_000_000_000_000,
|
135 |
|
|
parameter DATA15_MAP = 96'h000_000_000_000_000_000_000_000,
|
136 |
|
|
parameter DATA16_MAP = 96'h000_000_000_000_000_000_000_000,
|
137 |
|
|
parameter DATA17_MAP = 96'h000_000_000_000_000_000_000_000,
|
138 |
|
|
parameter MASK0_MAP = 108'h000_000_000_000_000_000_000_000_000,
|
139 |
|
|
parameter MASK1_MAP = 108'h000_000_000_000_000_000_000_000_000,
|
140 |
|
|
|
141 |
|
|
// calibration Address. The address given below will be used for calibration
|
142 |
|
|
// read and write operations.
|
143 |
|
|
parameter CALIB_ROW_ADD = 16'h0000,// Calibration row address
|
144 |
|
|
parameter CALIB_COL_ADD = 12'h000, // Calibration column address
|
145 |
|
|
parameter CALIB_BA_ADD = 3'h0, // Calibration bank address
|
146 |
|
|
parameter CL = 5,
|
147 |
|
|
parameter COL_WIDTH = 12, // column address width
|
148 |
|
|
parameter CMD_PIPE_PLUS1 = "ON", // add pipeline stage between MC and PHY
|
149 |
|
|
parameter CS_WIDTH = 1, // # of unique CS outputs
|
150 |
|
|
parameter CKE_WIDTH = 1, // # of cke outputs
|
151 |
|
|
parameter CWL = 5,
|
152 |
|
|
parameter DATA_WIDTH = 64,
|
153 |
|
|
parameter DATA_BUF_ADDR_WIDTH = 8,
|
154 |
|
|
parameter DATA_BUF_OFFSET_WIDTH = 1,
|
155 |
|
|
parameter DDR2_DQSN_ENABLE = "YES", // Enable differential DQS for DDR2
|
156 |
|
|
parameter DM_WIDTH = 8, // # of DM (data mask)
|
157 |
|
|
parameter DQ_CNT_WIDTH = 6, // = ceil(log2(DQ_WIDTH))
|
158 |
|
|
parameter DQ_WIDTH = 64, // # of DQ (data)
|
159 |
|
|
parameter DQS_CNT_WIDTH = 3, // = ceil(log2(DQS_WIDTH))
|
160 |
|
|
parameter DQS_WIDTH = 8, // # of DQS (strobe)
|
161 |
|
|
parameter DRAM_TYPE = "DDR3",
|
162 |
|
|
parameter DRAM_WIDTH = 8, // # of DQ per DQS
|
163 |
|
|
parameter ECC = "OFF",
|
164 |
|
|
parameter ECC_WIDTH = 8,
|
165 |
|
|
parameter MC_ERR_ADDR_WIDTH = 31,
|
166 |
|
|
parameter nAL = 0, // Additive latency (in clk cyc)
|
167 |
|
|
parameter nBANK_MACHS = 4,
|
168 |
|
|
parameter PRE_REV3ES = "OFF", // Delay O/Ps using Phaser_Out fine dly
|
169 |
|
|
parameter nCK_PER_CLK = 4, // # of memory CKs per fabric CLK
|
170 |
|
|
parameter nCS_PER_RANK = 1, // # of unique CS outputs per rank
|
171 |
|
|
// Hard PHY parameters
|
172 |
|
|
parameter PHYCTL_CMD_FIFO = "FALSE",
|
173 |
|
|
parameter ORDERING = "NORM",
|
174 |
|
|
parameter PHASE_DETECT = "OFF" , // to phy_top
|
175 |
|
|
parameter IBUF_LPWR_MODE = "OFF", // to phy_top
|
176 |
|
|
parameter BANK_TYPE = "HP_IO", // # = "HP_IO", "HPL_IO", "HR_IO", "HRL_IO"
|
177 |
|
|
parameter DATA_IO_PRIM_TYPE = "DEFAULT", // # = "HP_LP", "HR_LP", "DEFAULT"
|
178 |
|
|
parameter DATA_IO_IDLE_PWRDWN = "ON", // "ON" or "OFF"
|
179 |
|
|
parameter IODELAY_GRP = "IODELAY_MIG", //to phy_top
|
180 |
|
|
parameter FPGA_SPEED_GRADE = 1,
|
181 |
|
|
parameter OUTPUT_DRV = "HIGH" , // to phy_top
|
182 |
|
|
parameter REG_CTRL = "OFF" , // to phy_top
|
183 |
|
|
parameter RTT_NOM = "60" , // to phy_top
|
184 |
|
|
parameter RTT_WR = "120" , // to phy_top
|
185 |
|
|
parameter STARVE_LIMIT = 2,
|
186 |
|
|
parameter tCK = 2500, // pS
|
187 |
|
|
parameter tCKE = 10000, // pS
|
188 |
|
|
parameter tFAW = 40000, // pS
|
189 |
|
|
parameter tPRDI = 1_000_000, // pS
|
190 |
|
|
parameter tRAS = 37500, // pS
|
191 |
|
|
parameter tRCD = 12500, // pS
|
192 |
|
|
parameter tREFI = 7800000, // pS
|
193 |
|
|
parameter tRFC = 110000, // pS
|
194 |
|
|
parameter tRP = 12500, // pS
|
195 |
|
|
parameter tRRD = 10000, // pS
|
196 |
|
|
parameter tRTP = 7500, // pS
|
197 |
|
|
parameter tWTR = 7500, // pS
|
198 |
|
|
parameter tZQI = 128_000_000, // nS
|
199 |
|
|
parameter tZQCS = 64, // CKs
|
200 |
|
|
parameter WRLVL = "OFF" , // to phy_top
|
201 |
|
|
parameter DEBUG_PORT = "OFF" , // to phy_top
|
202 |
|
|
parameter CAL_WIDTH = "HALF" , // to phy_top
|
203 |
|
|
parameter RANK_WIDTH = 1,
|
204 |
|
|
parameter RANKS = 4,
|
205 |
|
|
parameter ODT_WIDTH = 1,
|
206 |
|
|
parameter ROW_WIDTH = 16, // DRAM address bus width
|
207 |
|
|
parameter [7:0] SLOT_0_CONFIG = 8'b0000_0001,
|
208 |
|
|
parameter [7:0] SLOT_1_CONFIG = 8'b0000_0000,
|
209 |
|
|
parameter SIM_BYPASS_INIT_CAL = "OFF",
|
210 |
|
|
parameter REFCLK_FREQ = 300.0,
|
211 |
|
|
parameter nDQS_COL0 = DQS_WIDTH,
|
212 |
|
|
parameter nDQS_COL1 = 0,
|
213 |
|
|
parameter nDQS_COL2 = 0,
|
214 |
|
|
parameter nDQS_COL3 = 0,
|
215 |
|
|
parameter DQS_LOC_COL0 = 144'h11100F0E0D0C0B0A09080706050403020100,
|
216 |
|
|
parameter DQS_LOC_COL1 = 0,
|
217 |
|
|
parameter DQS_LOC_COL2 = 0,
|
218 |
|
|
parameter DQS_LOC_COL3 = 0,
|
219 |
|
|
parameter USE_CS_PORT = 1, // Support chip select output
|
220 |
|
|
parameter USE_DM_PORT = 1, // Support data mask output
|
221 |
|
|
parameter USE_ODT_PORT = 1, // Support ODT output
|
222 |
|
|
parameter MASTER_PHY_CTL = 0, // The bank number where master PHY_CONTROL resides
|
223 |
|
|
parameter USER_REFRESH = "OFF", // Choose whether MC or User manages REF
|
224 |
|
|
parameter TEMP_MON_EN = "ON", // Enable/disable temperature monitoring
|
225 |
|
|
parameter IDELAY_ADJ = "ON", // Adjust IDELAY value (-1)
|
226 |
|
|
parameter FINE_PER_BIT = "ON", // Use finedelay per-bit de-skew
|
227 |
|
|
parameter CENTER_COMP_MODE = "ON", // Use Center compensation table for PI
|
228 |
|
|
parameter PI_VAL_ADJ = "ON", // Adjust PI final value (-1)
|
229 |
|
|
parameter TAPSPERKCLK = 56
|
230 |
|
|
)
|
231 |
|
|
(
|
232 |
|
|
input clk_ref,
|
233 |
|
|
input freq_refclk,
|
234 |
|
|
input mem_refclk,
|
235 |
|
|
input pll_lock,
|
236 |
|
|
input sync_pulse,
|
237 |
|
|
input mmcm_ps_clk,
|
238 |
|
|
input poc_sample_pd,
|
239 |
|
|
|
240 |
|
|
input error,
|
241 |
|
|
input reset,
|
242 |
|
|
output rst_tg_mc,
|
243 |
|
|
|
244 |
|
|
input [BANK_WIDTH-1:0] bank, // To mc0 of mc.v
|
245 |
|
|
input clk ,
|
246 |
|
|
input [2:0] cmd, // To mc0 of mc.v
|
247 |
|
|
input [COL_WIDTH-1:0] col, // To mc0 of mc.v
|
248 |
|
|
input correct_en,
|
249 |
|
|
input [DATA_BUF_ADDR_WIDTH-1:0] data_buf_addr, // To mc0 of mc.v
|
250 |
|
|
|
251 |
|
|
input dbg_idel_down_all,
|
252 |
|
|
input dbg_idel_down_cpt,
|
253 |
|
|
input dbg_idel_up_all,
|
254 |
|
|
input dbg_idel_up_cpt,
|
255 |
|
|
input dbg_sel_all_idel_cpt,
|
256 |
|
|
input [DQS_CNT_WIDTH-1:0] dbg_sel_idel_cpt,
|
257 |
|
|
input hi_priority, // To mc0 of mc.v
|
258 |
|
|
input [RANK_WIDTH-1:0] rank, // To mc0 of mc.v
|
259 |
|
|
input [2*nCK_PER_CLK-1:0] raw_not_ecc,
|
260 |
|
|
input [ROW_WIDTH-1:0] row, // To mc0 of mc.v
|
261 |
|
|
input rst, // To mc0 of mc.v, ...
|
262 |
|
|
input size, // To mc0 of mc.v
|
263 |
|
|
input [7:0] slot_0_present, // To mc0 of mc.v
|
264 |
|
|
input [7:0] slot_1_present, // To mc0 of mc.v
|
265 |
|
|
input use_addr, // To mc0 of mc.v
|
266 |
|
|
input [2*nCK_PER_CLK*PAYLOAD_WIDTH-1:0] wr_data,
|
267 |
|
|
input [2*nCK_PER_CLK*DATA_WIDTH/8-1:0] wr_data_mask,
|
268 |
|
|
|
269 |
|
|
output accept, // From mc0 of mc.v
|
270 |
|
|
output accept_ns, // From mc0 of mc.v
|
271 |
|
|
output [BM_CNT_WIDTH-1:0] bank_mach_next, // From mc0 of mc.v
|
272 |
|
|
|
273 |
|
|
input app_sr_req,
|
274 |
|
|
output app_sr_active,
|
275 |
|
|
input app_ref_req,
|
276 |
|
|
output app_ref_ack,
|
277 |
|
|
input app_zq_req,
|
278 |
|
|
output app_zq_ack,
|
279 |
|
|
|
280 |
|
|
output [255:0] dbg_calib_top,
|
281 |
|
|
output [6*DQS_WIDTH*RANKS-1:0] dbg_cpt_first_edge_cnt,
|
282 |
|
|
output [6*DQS_WIDTH*RANKS-1:0] dbg_cpt_second_edge_cnt,
|
283 |
|
|
output [255:0] dbg_phy_rdlvl,
|
284 |
|
|
output [99:0] dbg_phy_wrcal,
|
285 |
|
|
output [6*DQS_WIDTH-1:0] dbg_final_po_fine_tap_cnt,
|
286 |
|
|
output [3*DQS_WIDTH-1:0] dbg_final_po_coarse_tap_cnt,
|
287 |
|
|
output [DQS_WIDTH-1:0] dbg_rd_data_edge_detect,
|
288 |
|
|
output [2*nCK_PER_CLK*DQ_WIDTH-1:0] dbg_rddata,
|
289 |
|
|
output [1:0] dbg_rdlvl_done,
|
290 |
|
|
output [1:0] dbg_rdlvl_err,
|
291 |
|
|
output [1:0] dbg_rdlvl_start,
|
292 |
|
|
output [5:0] dbg_tap_cnt_during_wrlvl,
|
293 |
|
|
output dbg_wl_edge_detect_valid,
|
294 |
|
|
output dbg_wrlvl_done,
|
295 |
|
|
output dbg_wrlvl_err,
|
296 |
|
|
output dbg_wrlvl_start,
|
297 |
|
|
|
298 |
|
|
output [ROW_WIDTH-1:0] ddr_addr, // From phy_top0 of phy_top.v
|
299 |
|
|
output [BANK_WIDTH-1:0] ddr_ba, // From phy_top0 of phy_top.v
|
300 |
|
|
output ddr_cas_n, // From phy_top0 of phy_top.v
|
301 |
|
|
output [CK_WIDTH-1:0] ddr_ck_n, // From phy_top0 of phy_top.v
|
302 |
|
|
output [CK_WIDTH-1:0] ddr_ck , // From phy_top0 of phy_top.v
|
303 |
|
|
output [CKE_WIDTH-1:0] ddr_cke, // From phy_top0 of phy_top.v
|
304 |
|
|
output [CS_WIDTH*nCS_PER_RANK-1:0] ddr_cs_n, // From phy_top0 of phy_top.v
|
305 |
|
|
output [DM_WIDTH-1:0] ddr_dm, // From phy_top0 of phy_top.v
|
306 |
|
|
output [ODT_WIDTH-1:0] ddr_odt, // From phy_top0 of phy_top.v
|
307 |
|
|
output ddr_ras_n, // From phy_top0 of phy_top.v
|
308 |
|
|
output ddr_reset_n, // From phy_top0 of phy_top.v
|
309 |
|
|
output ddr_parity,
|
310 |
|
|
output ddr_we_n, // From phy_top0 of phy_top.v
|
311 |
|
|
output init_calib_complete,
|
312 |
|
|
output init_wrcal_complete,
|
313 |
|
|
output [MC_ERR_ADDR_WIDTH-1:0] ecc_err_addr,
|
314 |
|
|
output [2*nCK_PER_CLK-1:0] ecc_multiple,
|
315 |
|
|
output [2*nCK_PER_CLK-1:0] ecc_single,
|
316 |
|
|
|
317 |
|
|
output wire [2*nCK_PER_CLK*PAYLOAD_WIDTH-1:0] rd_data,
|
318 |
|
|
output [DATA_BUF_ADDR_WIDTH-1:0] rd_data_addr,
|
319 |
|
|
// From mc0 of mc.v
|
320 |
|
|
output rd_data_en, // From mc0 of mc.v
|
321 |
|
|
output rd_data_end, // From mc0 of mc.v
|
322 |
|
|
output [DATA_BUF_OFFSET_WIDTH-1:0] rd_data_offset, // From mc0 of mc.v
|
323 |
|
|
output [DATA_BUF_ADDR_WIDTH-1:0] wr_data_addr, // From mc0 of mc.v
|
324 |
|
|
output wr_data_en, // From mc0 of mc.v
|
325 |
|
|
output [DATA_BUF_OFFSET_WIDTH-1:0] wr_data_offset, // From mc0 of mc.v
|
326 |
|
|
|
327 |
|
|
inout [DQ_WIDTH-1:0] ddr_dq, // To/From phy_top0 of phy_top.v
|
328 |
|
|
inout [DQS_WIDTH-1:0] ddr_dqs_n, // To/From phy_top0 of phy_top.v
|
329 |
|
|
inout [DQS_WIDTH-1:0] ddr_dqs // To/From phy_top0 of phy_top.v
|
330 |
|
|
|
331 |
|
|
,input [11:0] device_temp
|
332 |
|
|
|
333 |
|
|
//phase shift clock control
|
334 |
|
|
,output psen
|
335 |
|
|
,output psincdec
|
336 |
|
|
,input psdone
|
337 |
|
|
,input [DQ_WIDTH/8-1:0] fi_xor_we
|
338 |
|
|
,input [DQ_WIDTH-1:0] fi_xor_wrdata
|
339 |
|
|
|
340 |
|
|
,input dbg_sel_pi_incdec
|
341 |
|
|
,input dbg_sel_po_incdec
|
342 |
|
|
,input [DQS_CNT_WIDTH:0] dbg_byte_sel
|
343 |
|
|
,input dbg_pi_f_inc
|
344 |
|
|
,input dbg_pi_f_dec
|
345 |
|
|
,input dbg_po_f_inc
|
346 |
|
|
,input dbg_po_f_stg23_sel
|
347 |
|
|
,input dbg_po_f_dec
|
348 |
|
|
,output [6*DQS_WIDTH*RANKS-1:0] dbg_cpt_tap_cnt
|
349 |
|
|
,output [5*DQS_WIDTH*RANKS-1:0] dbg_dq_idelay_tap_cnt
|
350 |
|
|
,output dbg_rddata_valid
|
351 |
|
|
,output [6*DQS_WIDTH-1:0] dbg_wrlvl_fine_tap_cnt
|
352 |
|
|
,output [3*DQS_WIDTH-1:0] dbg_wrlvl_coarse_tap_cnt
|
353 |
|
|
,output [255:0] dbg_phy_wrlvl
|
354 |
|
|
,output [5:0] dbg_pi_counter_read_val
|
355 |
|
|
,output [8:0] dbg_po_counter_read_val
|
356 |
|
|
,output ref_dll_lock
|
357 |
|
|
,input rst_phaser_ref
|
358 |
|
|
,input iddr_rst
|
359 |
|
|
,output [6*RANKS-1:0] dbg_rd_data_offset
|
360 |
|
|
,output [255:0] dbg_phy_init
|
361 |
|
|
,output [255:0] dbg_prbs_rdlvl
|
362 |
|
|
,output [255:0] dbg_dqs_found_cal
|
363 |
|
|
,output dbg_pi_phaselock_start
|
364 |
|
|
,output dbg_pi_phaselocked_done
|
365 |
|
|
,output dbg_pi_phaselock_err
|
366 |
|
|
,output dbg_pi_dqsfound_start
|
367 |
|
|
,output dbg_pi_dqsfound_done
|
368 |
|
|
,output dbg_pi_dqsfound_err
|
369 |
|
|
,output dbg_wrcal_start
|
370 |
|
|
,output dbg_wrcal_done
|
371 |
|
|
,output dbg_wrcal_err
|
372 |
|
|
,output [11:0] dbg_pi_dqs_found_lanes_phy4lanes
|
373 |
|
|
,output [11:0] dbg_pi_phase_locked_phy4lanes
|
374 |
|
|
,output [6*RANKS-1:0] dbg_calib_rd_data_offset_1
|
375 |
|
|
,output [6*RANKS-1:0] dbg_calib_rd_data_offset_2
|
376 |
|
|
,output [5:0] dbg_data_offset
|
377 |
|
|
,output [5:0] dbg_data_offset_1
|
378 |
|
|
,output [5:0] dbg_data_offset_2
|
379 |
|
|
,output dbg_oclkdelay_calib_start
|
380 |
|
|
,output dbg_oclkdelay_calib_done
|
381 |
|
|
,output [255:0] dbg_phy_oclkdelay_cal
|
382 |
|
|
,output [DRAM_WIDTH*16 -1:0]dbg_oclkdelay_rd_data
|
383 |
|
|
,output [6*DQS_WIDTH*RANKS-1:0] prbs_final_dqs_tap_cnt_r
|
384 |
|
|
,output [6*DQS_WIDTH*RANKS-1:0] dbg_prbs_first_edge_taps
|
385 |
|
|
,output [6*DQS_WIDTH*RANKS-1:0] dbg_prbs_second_edge_taps
|
386 |
|
|
|
387 |
|
|
);
|
388 |
|
|
|
389 |
|
|
localparam nSLOTS = 1 + (|SLOT_1_CONFIG ? 1 : 0);
|
390 |
|
|
localparam SLOT_0_CONFIG_MC = (nSLOTS == 2)? 8'b0000_0101 : 8'b0000_1111;
|
391 |
|
|
localparam SLOT_1_CONFIG_MC = (nSLOTS == 2)? 8'b0000_1010 : 8'b0000_0000;
|
392 |
|
|
|
393 |
|
|
// 8*tREFI in ps is divided by fabric clock period also in ps. 270 is the number
|
394 |
|
|
// of fabric clock cycles that accounts for the Writes, read, and PRECHARGE time
|
395 |
|
|
localparam REFRESH_TIMER = (8*tREFI/(tCK*nCK_PER_CLK)) - 270;
|
396 |
|
|
|
397 |
|
|
reg [7:0] slot_0_present_mc;
|
398 |
|
|
reg [7:0] slot_1_present_mc;
|
399 |
|
|
|
400 |
|
|
reg user_periodic_rd_req = 1'b0;
|
401 |
|
|
reg user_ref_req = 1'b0;
|
402 |
|
|
reg user_zq_req = 1'b0;
|
403 |
|
|
|
404 |
|
|
// MC/PHY interface
|
405 |
|
|
wire [nCK_PER_CLK-1:0] mc_ras_n;
|
406 |
|
|
wire [nCK_PER_CLK-1:0] mc_cas_n;
|
407 |
|
|
wire [nCK_PER_CLK-1:0] mc_we_n;
|
408 |
|
|
wire [nCK_PER_CLK*ROW_WIDTH-1:0] mc_address;
|
409 |
|
|
wire [nCK_PER_CLK*BANK_WIDTH-1:0] mc_bank;
|
410 |
|
|
wire [nCK_PER_CLK-1 :0] mc_cke ;
|
411 |
|
|
wire [1:0] mc_odt ;
|
412 |
|
|
wire [CS_WIDTH*nCS_PER_RANK*nCK_PER_CLK-1:0] mc_cs_n;
|
413 |
|
|
wire mc_reset_n;
|
414 |
|
|
wire [2*nCK_PER_CLK*DQ_WIDTH-1:0] mc_wrdata;
|
415 |
|
|
wire [2*nCK_PER_CLK*DQ_WIDTH/8-1:0] mc_wrdata_mask;
|
416 |
|
|
wire mc_wrdata_en;
|
417 |
|
|
wire mc_ref_zq_wip;
|
418 |
|
|
wire tempmon_sample_en;
|
419 |
|
|
wire idle;
|
420 |
|
|
|
421 |
|
|
wire mc_cmd_wren;
|
422 |
|
|
wire mc_ctl_wren;
|
423 |
|
|
wire [2:0] mc_cmd;
|
424 |
|
|
wire [1:0] mc_cas_slot;
|
425 |
|
|
wire [5:0] mc_data_offset;
|
426 |
|
|
wire [5:0] mc_data_offset_1;
|
427 |
|
|
wire [5:0] mc_data_offset_2;
|
428 |
|
|
wire [3:0] mc_aux_out0;
|
429 |
|
|
wire [3:0] mc_aux_out1;
|
430 |
|
|
wire [1:0] mc_rank_cnt;
|
431 |
|
|
|
432 |
|
|
wire phy_mc_ctl_full;
|
433 |
|
|
wire phy_mc_cmd_full;
|
434 |
|
|
wire phy_mc_data_full;
|
435 |
|
|
wire [2*nCK_PER_CLK*DQ_WIDTH-1:0] phy_rd_data;
|
436 |
|
|
wire phy_rddata_valid;
|
437 |
|
|
|
438 |
|
|
wire [6*RANKS-1:0] calib_rd_data_offset_0;
|
439 |
|
|
wire [6*RANKS-1:0] calib_rd_data_offset_1;
|
440 |
|
|
wire [6*RANKS-1:0] calib_rd_data_offset_2;
|
441 |
|
|
wire init_calib_complete_w;
|
442 |
|
|
wire init_wrcal_complete_w;
|
443 |
|
|
wire mux_rst;
|
444 |
|
|
wire mux_calib_complete;
|
445 |
|
|
// assigning CWL = CL -1 for DDR2. DDR2 customers will not know anything
|
446 |
|
|
// about CWL. There is also nCWL parameter. Need to clean it up.
|
447 |
|
|
localparam CWL_T = (DRAM_TYPE == "DDR3") ? CWL : CL-1;
|
448 |
|
|
|
449 |
|
|
assign init_calib_complete = init_calib_complete_w;
|
450 |
|
|
assign init_wrcal_complete = init_wrcal_complete_w;
|
451 |
|
|
assign mux_calib_complete = (PRE_REV3ES == "OFF") ? init_calib_complete_w :
|
452 |
|
|
(init_calib_complete_w | init_wrcal_complete_w);
|
453 |
|
|
assign mux_rst = (PRE_REV3ES == "OFF") ? rst : reset;
|
454 |
|
|
assign dbg_calib_rd_data_offset_1 = calib_rd_data_offset_1;
|
455 |
|
|
assign dbg_calib_rd_data_offset_2 = calib_rd_data_offset_2;
|
456 |
|
|
assign dbg_data_offset = mc_data_offset;
|
457 |
|
|
assign dbg_data_offset_1 = mc_data_offset_1;
|
458 |
|
|
assign dbg_data_offset_2 = mc_data_offset_2;
|
459 |
|
|
|
460 |
|
|
// Enable / disable temperature monitoring
|
461 |
|
|
assign tempmon_sample_en = TEMP_MON_EN == "OFF" ? 1'b0 : mc_ref_zq_wip;
|
462 |
|
|
|
463 |
|
|
generate
|
464 |
|
|
if (nSLOTS == 1) begin: gen_single_slot_odt
|
465 |
|
|
always @ (slot_0_present or slot_1_present) begin
|
466 |
|
|
slot_0_present_mc = slot_0_present;
|
467 |
|
|
slot_1_present_mc = slot_1_present;
|
468 |
|
|
end
|
469 |
|
|
end else if (nSLOTS == 2) begin: gen_dual_slot_odt
|
470 |
|
|
always @ (slot_0_present[0] or slot_0_present[1]
|
471 |
|
|
or slot_1_present[0] or slot_1_present[1]) begin
|
472 |
|
|
case ({slot_0_present[0],slot_0_present[1],
|
473 |
|
|
slot_1_present[0],slot_1_present[1]})
|
474 |
|
|
//Two slot configuration, one slot present, single rank
|
475 |
|
|
4'b1000: begin
|
476 |
|
|
slot_0_present_mc = 8'b0000_0001;
|
477 |
|
|
slot_1_present_mc = 8'b0000_0000;
|
478 |
|
|
end
|
479 |
|
|
4'b0010: begin
|
480 |
|
|
slot_0_present_mc = 8'b0000_0000;
|
481 |
|
|
slot_1_present_mc = 8'b0000_0010;
|
482 |
|
|
end
|
483 |
|
|
// Two slot configuration, one slot present, dual rank
|
484 |
|
|
4'b1100: begin
|
485 |
|
|
slot_0_present_mc = 8'b0000_0101;
|
486 |
|
|
slot_1_present_mc = 8'b0000_0000;
|
487 |
|
|
end
|
488 |
|
|
4'b0011: begin
|
489 |
|
|
slot_0_present_mc = 8'b0000_0000;
|
490 |
|
|
slot_1_present_mc = 8'b0000_1010;
|
491 |
|
|
end
|
492 |
|
|
// Two slot configuration, one rank per slot
|
493 |
|
|
4'b1010: begin
|
494 |
|
|
slot_0_present_mc = 8'b0000_0001;
|
495 |
|
|
slot_1_present_mc = 8'b0000_0010;
|
496 |
|
|
end
|
497 |
|
|
// Two Slots - One slot with dual rank and the other with single rank
|
498 |
|
|
4'b1011: begin
|
499 |
|
|
slot_0_present_mc = 8'b0000_0001;
|
500 |
|
|
slot_1_present_mc = 8'b0000_1010;
|
501 |
|
|
end
|
502 |
|
|
4'b1110: begin
|
503 |
|
|
slot_0_present_mc = 8'b0000_0101;
|
504 |
|
|
slot_1_present_mc = 8'b0000_0010;
|
505 |
|
|
end
|
506 |
|
|
// Two Slots - two ranks per slot
|
507 |
|
|
4'b1111: begin
|
508 |
|
|
slot_0_present_mc = 8'b0000_0101;
|
509 |
|
|
slot_1_present_mc = 8'b0000_1010;
|
510 |
|
|
end
|
511 |
|
|
endcase
|
512 |
|
|
end
|
513 |
|
|
end
|
514 |
|
|
endgenerate
|
515 |
|
|
|
516 |
|
|
mig_7series_v2_3_mc #
|
517 |
|
|
(
|
518 |
|
|
.TCQ (TCQ),
|
519 |
|
|
.PAYLOAD_WIDTH (PAYLOAD_WIDTH),
|
520 |
|
|
.MC_ERR_ADDR_WIDTH (MC_ERR_ADDR_WIDTH),
|
521 |
|
|
.ADDR_CMD_MODE (ADDR_CMD_MODE),
|
522 |
|
|
.BANK_WIDTH (BANK_WIDTH),
|
523 |
|
|
.BM_CNT_WIDTH (BM_CNT_WIDTH),
|
524 |
|
|
.BURST_MODE (BURST_MODE),
|
525 |
|
|
.COL_WIDTH (COL_WIDTH),
|
526 |
|
|
.CMD_PIPE_PLUS1 (CMD_PIPE_PLUS1),
|
527 |
|
|
.CS_WIDTH (CS_WIDTH),
|
528 |
|
|
.DATA_WIDTH (DATA_WIDTH),
|
529 |
|
|
.DATA_BUF_ADDR_WIDTH (DATA_BUF_ADDR_WIDTH),
|
530 |
|
|
.DATA_BUF_OFFSET_WIDTH (DATA_BUF_OFFSET_WIDTH),
|
531 |
|
|
.DRAM_TYPE (DRAM_TYPE),
|
532 |
|
|
.CKE_ODT_AUX (CKE_ODT_AUX),
|
533 |
|
|
.DQS_WIDTH (DQS_WIDTH),
|
534 |
|
|
.DQ_WIDTH (DQ_WIDTH),
|
535 |
|
|
.ECC (ECC),
|
536 |
|
|
.ECC_WIDTH (ECC_WIDTH),
|
537 |
|
|
.nBANK_MACHS (nBANK_MACHS),
|
538 |
|
|
.nCK_PER_CLK (nCK_PER_CLK),
|
539 |
|
|
.nSLOTS (nSLOTS),
|
540 |
|
|
.CL (CL),
|
541 |
|
|
.nCS_PER_RANK (nCS_PER_RANK),
|
542 |
|
|
.CWL (CWL_T),
|
543 |
|
|
.ORDERING (ORDERING),
|
544 |
|
|
.RANK_WIDTH (RANK_WIDTH),
|
545 |
|
|
.RANKS (RANKS),
|
546 |
|
|
.REG_CTRL (REG_CTRL),
|
547 |
|
|
.ROW_WIDTH (ROW_WIDTH),
|
548 |
|
|
.RTT_NOM (RTT_NOM),
|
549 |
|
|
.RTT_WR (RTT_WR),
|
550 |
|
|
.STARVE_LIMIT (STARVE_LIMIT),
|
551 |
|
|
.SLOT_0_CONFIG (SLOT_0_CONFIG_MC),
|
552 |
|
|
.SLOT_1_CONFIG (SLOT_1_CONFIG_MC),
|
553 |
|
|
.tCK (tCK),
|
554 |
|
|
.tCKE (tCKE),
|
555 |
|
|
.tFAW (tFAW),
|
556 |
|
|
.tRAS (tRAS),
|
557 |
|
|
.tRCD (tRCD),
|
558 |
|
|
.tREFI (tREFI),
|
559 |
|
|
.tRFC (tRFC),
|
560 |
|
|
.tRP (tRP),
|
561 |
|
|
.tRRD (tRRD),
|
562 |
|
|
.tRTP (tRTP),
|
563 |
|
|
.tWTR (tWTR),
|
564 |
|
|
.tZQI (tZQI),
|
565 |
|
|
.tZQCS (tZQCS),
|
566 |
|
|
.tPRDI (tPRDI),
|
567 |
|
|
.USER_REFRESH (USER_REFRESH))
|
568 |
|
|
mc0
|
569 |
|
|
(.app_periodic_rd_req (1'b0),
|
570 |
|
|
.app_sr_req (app_sr_req),
|
571 |
|
|
.app_sr_active (app_sr_active),
|
572 |
|
|
.app_ref_req (app_ref_req),
|
573 |
|
|
.app_ref_ack (app_ref_ack),
|
574 |
|
|
.app_zq_req (app_zq_req),
|
575 |
|
|
.app_zq_ack (app_zq_ack),
|
576 |
|
|
.ecc_single (ecc_single),
|
577 |
|
|
.ecc_multiple (ecc_multiple),
|
578 |
|
|
.ecc_err_addr (ecc_err_addr),
|
579 |
|
|
.mc_address (mc_address),
|
580 |
|
|
.mc_aux_out0 (mc_aux_out0),
|
581 |
|
|
.mc_aux_out1 (mc_aux_out1),
|
582 |
|
|
.mc_bank (mc_bank),
|
583 |
|
|
.mc_cke (mc_cke),
|
584 |
|
|
.mc_odt (mc_odt),
|
585 |
|
|
.mc_cas_n (mc_cas_n),
|
586 |
|
|
.mc_cmd (mc_cmd),
|
587 |
|
|
.mc_cmd_wren (mc_cmd_wren),
|
588 |
|
|
.mc_cs_n (mc_cs_n),
|
589 |
|
|
.mc_ctl_wren (mc_ctl_wren),
|
590 |
|
|
.mc_data_offset (mc_data_offset),
|
591 |
|
|
.mc_data_offset_1 (mc_data_offset_1),
|
592 |
|
|
.mc_data_offset_2 (mc_data_offset_2),
|
593 |
|
|
.mc_cas_slot (mc_cas_slot),
|
594 |
|
|
.mc_rank_cnt (mc_rank_cnt),
|
595 |
|
|
.mc_ras_n (mc_ras_n),
|
596 |
|
|
.mc_reset_n (mc_reset_n),
|
597 |
|
|
.mc_we_n (mc_we_n),
|
598 |
|
|
.mc_wrdata (mc_wrdata),
|
599 |
|
|
.mc_wrdata_en (mc_wrdata_en),
|
600 |
|
|
.mc_wrdata_mask (mc_wrdata_mask),
|
601 |
|
|
// Outputs
|
602 |
|
|
.accept (accept),
|
603 |
|
|
.accept_ns (accept_ns),
|
604 |
|
|
.bank_mach_next (bank_mach_next[BM_CNT_WIDTH-1:0]),
|
605 |
|
|
.rd_data_addr (rd_data_addr[DATA_BUF_ADDR_WIDTH-1:0]),
|
606 |
|
|
.rd_data_en (rd_data_en),
|
607 |
|
|
.rd_data_end (rd_data_end),
|
608 |
|
|
.rd_data_offset (rd_data_offset),
|
609 |
|
|
.wr_data_addr (wr_data_addr[DATA_BUF_ADDR_WIDTH-1:0]),
|
610 |
|
|
.wr_data_en (wr_data_en),
|
611 |
|
|
.wr_data_offset (wr_data_offset),
|
612 |
|
|
.rd_data (rd_data),
|
613 |
|
|
.wr_data (wr_data),
|
614 |
|
|
.wr_data_mask (wr_data_mask),
|
615 |
|
|
.mc_read_idle (idle),
|
616 |
|
|
.mc_ref_zq_wip (mc_ref_zq_wip),
|
617 |
|
|
// Inputs
|
618 |
|
|
.init_calib_complete (mux_calib_complete),
|
619 |
|
|
.calib_rd_data_offset (calib_rd_data_offset_0),
|
620 |
|
|
.calib_rd_data_offset_1 (calib_rd_data_offset_1),
|
621 |
|
|
.calib_rd_data_offset_2 (calib_rd_data_offset_2),
|
622 |
|
|
.phy_mc_ctl_full (phy_mc_ctl_full),
|
623 |
|
|
.phy_mc_cmd_full (phy_mc_cmd_full),
|
624 |
|
|
.phy_mc_data_full (phy_mc_data_full),
|
625 |
|
|
.phy_rd_data (phy_rd_data),
|
626 |
|
|
.phy_rddata_valid (phy_rddata_valid),
|
627 |
|
|
.correct_en (correct_en),
|
628 |
|
|
.bank (bank[BANK_WIDTH-1:0]),
|
629 |
|
|
.clk (clk),
|
630 |
|
|
.cmd (cmd[2:0]),
|
631 |
|
|
.col (col[COL_WIDTH-1:0]),
|
632 |
|
|
.data_buf_addr (data_buf_addr[DATA_BUF_ADDR_WIDTH-1:0]),
|
633 |
|
|
.hi_priority (hi_priority),
|
634 |
|
|
.rank (rank[RANK_WIDTH-1:0]),
|
635 |
|
|
.raw_not_ecc (raw_not_ecc[2*nCK_PER_CLK-1 :0]),
|
636 |
|
|
.row (row[ROW_WIDTH-1:0]),
|
637 |
|
|
.rst (mux_rst),
|
638 |
|
|
.size (size),
|
639 |
|
|
.slot_0_present (slot_0_present_mc[7:0]),
|
640 |
|
|
.slot_1_present (slot_1_present_mc[7:0]),
|
641 |
|
|
.fi_xor_we (fi_xor_we),
|
642 |
|
|
.fi_xor_wrdata (fi_xor_wrdata),
|
643 |
|
|
.use_addr (use_addr));
|
644 |
|
|
|
645 |
|
|
// following calculations should be moved inside PHY
|
646 |
|
|
// odt bus should be added to PHY.
|
647 |
|
|
localparam CLK_PERIOD = tCK * nCK_PER_CLK;
|
648 |
|
|
localparam nCL = CL;
|
649 |
|
|
localparam nCWL = CWL_T;
|
650 |
|
|
`ifdef MC_SVA
|
651 |
|
|
ddr2_improper_CL: assert property
|
652 |
|
|
(@(posedge clk) (~((DRAM_TYPE == "DDR2") && ((CL > 6) || (CL < 3)))));
|
653 |
|
|
// Not needed after the CWL fix for DDR2
|
654 |
|
|
// ddr2_improper_CWL: assert property
|
655 |
|
|
// (@(posedge clk) (~((DRAM_TYPE == "DDR2") && ((CL - CWL) != 1))));
|
656 |
|
|
`endif
|
657 |
|
|
|
658 |
|
|
mig_7series_v2_3_ddr_phy_top #
|
659 |
|
|
(
|
660 |
|
|
.TCQ (TCQ),
|
661 |
|
|
.DDR3_VDD_OP_VOLT (DDR3_VDD_OP_VOLT),
|
662 |
|
|
.REFCLK_FREQ (REFCLK_FREQ),
|
663 |
|
|
.BYTE_LANES_B0 (BYTE_LANES_B0),
|
664 |
|
|
.BYTE_LANES_B1 (BYTE_LANES_B1),
|
665 |
|
|
.BYTE_LANES_B2 (BYTE_LANES_B2),
|
666 |
|
|
.BYTE_LANES_B3 (BYTE_LANES_B3),
|
667 |
|
|
.BYTE_LANES_B4 (BYTE_LANES_B4),
|
668 |
|
|
.PHY_0_BITLANES (PHY_0_BITLANES),
|
669 |
|
|
.PHY_1_BITLANES (PHY_1_BITLANES),
|
670 |
|
|
.PHY_2_BITLANES (PHY_2_BITLANES),
|
671 |
|
|
.CA_MIRROR (CA_MIRROR),
|
672 |
|
|
.CK_BYTE_MAP (CK_BYTE_MAP),
|
673 |
|
|
.ADDR_MAP (ADDR_MAP),
|
674 |
|
|
.BANK_MAP (BANK_MAP),
|
675 |
|
|
.CAS_MAP (CAS_MAP),
|
676 |
|
|
.CKE_ODT_BYTE_MAP (CKE_ODT_BYTE_MAP),
|
677 |
|
|
.CKE_MAP (CKE_MAP),
|
678 |
|
|
.ODT_MAP (ODT_MAP),
|
679 |
|
|
.CKE_ODT_AUX (CKE_ODT_AUX),
|
680 |
|
|
.CS_MAP (CS_MAP),
|
681 |
|
|
.PARITY_MAP (PARITY_MAP),
|
682 |
|
|
.RAS_MAP (RAS_MAP),
|
683 |
|
|
.WE_MAP (WE_MAP),
|
684 |
|
|
.DQS_BYTE_MAP (DQS_BYTE_MAP),
|
685 |
|
|
.DATA0_MAP (DATA0_MAP),
|
686 |
|
|
.DATA1_MAP (DATA1_MAP),
|
687 |
|
|
.DATA2_MAP (DATA2_MAP),
|
688 |
|
|
.DATA3_MAP (DATA3_MAP),
|
689 |
|
|
.DATA4_MAP (DATA4_MAP),
|
690 |
|
|
.DATA5_MAP (DATA5_MAP),
|
691 |
|
|
.DATA6_MAP (DATA6_MAP),
|
692 |
|
|
.DATA7_MAP (DATA7_MAP),
|
693 |
|
|
.DATA8_MAP (DATA8_MAP),
|
694 |
|
|
.DATA9_MAP (DATA9_MAP),
|
695 |
|
|
.DATA10_MAP (DATA10_MAP),
|
696 |
|
|
.DATA11_MAP (DATA11_MAP),
|
697 |
|
|
.DATA12_MAP (DATA12_MAP),
|
698 |
|
|
.DATA13_MAP (DATA13_MAP),
|
699 |
|
|
.DATA14_MAP (DATA14_MAP),
|
700 |
|
|
.DATA15_MAP (DATA15_MAP),
|
701 |
|
|
.DATA16_MAP (DATA16_MAP),
|
702 |
|
|
.DATA17_MAP (DATA17_MAP),
|
703 |
|
|
.MASK0_MAP (MASK0_MAP),
|
704 |
|
|
.MASK1_MAP (MASK1_MAP),
|
705 |
|
|
.CALIB_ROW_ADD (CALIB_ROW_ADD),
|
706 |
|
|
.CALIB_COL_ADD (CALIB_COL_ADD),
|
707 |
|
|
.CALIB_BA_ADD (CALIB_BA_ADD),
|
708 |
|
|
.nCS_PER_RANK (nCS_PER_RANK),
|
709 |
|
|
.CS_WIDTH (CS_WIDTH),
|
710 |
|
|
.nCK_PER_CLK (nCK_PER_CLK),
|
711 |
|
|
.PRE_REV3ES (PRE_REV3ES),
|
712 |
|
|
.CKE_WIDTH (CKE_WIDTH),
|
713 |
|
|
.DATA_CTL_B0 (DATA_CTL_B0),
|
714 |
|
|
.DATA_CTL_B1 (DATA_CTL_B1),
|
715 |
|
|
.DATA_CTL_B2 (DATA_CTL_B2),
|
716 |
|
|
.DATA_CTL_B3 (DATA_CTL_B3),
|
717 |
|
|
.DATA_CTL_B4 (DATA_CTL_B4),
|
718 |
|
|
.DDR2_DQSN_ENABLE (DDR2_DQSN_ENABLE),
|
719 |
|
|
.DRAM_TYPE (DRAM_TYPE),
|
720 |
|
|
.BANK_WIDTH (BANK_WIDTH),
|
721 |
|
|
.CK_WIDTH (CK_WIDTH),
|
722 |
|
|
.COL_WIDTH (COL_WIDTH),
|
723 |
|
|
.DM_WIDTH (DM_WIDTH),
|
724 |
|
|
.DQ_WIDTH (DQ_WIDTH),
|
725 |
|
|
.DQS_CNT_WIDTH (DQS_CNT_WIDTH),
|
726 |
|
|
.DQS_WIDTH (DQS_WIDTH),
|
727 |
|
|
.DRAM_WIDTH (DRAM_WIDTH),
|
728 |
|
|
.PHYCTL_CMD_FIFO (PHYCTL_CMD_FIFO),
|
729 |
|
|
.ROW_WIDTH (ROW_WIDTH),
|
730 |
|
|
.AL (AL),
|
731 |
|
|
.ADDR_CMD_MODE (ADDR_CMD_MODE),
|
732 |
|
|
.BURST_MODE (BURST_MODE),
|
733 |
|
|
.BURST_TYPE (BURST_TYPE),
|
734 |
|
|
.CL (nCL),
|
735 |
|
|
.CWL (nCWL),
|
736 |
|
|
.tRFC (tRFC),
|
737 |
|
|
.tREFI (tREFI),
|
738 |
|
|
.tCK (tCK),
|
739 |
|
|
.OUTPUT_DRV (OUTPUT_DRV),
|
740 |
|
|
.RANKS (RANKS),
|
741 |
|
|
.ODT_WIDTH (ODT_WIDTH),
|
742 |
|
|
.REG_CTRL (REG_CTRL),
|
743 |
|
|
.RTT_NOM (RTT_NOM),
|
744 |
|
|
.RTT_WR (RTT_WR),
|
745 |
|
|
.SLOT_1_CONFIG (SLOT_1_CONFIG),
|
746 |
|
|
.WRLVL (WRLVL),
|
747 |
|
|
.BANK_TYPE (BANK_TYPE),
|
748 |
|
|
.DATA_IO_PRIM_TYPE (DATA_IO_PRIM_TYPE),
|
749 |
|
|
.DATA_IO_IDLE_PWRDWN(DATA_IO_IDLE_PWRDWN),
|
750 |
|
|
.IODELAY_GRP (IODELAY_GRP),
|
751 |
|
|
.FPGA_SPEED_GRADE (FPGA_SPEED_GRADE),
|
752 |
|
|
// Prevent the following simulation-related parameters from
|
753 |
|
|
// being overridden for synthesis - for synthesis only the
|
754 |
|
|
// default values of these parameters should be used
|
755 |
|
|
// synthesis translate_off
|
756 |
|
|
.SIM_BYPASS_INIT_CAL (SIM_BYPASS_INIT_CAL),
|
757 |
|
|
// synthesis translate_on
|
758 |
|
|
.USE_CS_PORT (USE_CS_PORT),
|
759 |
|
|
.USE_DM_PORT (USE_DM_PORT),
|
760 |
|
|
.USE_ODT_PORT (USE_ODT_PORT),
|
761 |
|
|
.MASTER_PHY_CTL (MASTER_PHY_CTL),
|
762 |
|
|
.DEBUG_PORT (DEBUG_PORT),
|
763 |
|
|
.IDELAY_ADJ (IDELAY_ADJ),
|
764 |
|
|
.FINE_PER_BIT (FINE_PER_BIT),
|
765 |
|
|
.CENTER_COMP_MODE (CENTER_COMP_MODE),
|
766 |
|
|
.PI_VAL_ADJ (PI_VAL_ADJ),
|
767 |
|
|
.TAPSPERKCLK (TAPSPERKCLK)
|
768 |
|
|
)
|
769 |
|
|
ddr_phy_top0
|
770 |
|
|
(
|
771 |
|
|
// Outputs
|
772 |
|
|
.calib_rd_data_offset_0 (calib_rd_data_offset_0),
|
773 |
|
|
.calib_rd_data_offset_1 (calib_rd_data_offset_1),
|
774 |
|
|
.calib_rd_data_offset_2 (calib_rd_data_offset_2),
|
775 |
|
|
.ddr_ck (ddr_ck),
|
776 |
|
|
.ddr_ck_n (ddr_ck_n),
|
777 |
|
|
.ddr_addr (ddr_addr),
|
778 |
|
|
.ddr_ba (ddr_ba),
|
779 |
|
|
.ddr_ras_n (ddr_ras_n),
|
780 |
|
|
.ddr_cas_n (ddr_cas_n),
|
781 |
|
|
.ddr_we_n (ddr_we_n),
|
782 |
|
|
.ddr_cs_n (ddr_cs_n),
|
783 |
|
|
.ddr_cke (ddr_cke),
|
784 |
|
|
.ddr_odt (ddr_odt),
|
785 |
|
|
.ddr_reset_n (ddr_reset_n),
|
786 |
|
|
.ddr_parity (ddr_parity),
|
787 |
|
|
.ddr_dm (ddr_dm),
|
788 |
|
|
.dbg_calib_top (dbg_calib_top),
|
789 |
|
|
.dbg_cpt_first_edge_cnt (dbg_cpt_first_edge_cnt),
|
790 |
|
|
.dbg_cpt_second_edge_cnt (dbg_cpt_second_edge_cnt),
|
791 |
|
|
.dbg_phy_rdlvl (dbg_phy_rdlvl),
|
792 |
|
|
.dbg_phy_wrcal (dbg_phy_wrcal),
|
793 |
|
|
.dbg_final_po_fine_tap_cnt (dbg_final_po_fine_tap_cnt),
|
794 |
|
|
.dbg_final_po_coarse_tap_cnt (dbg_final_po_coarse_tap_cnt),
|
795 |
|
|
.dbg_rd_data_edge_detect (dbg_rd_data_edge_detect),
|
796 |
|
|
.dbg_rddata (dbg_rddata),
|
797 |
|
|
.dbg_rdlvl_done (dbg_rdlvl_done),
|
798 |
|
|
.dbg_rdlvl_err (dbg_rdlvl_err),
|
799 |
|
|
.dbg_rdlvl_start (dbg_rdlvl_start),
|
800 |
|
|
.dbg_tap_cnt_during_wrlvl (dbg_tap_cnt_during_wrlvl),
|
801 |
|
|
.dbg_wl_edge_detect_valid (dbg_wl_edge_detect_valid),
|
802 |
|
|
.dbg_wrlvl_done (dbg_wrlvl_done),
|
803 |
|
|
.dbg_wrlvl_err (dbg_wrlvl_err),
|
804 |
|
|
.dbg_wrlvl_start (dbg_wrlvl_start),
|
805 |
|
|
.dbg_pi_phase_locked_phy4lanes (dbg_pi_phase_locked_phy4lanes),
|
806 |
|
|
.dbg_pi_dqs_found_lanes_phy4lanes (dbg_pi_dqs_found_lanes_phy4lanes),
|
807 |
|
|
.init_calib_complete (init_calib_complete_w),
|
808 |
|
|
.init_wrcal_complete (init_wrcal_complete_w),
|
809 |
|
|
.mc_address (mc_address),
|
810 |
|
|
.mc_aux_out0 (mc_aux_out0),
|
811 |
|
|
.mc_aux_out1 (mc_aux_out1),
|
812 |
|
|
.mc_bank (mc_bank),
|
813 |
|
|
.mc_cke (mc_cke),
|
814 |
|
|
.mc_odt (mc_odt),
|
815 |
|
|
.mc_cas_n (mc_cas_n),
|
816 |
|
|
.mc_cmd (mc_cmd),
|
817 |
|
|
.mc_cmd_wren (mc_cmd_wren),
|
818 |
|
|
.mc_cas_slot (mc_cas_slot),
|
819 |
|
|
.mc_cs_n (mc_cs_n),
|
820 |
|
|
.mc_ctl_wren (mc_ctl_wren),
|
821 |
|
|
.mc_data_offset (mc_data_offset),
|
822 |
|
|
.mc_data_offset_1 (mc_data_offset_1),
|
823 |
|
|
.mc_data_offset_2 (mc_data_offset_2),
|
824 |
|
|
.mc_rank_cnt (mc_rank_cnt),
|
825 |
|
|
.mc_ras_n (mc_ras_n),
|
826 |
|
|
.mc_reset_n (mc_reset_n),
|
827 |
|
|
.mc_we_n (mc_we_n),
|
828 |
|
|
.mc_wrdata (mc_wrdata),
|
829 |
|
|
.mc_wrdata_en (mc_wrdata_en),
|
830 |
|
|
.mc_wrdata_mask (mc_wrdata_mask),
|
831 |
|
|
.idle (idle),
|
832 |
|
|
.mem_refclk (mem_refclk),
|
833 |
|
|
.phy_mc_ctl_full (phy_mc_ctl_full),
|
834 |
|
|
.phy_mc_cmd_full (phy_mc_cmd_full),
|
835 |
|
|
.phy_mc_data_full (phy_mc_data_full),
|
836 |
|
|
.phy_rd_data (phy_rd_data),
|
837 |
|
|
.phy_rddata_valid (phy_rddata_valid),
|
838 |
|
|
.pll_lock (pll_lock),
|
839 |
|
|
.sync_pulse (sync_pulse),
|
840 |
|
|
// Inouts
|
841 |
|
|
.ddr_dqs (ddr_dqs),
|
842 |
|
|
.ddr_dqs_n (ddr_dqs_n),
|
843 |
|
|
.ddr_dq (ddr_dq),
|
844 |
|
|
// Inputs
|
845 |
|
|
.clk_ref (clk_ref),
|
846 |
|
|
.freq_refclk (freq_refclk),
|
847 |
|
|
.clk (clk),
|
848 |
|
|
.mmcm_ps_clk (mmcm_ps_clk),
|
849 |
|
|
.poc_sample_pd (poc_sample_pd),
|
850 |
|
|
.rst (rst),
|
851 |
|
|
.error (error),
|
852 |
|
|
.rst_tg_mc (rst_tg_mc),
|
853 |
|
|
.slot_0_present (slot_0_present),
|
854 |
|
|
.slot_1_present (slot_1_present),
|
855 |
|
|
.dbg_idel_up_all (dbg_idel_up_all),
|
856 |
|
|
.dbg_idel_down_all (dbg_idel_down_all),
|
857 |
|
|
.dbg_idel_up_cpt (dbg_idel_up_cpt),
|
858 |
|
|
.dbg_idel_down_cpt (dbg_idel_down_cpt),
|
859 |
|
|
.dbg_sel_idel_cpt (dbg_sel_idel_cpt),
|
860 |
|
|
.dbg_sel_all_idel_cpt (dbg_sel_all_idel_cpt)
|
861 |
|
|
|
862 |
|
|
,.device_temp (device_temp)
|
863 |
|
|
,.tempmon_sample_en (tempmon_sample_en)
|
864 |
|
|
,.psen (psen)
|
865 |
|
|
,.psincdec (psincdec)
|
866 |
|
|
,.psdone (psdone)
|
867 |
|
|
|
868 |
|
|
,.dbg_sel_pi_incdec (dbg_sel_pi_incdec)
|
869 |
|
|
,.dbg_sel_po_incdec (dbg_sel_po_incdec)
|
870 |
|
|
,.dbg_byte_sel (dbg_byte_sel)
|
871 |
|
|
,.dbg_pi_f_inc (dbg_pi_f_inc)
|
872 |
|
|
,.dbg_po_f_inc (dbg_po_f_inc)
|
873 |
|
|
,.dbg_po_f_stg23_sel (dbg_po_f_stg23_sel)
|
874 |
|
|
,.dbg_pi_f_dec (dbg_pi_f_dec)
|
875 |
|
|
,.dbg_po_f_dec (dbg_po_f_dec)
|
876 |
|
|
,.dbg_cpt_tap_cnt (dbg_cpt_tap_cnt)
|
877 |
|
|
,.dbg_dq_idelay_tap_cnt (dbg_dq_idelay_tap_cnt)
|
878 |
|
|
,.dbg_rddata_valid (dbg_rddata_valid)
|
879 |
|
|
,.dbg_wrlvl_fine_tap_cnt (dbg_wrlvl_fine_tap_cnt)
|
880 |
|
|
,.dbg_wrlvl_coarse_tap_cnt (dbg_wrlvl_coarse_tap_cnt)
|
881 |
|
|
,.dbg_phy_wrlvl (dbg_phy_wrlvl)
|
882 |
|
|
,.ref_dll_lock (ref_dll_lock)
|
883 |
|
|
,.rst_phaser_ref (rst_phaser_ref)
|
884 |
|
|
,.iddr_rst (iddr_rst)
|
885 |
|
|
,.dbg_rd_data_offset (dbg_rd_data_offset)
|
886 |
|
|
,.dbg_phy_init (dbg_phy_init)
|
887 |
|
|
,.dbg_prbs_rdlvl (dbg_prbs_rdlvl)
|
888 |
|
|
,.dbg_dqs_found_cal (dbg_dqs_found_cal)
|
889 |
|
|
,.dbg_po_counter_read_val (dbg_po_counter_read_val)
|
890 |
|
|
,.dbg_pi_counter_read_val (dbg_pi_counter_read_val)
|
891 |
|
|
,.dbg_pi_phaselock_start (dbg_pi_phaselock_start)
|
892 |
|
|
,.dbg_pi_phaselocked_done (dbg_pi_phaselocked_done)
|
893 |
|
|
,.dbg_pi_phaselock_err (dbg_pi_phaselock_err)
|
894 |
|
|
,.dbg_pi_dqsfound_start (dbg_pi_dqsfound_start)
|
895 |
|
|
,.dbg_pi_dqsfound_done (dbg_pi_dqsfound_done)
|
896 |
|
|
,.dbg_pi_dqsfound_err (dbg_pi_dqsfound_err)
|
897 |
|
|
,.dbg_wrcal_start (dbg_wrcal_start)
|
898 |
|
|
,.dbg_wrcal_done (dbg_wrcal_done)
|
899 |
|
|
,.dbg_wrcal_err (dbg_wrcal_err)
|
900 |
|
|
,.dbg_phy_oclkdelay_cal (dbg_phy_oclkdelay_cal)
|
901 |
|
|
,.dbg_oclkdelay_rd_data (dbg_oclkdelay_rd_data)
|
902 |
|
|
,.dbg_oclkdelay_calib_start (dbg_oclkdelay_calib_start)
|
903 |
|
|
,.dbg_oclkdelay_calib_done (dbg_oclkdelay_calib_done)
|
904 |
|
|
,.prbs_final_dqs_tap_cnt_r (prbs_final_dqs_tap_cnt_r)
|
905 |
|
|
,.dbg_prbs_first_edge_taps (dbg_prbs_first_edge_taps)
|
906 |
|
|
,.dbg_prbs_second_edge_taps (dbg_prbs_second_edge_taps)
|
907 |
|
|
);
|
908 |
|
|
|
909 |
|
|
endmodule
|