1 |
627 |
stekern |
//*****************************************************************************
|
2 |
|
|
// (c) Copyright 2009 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: mcb_soft_calibration_top.v
|
55 |
|
|
// /___/ /\ Date Last Modified: $Date: 2010/10/27 17:40:12 $
|
56 |
|
|
// \ \ / \ Date Created: Mon Feb 9 2009
|
57 |
|
|
// \___\/\___\
|
58 |
|
|
//
|
59 |
|
|
//Device: Spartan6
|
60 |
|
|
//Design Name: DDR/DDR2/DDR3/LPDDR
|
61 |
|
|
//Purpose: Xilinx reference design top-level simulation
|
62 |
|
|
// wrapper file for input termination calibration
|
63 |
|
|
//Reference:
|
64 |
|
|
//
|
65 |
|
|
// Revision: Date: Comment
|
66 |
|
|
// 1.0: 2/06/09: Initial version for MIG wrapper.
|
67 |
|
|
// 1.1: 3/16/09: Added pll_lock port, for using it to gate reset
|
68 |
|
|
// 1.2: 6/06/09: Removed MCB_UIDQCOUNT.
|
69 |
|
|
// 1.3: 6/18/09: corrected/changed MCB_SYSRST to be an output port
|
70 |
|
|
// 1.4: 6/24/09: gave RZQ and ZIO each their own unique ADD and SDI nets
|
71 |
|
|
// 1.5: 10/08/09: removed INCDEC_TRESHOLD parameter - making it a localparam inside mcb_soft_calibration
|
72 |
|
|
// 1.6: 02/04/09: Added condition generate statmenet for ZIO pin.
|
73 |
|
|
// 1.7: 04/12/10: Added CKE_Train signal to fix DDR2 init wait .
|
74 |
|
|
//
|
75 |
|
|
// End Revision
|
76 |
|
|
//**********************************************************************************
|
77 |
|
|
|
78 |
|
|
`timescale 1ps/1ps
|
79 |
|
|
|
80 |
|
|
module mcb_soft_calibration_top # (
|
81 |
|
|
parameter C_MEM_TZQINIT_MAXCNT = 10'h512, // DDR3 Minimum delay between resets
|
82 |
|
|
parameter C_MC_CALIBRATION_MODE = "CALIBRATION", // if set to CALIBRATION will reset DQS IDELAY to DQS_NUMERATOR/DQS_DENOMINATOR local_param values, and does dynamic recal,
|
83 |
|
|
// if set to NOCALIBRATION then defaults to hard cal blocks setting of C_MC_CALBRATION_DELAY *and* no dynamic recal will be done
|
84 |
|
|
parameter SKIP_IN_TERM_CAL = 1'b0, // provides option to skip the input termination calibration
|
85 |
|
|
parameter SKIP_DYNAMIC_CAL = 1'b0, // provides option to skip the dynamic delay calibration
|
86 |
|
|
parameter SKIP_DYN_IN_TERM = 1'b0, // provides option to skip the input termination calibration
|
87 |
|
|
parameter C_SIMULATION = "FALSE", // Tells us whether the design is being simulated or implemented
|
88 |
|
|
parameter C_MEM_TYPE = "DDR" // provides the memory device used for the design
|
89 |
|
|
)
|
90 |
|
|
(
|
91 |
|
|
input wire UI_CLK, // Input - global clock to be used for input_term_tuner and IODRP clock
|
92 |
|
|
input wire RST, // Input - reset for input_term_tuner - synchronous for input_term_tuner state machine, asynch for IODRP (sub)controller
|
93 |
|
|
input wire IOCLK, // Input - IOCLK input to the IODRP's
|
94 |
|
|
output wire DONE_SOFTANDHARD_CAL, // active high flag signals soft calibration of input delays is complete and MCB_UODONECAL is high (MCB hard calib complete)
|
95 |
|
|
input wire PLL_LOCK, // Lock signal from PLL
|
96 |
|
|
input wire SELFREFRESH_REQ,
|
97 |
|
|
input wire SELFREFRESH_MCB_MODE,
|
98 |
|
|
output wire SELFREFRESH_MCB_REQ ,
|
99 |
|
|
output wire SELFREFRESH_MODE,
|
100 |
|
|
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
|
104 |
|
|
output wire MCB_UIADD, // to MCB's UIADD port
|
105 |
|
|
output wire MCB_UISDI, // to MCB's UISDI port
|
106 |
|
|
input wire MCB_UOSDO,
|
107 |
|
|
input wire MCB_UODONECAL,
|
108 |
|
|
input wire MCB_UOREFRSHFLAG,
|
109 |
|
|
output wire MCB_UICS,
|
110 |
|
|
output wire MCB_UIDRPUPDATE,
|
111 |
|
|
output wire MCB_UIBROADCAST,
|
112 |
|
|
output wire [4:0] MCB_UIADDR,
|
113 |
|
|
output wire MCB_UICMDEN,
|
114 |
|
|
output wire MCB_UIDONECAL,
|
115 |
|
|
output wire MCB_UIDQLOWERDEC,
|
116 |
|
|
output wire MCB_UIDQLOWERINC,
|
117 |
|
|
output wire MCB_UIDQUPPERDEC,
|
118 |
|
|
output wire MCB_UIDQUPPERINC,
|
119 |
|
|
output wire MCB_UILDQSDEC,
|
120 |
|
|
output wire MCB_UILDQSINC,
|
121 |
|
|
output wire MCB_UIREAD,
|
122 |
|
|
output wire MCB_UIUDQSDEC,
|
123 |
|
|
output wire MCB_UIUDQSINC,
|
124 |
|
|
output wire MCB_RECAL,
|
125 |
|
|
output wire MCB_SYSRST,
|
126 |
|
|
output wire MCB_UICMD,
|
127 |
|
|
output wire MCB_UICMDIN,
|
128 |
|
|
output wire [3:0] MCB_UIDQCOUNT,
|
129 |
|
|
input wire [7:0] MCB_UODATA,
|
130 |
|
|
input wire MCB_UODATAVALID,
|
131 |
|
|
input wire MCB_UOCMDREADY,
|
132 |
|
|
input wire MCB_UO_CAL_START,
|
133 |
|
|
|
134 |
|
|
inout wire RZQ_Pin,
|
135 |
|
|
inout wire ZIO_Pin,
|
136 |
|
|
output wire CKE_Train
|
137 |
|
|
|
138 |
|
|
);
|
139 |
|
|
|
140 |
|
|
wire IODRP_ADD;
|
141 |
|
|
wire IODRP_SDI;
|
142 |
|
|
wire RZQ_IODRP_SDO;
|
143 |
|
|
wire RZQ_IODRP_CS;
|
144 |
|
|
wire ZIO_IODRP_SDO;
|
145 |
|
|
wire ZIO_IODRP_CS;
|
146 |
|
|
wire IODRP_SDO;
|
147 |
|
|
wire IODRP_CS;
|
148 |
|
|
wire IODRP_BKST;
|
149 |
|
|
wire RZQ_ZIO_ODATAIN;
|
150 |
|
|
wire RZQ_ZIO_TRISTATE;
|
151 |
|
|
wire RZQ_TOUT;
|
152 |
|
|
wire ZIO_TOUT;
|
153 |
|
|
wire [7:0] Max_Value;
|
154 |
|
|
|
155 |
|
|
assign RZQ_ZIO_ODATAIN = ~RST;
|
156 |
|
|
assign RZQ_ZIO_TRISTATE = ~RST;
|
157 |
|
|
assign IODRP_BKST = 1'b0; //future hook for possible BKST to ZIO and RZQ
|
158 |
|
|
|
159 |
|
|
|
160 |
|
|
mcb_soft_calibration #(
|
161 |
|
|
.C_MEM_TZQINIT_MAXCNT (C_MEM_TZQINIT_MAXCNT),
|
162 |
|
|
.C_MC_CALIBRATION_MODE(C_MC_CALIBRATION_MODE),
|
163 |
|
|
.SKIP_IN_TERM_CAL (SKIP_IN_TERM_CAL),
|
164 |
|
|
.SKIP_DYNAMIC_CAL (SKIP_DYNAMIC_CAL),
|
165 |
|
|
.SKIP_DYN_IN_TERM (SKIP_DYN_IN_TERM),
|
166 |
|
|
.C_SIMULATION (C_SIMULATION),
|
167 |
|
|
.C_MEM_TYPE (C_MEM_TYPE)
|
168 |
|
|
)
|
169 |
|
|
mcb_soft_calibration_inst (
|
170 |
|
|
.UI_CLK (UI_CLK), // main clock input for logic and IODRP CLK pins. At top level, this should also connect to IODRP2_MCB CLK pins
|
171 |
|
|
.RST (RST), // main system reset for both this Soft Calibration block - also will act as a passthrough to MCB's SYSRST
|
172 |
|
|
.PLL_LOCK (PLL_LOCK), //lock signal from PLL
|
173 |
|
|
.SELFREFRESH_REQ (SELFREFRESH_REQ),
|
174 |
|
|
.SELFREFRESH_MCB_MODE (SELFREFRESH_MCB_MODE),
|
175 |
|
|
.SELFREFRESH_MCB_REQ (SELFREFRESH_MCB_REQ ),
|
176 |
|
|
.SELFREFRESH_MODE (SELFREFRESH_MODE),
|
177 |
|
|
|
178 |
|
|
.DONE_SOFTANDHARD_CAL (DONE_SOFTANDHARD_CAL),// active high flag signals soft calibration of input delays is complete and MCB_UODONECAL is high (MCB hard calib complete) .IODRP_ADD(IODRP_ADD), // RZQ and ZIO IODRP ADD port, and MCB's UIADD port
|
179 |
|
|
.IODRP_ADD (IODRP_ADD), // RZQ and ZIO IODRP ADD port
|
180 |
|
|
.IODRP_SDI (IODRP_SDI), // RZQ and ZIO IODRP SDI port, and MCB's UISDI port
|
181 |
|
|
.RZQ_IN (RZQ_IN), // RZQ pin from board - expected to have a 2*R resistor to ground
|
182 |
|
|
.RZQ_IODRP_SDO (RZQ_IODRP_SDO), // RZQ IODRP's SDO port
|
183 |
|
|
.RZQ_IODRP_CS (RZQ_IODRP_CS), // RZQ IODRP's CS port
|
184 |
|
|
.ZIO_IN (ZIO_IN), // Z-stated IO pin - garanteed not to be driven externally
|
185 |
|
|
.ZIO_IODRP_SDO (ZIO_IODRP_SDO), // ZIO IODRP's SDO port
|
186 |
|
|
.ZIO_IODRP_CS (ZIO_IODRP_CS), // ZIO IODRP's CS port
|
187 |
|
|
.MCB_UIADD (MCB_UIADD), // to MCB's UIADD port
|
188 |
|
|
.MCB_UISDI (MCB_UISDI), // to MCB's UISDI port
|
189 |
|
|
.MCB_UOSDO (MCB_UOSDO), // from MCB's UOSDO port (User output SDO)
|
190 |
|
|
.MCB_UODONECAL (MCB_UODONECAL), // indicates when MCB hard calibration process is complete
|
191 |
|
|
.MCB_UOREFRSHFLAG (MCB_UOREFRSHFLAG), //high during refresh cycle and time when MCB is innactive
|
192 |
|
|
.MCB_UICS (MCB_UICS), // to MCB's UICS port (User Input CS)
|
193 |
|
|
.MCB_UIDRPUPDATE (MCB_UIDRPUPDATE), // MCB's UIDRPUPDATE port (gets passed to IODRP2_MCB's MEMUPDATE port: this controls shadow latch used during IODRP2_MCB writes). Currently just trasnparent
|
194 |
|
|
.MCB_UIBROADCAST (MCB_UIBROADCAST), // to MCB's UIBROADCAST port (User Input BROADCAST - gets passed to IODRP2_MCB's BKST port)
|
195 |
|
|
.MCB_UIADDR (MCB_UIADDR), //to MCB's UIADDR port (gets passed to IODRP2_MCB's AUXADDR port
|
196 |
|
|
.MCB_UICMDEN (MCB_UICMDEN), //set to take control of UI interface - removes control from internal calib block
|
197 |
|
|
.MCB_UIDONECAL (MCB_UIDONECAL),
|
198 |
|
|
.MCB_UIDQLOWERDEC (MCB_UIDQLOWERDEC),
|
199 |
|
|
.MCB_UIDQLOWERINC (MCB_UIDQLOWERINC),
|
200 |
|
|
.MCB_UIDQUPPERDEC (MCB_UIDQUPPERDEC),
|
201 |
|
|
.MCB_UIDQUPPERINC (MCB_UIDQUPPERINC),
|
202 |
|
|
.MCB_UILDQSDEC (MCB_UILDQSDEC),
|
203 |
|
|
.MCB_UILDQSINC (MCB_UILDQSINC),
|
204 |
|
|
.MCB_UIREAD (MCB_UIREAD), //enables read w/o writing by turning on a SDO->SDI loopback inside the IODRP2_MCBs (doesn't exist in regular IODRP2). IODRPCTRLR_R_WB becomes don't-care.
|
205 |
|
|
.MCB_UIUDQSDEC (MCB_UIUDQSDEC),
|
206 |
|
|
.MCB_UIUDQSINC (MCB_UIUDQSINC),
|
207 |
|
|
.MCB_RECAL (MCB_RECAL), //when high initiates a hard re-calibration sequence
|
208 |
|
|
.MCB_UICMD (MCB_UICMD ),
|
209 |
|
|
.MCB_UICMDIN (MCB_UICMDIN ),
|
210 |
|
|
.MCB_UIDQCOUNT (MCB_UIDQCOUNT ),
|
211 |
|
|
.MCB_UODATA (MCB_UODATA ),
|
212 |
|
|
.MCB_UODATAVALID (MCB_UODATAVALID ),
|
213 |
|
|
.MCB_UOCMDREADY (MCB_UOCMDREADY ),
|
214 |
|
|
.MCB_UO_CAL_START (MCB_UO_CAL_START),
|
215 |
|
|
.MCB_SYSRST (MCB_SYSRST ), //drives the MCB's SYSRST pin - the main reset for MCB
|
216 |
|
|
.Max_Value (Max_Value ), // Maximum Tap Value from calibrated IOI
|
217 |
|
|
.CKE_Train (CKE_Train)
|
218 |
|
|
);
|
219 |
|
|
|
220 |
|
|
|
221 |
|
|
IOBUF IOBUF_RZQ (
|
222 |
|
|
.O (RZQ_IN),
|
223 |
|
|
.IO (RZQ_Pin),
|
224 |
|
|
.I (RZQ_OUT),
|
225 |
|
|
.T (RZQ_TOUT)
|
226 |
|
|
);
|
227 |
|
|
|
228 |
|
|
IODRP2 IODRP2_RZQ (
|
229 |
|
|
.DATAOUT(),
|
230 |
|
|
.DATAOUT2(),
|
231 |
|
|
.DOUT(RZQ_OUT),
|
232 |
|
|
.SDO(RZQ_IODRP_SDO),
|
233 |
|
|
.TOUT(RZQ_TOUT),
|
234 |
|
|
.ADD(IODRP_ADD),
|
235 |
|
|
.BKST(IODRP_BKST),
|
236 |
|
|
.CLK(UI_CLK),
|
237 |
|
|
.CS(RZQ_IODRP_CS),
|
238 |
|
|
.IDATAIN(RZQ_IN),
|
239 |
|
|
.IOCLK0(IOCLK),
|
240 |
|
|
.IOCLK1(1'b1),
|
241 |
|
|
.ODATAIN(RZQ_ZIO_ODATAIN),
|
242 |
|
|
.SDI(IODRP_SDI),
|
243 |
|
|
.T(RZQ_ZIO_TRISTATE)
|
244 |
|
|
);
|
245 |
|
|
|
246 |
|
|
|
247 |
|
|
generate
|
248 |
|
|
if ((C_MEM_TYPE == "DDR" || C_MEM_TYPE == "DDR2" || C_MEM_TYPE == "DDR3") &&
|
249 |
|
|
(SKIP_IN_TERM_CAL == 1'b0)
|
250 |
|
|
) begin : gen_zio
|
251 |
|
|
|
252 |
|
|
IOBUF IOBUF_ZIO (
|
253 |
|
|
.O (ZIO_IN),
|
254 |
|
|
.IO (ZIO_Pin),
|
255 |
|
|
.I (ZIO_OUT),
|
256 |
|
|
.T (ZIO_TOUT)
|
257 |
|
|
);
|
258 |
|
|
|
259 |
|
|
|
260 |
|
|
IODRP2 IODRP2_ZIO (
|
261 |
|
|
.DATAOUT(),
|
262 |
|
|
.DATAOUT2(),
|
263 |
|
|
.DOUT(ZIO_OUT),
|
264 |
|
|
.SDO(ZIO_IODRP_SDO),
|
265 |
|
|
.TOUT(ZIO_TOUT),
|
266 |
|
|
.ADD(IODRP_ADD),
|
267 |
|
|
.BKST(IODRP_BKST),
|
268 |
|
|
.CLK(UI_CLK),
|
269 |
|
|
.CS(ZIO_IODRP_CS),
|
270 |
|
|
.IDATAIN(ZIO_IN),
|
271 |
|
|
.IOCLK0(IOCLK),
|
272 |
|
|
.IOCLK1(1'b1),
|
273 |
|
|
.ODATAIN(RZQ_ZIO_ODATAIN),
|
274 |
|
|
.SDI(IODRP_SDI),
|
275 |
|
|
.T(RZQ_ZIO_TRISTATE)
|
276 |
|
|
);
|
277 |
|
|
|
278 |
|
|
|
279 |
|
|
end
|
280 |
|
|
endgenerate
|
281 |
|
|
|
282 |
|
|
|
283 |
|
|
endmodule
|