OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [boards/] [xilinx/] [atlys/] [rtl/] [verilog/] [xilinx_ddr2/] [ddr2_mig.v] - Blame information for rev 627

Details | Compare with Previous | View Log

Line No. Rev Author Line
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            : 3.6.1
53
//  \   \         Application        : MIG
54
//  /   /         Filename           : ddr2_mig #.v
55
// /___/   /\     Date Last Modified : $Date: 2010/10/27 17:40:11 $
56
// \   \  /  \    Date Created       : Tue Feb 23 2010
57
//  \___\/\___\
58
//
59
//Device           : Spartan-6
60
//Design Name      : DDR/DDR2/DDR3/LPDDR 
61
//Purpose          : This is a template file for the design top module. This module contains 
62
//                   all the four memory controllers and the two infrastructures. However,
63
//                   only the enabled modules will be active and others inactive.
64
//Reference        :
65
//Revision History :
66
//*****************************************************************************
67
`timescale 1ns/1ps
68
 
69
(* X_CORE_INFO = "mig_v3_61_ddr2_ddr2_s6, Coregen 12.4" , CORE_GENERATION_INFO = "ddr2_ddr2_s6,mig_v3_61,{component_name=ddr2_mig, C3_MEM_INTERFACE_TYPE=DDR2_SDRAM, C3_CLK_PERIOD=3750, C3_MEMORY_PART=mt47h64m16xx-25e, C3_OUTPUT_DRV=FULL, C3_RTT_NOM=50OHMS, C3_DQS#_ENABLE=YES, C3_HIGH_TEMP_SR=NORMAL, C3_PORT_CONFIG=One 128-bit bi-directional port, C3_MEM_ADDR_ORDER=BANK_ROW_COLUMN, C3_PORT_ENABLE=Port0, C3_CLASS_ADDR=II, C3_CLASS_DATA=II, C3_INPUT_PIN_TERMINATION=CALIB_TERM, C3_DATA_TERMINATION=25 Ohms, C3_CLKFBOUT_MULT_F=2, C3_CLKOUT_DIVIDE=1, C3_DEBUG_PORT=0, INPUT_CLK_TYPE=Single-Ended, LANGUAGE=Verilog, SYNTHESIS_TOOL=ISE, NO_OF_CONTROLLERS=1}" *)
70
module ddr2_mig #
71
(
72
   parameter C3_P0_MASK_SIZE           = 16,
73
   parameter C3_P0_DATA_PORT_SIZE      = 128,
74
   parameter DEBUG_EN                = 0,
75
   parameter C3_MEMCLK_PERIOD        = 3750,
76
   parameter C3_CALIB_SOFT_IP        = "TRUE",
77
   parameter C3_SIMULATION           = "FALSE",
78
   parameter C3_RST_ACT_LOW          = 0,
79
   parameter C3_INPUT_CLK_TYPE       = "SINGLE_ENDED",
80
   parameter C3_MEM_ADDR_ORDER       = "BANK_ROW_COLUMN",
81
   parameter C3_NUM_DQ_PINS          = 16,
82
   parameter C3_MEM_ADDR_WIDTH       = 13,
83
   parameter C3_MEM_BANKADDR_WIDTH   = 3
84
)
85
 
86
(
87
 
88
   inout  [C3_NUM_DQ_PINS-1:0]                      mcb3_dram_dq,
89
   output [C3_MEM_ADDR_WIDTH-1:0]                   mcb3_dram_a,
90
   output [C3_MEM_BANKADDR_WIDTH-1:0]               mcb3_dram_ba,
91
   output                                           mcb3_dram_ras_n,
92
   output                                           mcb3_dram_cas_n,
93
   output                                           mcb3_dram_we_n,
94
   output                                           mcb3_dram_odt,
95
   output                                           mcb3_dram_cke,
96
   output                                           mcb3_dram_dm,
97
   inout                                            mcb3_dram_udqs,
98
   inout                                            mcb3_dram_udqs_n,
99
   inout                                            mcb3_rzq,
100
   inout                                            mcb3_zio,
101
   output                                           mcb3_dram_udm,
102
   input                                            c3_sys_clk,
103
   input                                            c3_sys_rst_n,
104
   output                                           c3_calib_done,
105
   output                                           c3_clk0,
106
   output                                           c3_rst0,
107
   inout                                            mcb3_dram_dqs,
108
   inout                                            mcb3_dram_dqs_n,
109
   output                                           mcb3_dram_ck,
110
   output                                           mcb3_dram_ck_n,
111
      input             c3_p0_cmd_clk,
112
      input             c3_p0_cmd_en,
113
      input [2:0]        c3_p0_cmd_instr,
114
      input [5:0]        c3_p0_cmd_bl,
115
      input [29:0]       c3_p0_cmd_byte_addr,
116
      output            c3_p0_cmd_empty,
117
      output            c3_p0_cmd_full,
118
      input             c3_p0_wr_clk,
119
      input             c3_p0_wr_en,
120
      input [C3_P0_MASK_SIZE - 1:0]      c3_p0_wr_mask,
121
      input [C3_P0_DATA_PORT_SIZE - 1:0] c3_p0_wr_data,
122
      output            c3_p0_wr_full,
123
      output            c3_p0_wr_empty,
124
      output [6:0]       c3_p0_wr_count,
125
      output            c3_p0_wr_underrun,
126
      output            c3_p0_wr_error,
127
      input             c3_p0_rd_clk,
128
      input             c3_p0_rd_en,
129
      output [C3_P0_DATA_PORT_SIZE - 1:0]        c3_p0_rd_data,
130
      output            c3_p0_rd_full,
131
      output            c3_p0_rd_empty,
132
      output [6:0]       c3_p0_rd_count,
133
      output            c3_p0_rd_overflow,
134
      output            c3_p0_rd_error
135
);
136
// The parameter CX_PORT_ENABLE shows all the active user ports in the design.
137
// For example, the value 6'b111100 tells that only port-2, port-3, port-4
138
// and port-5 are enabled. The other two ports are inactive. An inactive port
139
// can be a disabled port or an invisible logical port. Few examples to the 
140
// invisible logical port are port-4 and port-5 in the user port configuration,
141
// Config-2: Four 32-bit bi-directional ports and the ports port-2 through
142
// port-5 in Config-4: Two 64-bit bi-directional ports. Please look into the 
143
// Chapter-2 of ug388.pdf in the /docs directory for further details.
144
   localparam  C3_P1_MASK_SIZE           =16;
145
   localparam  C3_P1_DATA_PORT_SIZE      =128;
146
   localparam C3_PORT_ENABLE              = 6'b000001;
147
   localparam C3_PORT_CONFIG             =  "B128";
148
   localparam C3_CLKOUT0_DIVIDE       = 1;
149
   localparam C3_CLKOUT1_DIVIDE       = 1;
150
   localparam C3_CLKOUT2_DIVIDE       = 16;
151
   localparam C3_CLKOUT3_DIVIDE       = 8;
152
   localparam C3_CLKFBOUT_MULT        = 2;
153
   localparam C3_DIVCLK_DIVIDE        = 1;
154
   localparam C3_ARB_ALGORITHM        = 0;
155
   localparam C3_ARB_NUM_TIME_SLOTS   = 12;
156
   localparam C3_ARB_TIME_SLOT_0      = 3'o0;
157
   localparam C3_ARB_TIME_SLOT_1      = 3'o0;
158
   localparam C3_ARB_TIME_SLOT_2      = 3'o0;
159
   localparam C3_ARB_TIME_SLOT_3      = 3'o0;
160
   localparam C3_ARB_TIME_SLOT_4      = 3'o0;
161
   localparam C3_ARB_TIME_SLOT_5      = 3'o0;
162
   localparam C3_ARB_TIME_SLOT_6      = 3'o0;
163
   localparam C3_ARB_TIME_SLOT_7      = 3'o0;
164
   localparam C3_ARB_TIME_SLOT_8      = 3'o0;
165
   localparam C3_ARB_TIME_SLOT_9      = 3'o0;
166
   localparam C3_ARB_TIME_SLOT_10     = 3'o0;
167
   localparam C3_ARB_TIME_SLOT_11     = 3'o0;
168
   localparam C3_MEM_TRAS             = 42500;
169
   localparam C3_MEM_TRCD             = 12500;
170
   localparam C3_MEM_TREFI            = 7800000;
171
   localparam C3_MEM_TRFC             = 127500;
172
   localparam C3_MEM_TRP              = 12500;
173
   localparam C3_MEM_TWR              = 15000;
174
   localparam C3_MEM_TRTP             = 7500;
175
   localparam C3_MEM_TWTR             = 7500;
176
   localparam C3_MEM_TYPE             = "DDR2";
177
   localparam C3_MEM_DENSITY          = "1Gb";
178
   localparam C3_MEM_BURST_LEN        = 8;
179
   localparam C3_MEM_CAS_LATENCY      = 4;
180
   localparam C3_MEM_NUM_COL_BITS     = 10;
181
   localparam C3_MEM_DDR1_2_ODS       = "FULL";
182
   localparam C3_MEM_DDR2_RTT         = "50OHMS";
183
   localparam C3_MEM_DDR2_DIFF_DQS_EN  = "YES";
184
   localparam C3_MEM_DDR2_3_PA_SR     = "FULL";
185
   localparam C3_MEM_DDR2_3_HIGH_TEMP_SR  = "NORMAL";
186
   localparam C3_MEM_DDR3_CAS_LATENCY  = 6;
187
   localparam C3_MEM_DDR3_ODS         = "DIV6";
188
   localparam C3_MEM_DDR3_RTT         = "DIV2";
189
   localparam C3_MEM_DDR3_CAS_WR_LATENCY  = 5;
190
   localparam C3_MEM_DDR3_AUTO_SR     = "ENABLED";
191
   localparam C3_MEM_MOBILE_PA_SR     = "FULL";
192
   localparam C3_MEM_MDDR_ODS         = "FULL";
193
   localparam C3_MC_CALIB_BYPASS      = "NO";
194
   localparam C3_MC_CALIBRATION_MODE  = "CALIBRATION";
195
   localparam C3_MC_CALIBRATION_DELAY  = "HALF";
196
   localparam C3_SKIP_IN_TERM_CAL     = 0;
197
   localparam C3_SKIP_DYNAMIC_CAL     = 0;
198
   localparam C3_LDQSP_TAP_DELAY_VAL  = 0;
199
   localparam C3_LDQSN_TAP_DELAY_VAL  = 0;
200
   localparam C3_UDQSP_TAP_DELAY_VAL  = 0;
201
   localparam C3_UDQSN_TAP_DELAY_VAL  = 0;
202
   localparam C3_DQ0_TAP_DELAY_VAL    = 0;
203
   localparam C3_DQ1_TAP_DELAY_VAL    = 0;
204
   localparam C3_DQ2_TAP_DELAY_VAL    = 0;
205
   localparam C3_DQ3_TAP_DELAY_VAL    = 0;
206
   localparam C3_DQ4_TAP_DELAY_VAL    = 0;
207
   localparam C3_DQ5_TAP_DELAY_VAL    = 0;
208
   localparam C3_DQ6_TAP_DELAY_VAL    = 0;
209
   localparam C3_DQ7_TAP_DELAY_VAL    = 0;
210
   localparam C3_DQ8_TAP_DELAY_VAL    = 0;
211
   localparam C3_DQ9_TAP_DELAY_VAL    = 0;
212
   localparam C3_DQ10_TAP_DELAY_VAL   = 0;
213
   localparam C3_DQ11_TAP_DELAY_VAL   = 0;
214
   localparam C3_DQ12_TAP_DELAY_VAL   = 0;
215
   localparam C3_DQ13_TAP_DELAY_VAL   = 0;
216
   localparam C3_DQ14_TAP_DELAY_VAL   = 0;
217
   localparam C3_DQ15_TAP_DELAY_VAL   = 0;
218
   localparam C3_MCB_USE_EXTERNAL_BUFPLL  = 1;
219
   localparam C3_INCLK_PERIOD         = ((C3_MEMCLK_PERIOD * C3_CLKFBOUT_MULT) / (C3_DIVCLK_DIVIDE * C3_CLKOUT0_DIVIDE * 2));
220
   localparam C3_ARB_TIME0_SLOT  = {3'b111, 3'b111, 3'b111, 3'b111, 3'b111, C3_ARB_TIME_SLOT_0[2:0]};
221
   localparam C3_ARB_TIME1_SLOT  = {3'b111, 3'b111, 3'b111, 3'b111, 3'b111, C3_ARB_TIME_SLOT_1[2:0]};
222
   localparam C3_ARB_TIME2_SLOT  = {3'b111, 3'b111, 3'b111, 3'b111, 3'b111, C3_ARB_TIME_SLOT_2[2:0]};
223
   localparam C3_ARB_TIME3_SLOT  = {3'b111, 3'b111, 3'b111, 3'b111, 3'b111, C3_ARB_TIME_SLOT_3[2:0]};
224
   localparam C3_ARB_TIME4_SLOT  = {3'b111, 3'b111, 3'b111, 3'b111, 3'b111, C3_ARB_TIME_SLOT_4[2:0]};
225
   localparam C3_ARB_TIME5_SLOT  = {3'b111, 3'b111, 3'b111, 3'b111, 3'b111, C3_ARB_TIME_SLOT_5[2:0]};
226
   localparam C3_ARB_TIME6_SLOT  = {3'b111, 3'b111, 3'b111, 3'b111, 3'b111, C3_ARB_TIME_SLOT_6[2:0]};
227
   localparam C3_ARB_TIME7_SLOT  = {3'b111, 3'b111, 3'b111, 3'b111, 3'b111, C3_ARB_TIME_SLOT_7[2:0]};
228
   localparam C3_ARB_TIME8_SLOT  = {3'b111, 3'b111, 3'b111, 3'b111, 3'b111, C3_ARB_TIME_SLOT_8[2:0]};
229
   localparam C3_ARB_TIME9_SLOT  = {3'b111, 3'b111, 3'b111, 3'b111, 3'b111, C3_ARB_TIME_SLOT_9[2:0]};
230
   localparam C3_ARB_TIME10_SLOT  = {3'b111, 3'b111, 3'b111, 3'b111, 3'b111, C3_ARB_TIME_SLOT_10[2:0]};
231
   localparam C3_ARB_TIME11_SLOT  = {3'b111, 3'b111, 3'b111, 3'b111, 3'b111, C3_ARB_TIME_SLOT_11[2:0]};
232
 
233
  wire                              c3_sys_clk_p;
234
  wire                              c3_sys_clk_n;
235
  wire                              c3_async_rst;
236
  wire                              c3_sysclk_2x;
237
  wire                              c3_sysclk_2x_180;
238
  wire                              c3_pll_ce_0;
239
  wire                              c3_pll_ce_90;
240
  wire                              c3_pll_lock;
241
  wire                              c3_mcb_drp_clk;
242
  wire                              c3_cmp_error;
243
  wire                              c3_cmp_data_valid;
244
  wire                              c3_vio_modify_enable;
245
  wire  [2:0]                      c3_vio_data_mode_value;
246
  wire  [2:0]                      c3_vio_addr_mode_value;
247
  wire  [31:0]                      c3_cmp_data;
248
wire                            c3_p1_cmd_clk;
249
wire                            c3_p1_cmd_en;
250
wire[2:0]                        c3_p1_cmd_instr;
251
wire[5:0]                        c3_p1_cmd_bl;
252
wire[29:0]                       c3_p1_cmd_byte_addr;
253
wire                            c3_p1_cmd_empty;
254
wire                            c3_p1_cmd_full;
255
wire                            c3_p1_wr_clk;
256
wire                            c3_p1_wr_en;
257
wire[C3_P1_MASK_SIZE-1:0]        c3_p1_wr_mask;
258
wire[C3_P1_DATA_PORT_SIZE-1:0]   c3_p1_wr_data;
259
wire                            c3_p1_wr_full;
260
wire                            c3_p1_wr_empty;
261
wire[6:0]                        c3_p1_wr_count;
262
wire                            c3_p1_wr_underrun;
263
wire                            c3_p1_wr_error;
264
wire                            c3_p1_rd_clk;
265
wire                            c3_p1_rd_en;
266
wire[C3_P1_DATA_PORT_SIZE-1:0]   c3_p1_rd_data;
267
wire                            c3_p1_rd_full;
268
wire                            c3_p1_rd_empty;
269
wire[6:0]                        c3_p1_rd_count;
270
wire                            c3_p1_rd_overflow;
271
wire                            c3_p1_rd_error;
272
wire                            c3_p2_cmd_clk;
273
wire                            c3_p2_cmd_en;
274
wire[2:0]                        c3_p2_cmd_instr;
275
wire[5:0]                        c3_p2_cmd_bl;
276
wire[29:0]                       c3_p2_cmd_byte_addr;
277
wire                            c3_p2_cmd_empty;
278
wire                            c3_p2_cmd_full;
279
wire                            c3_p2_wr_clk;
280
wire                            c3_p2_wr_en;
281
wire[3:0]                        c3_p2_wr_mask;
282
wire[31:0]                       c3_p2_wr_data;
283
wire                            c3_p2_wr_full;
284
wire                            c3_p2_wr_empty;
285
wire[6:0]                        c3_p2_wr_count;
286
wire                            c3_p2_wr_underrun;
287
wire                            c3_p2_wr_error;
288
wire                            c3_p2_rd_clk;
289
wire                            c3_p2_rd_en;
290
wire[31:0]                       c3_p2_rd_data;
291
wire                            c3_p2_rd_full;
292
wire                            c3_p2_rd_empty;
293
wire[6:0]                        c3_p2_rd_count;
294
wire                            c3_p2_rd_overflow;
295
wire                            c3_p2_rd_error;
296
wire                            c3_p3_cmd_clk;
297
wire                            c3_p3_cmd_en;
298
wire[2:0]                        c3_p3_cmd_instr;
299
wire[5:0]                        c3_p3_cmd_bl;
300
wire[29:0]                       c3_p3_cmd_byte_addr;
301
wire                            c3_p3_cmd_empty;
302
wire                            c3_p3_cmd_full;
303
wire                            c3_p3_wr_clk;
304
wire                            c3_p3_wr_en;
305
wire[3:0]                        c3_p3_wr_mask;
306
wire[31:0]                       c3_p3_wr_data;
307
wire                            c3_p3_wr_full;
308
wire                            c3_p3_wr_empty;
309
wire[6:0]                        c3_p3_wr_count;
310
wire                            c3_p3_wr_underrun;
311
wire                            c3_p3_wr_error;
312
wire                            c3_p3_rd_clk;
313
wire                            c3_p3_rd_en;
314
wire[31:0]                       c3_p3_rd_data;
315
wire                            c3_p3_rd_full;
316
wire                            c3_p3_rd_empty;
317
wire[6:0]                        c3_p3_rd_count;
318
wire                            c3_p3_rd_overflow;
319
wire                            c3_p3_rd_error;
320
wire                            c3_p4_cmd_clk;
321
wire                            c3_p4_cmd_en;
322
wire[2:0]                        c3_p4_cmd_instr;
323
wire[5:0]                        c3_p4_cmd_bl;
324
wire[29:0]                       c3_p4_cmd_byte_addr;
325
wire                            c3_p4_cmd_empty;
326
wire                            c3_p4_cmd_full;
327
wire                            c3_p4_wr_clk;
328
wire                            c3_p4_wr_en;
329
wire[3:0]                        c3_p4_wr_mask;
330
wire[31:0]                       c3_p4_wr_data;
331
wire                            c3_p4_wr_full;
332
wire                            c3_p4_wr_empty;
333
wire[6:0]                        c3_p4_wr_count;
334
wire                            c3_p4_wr_underrun;
335
wire                            c3_p4_wr_error;
336
wire                            c3_p4_rd_clk;
337
wire                            c3_p4_rd_en;
338
wire[31:0]                       c3_p4_rd_data;
339
wire                            c3_p4_rd_full;
340
wire                            c3_p4_rd_empty;
341
wire[6:0]                        c3_p4_rd_count;
342
wire                            c3_p4_rd_overflow;
343
wire                            c3_p4_rd_error;
344
wire                            c3_p5_cmd_clk;
345
wire                            c3_p5_cmd_en;
346
wire[2:0]                        c3_p5_cmd_instr;
347
wire[5:0]                        c3_p5_cmd_bl;
348
wire[29:0]                       c3_p5_cmd_byte_addr;
349
wire                            c3_p5_cmd_empty;
350
wire                            c3_p5_cmd_full;
351
wire                            c3_p5_wr_clk;
352
wire                            c3_p5_wr_en;
353
wire[3:0]                        c3_p5_wr_mask;
354
wire[31:0]                       c3_p5_wr_data;
355
wire                            c3_p5_wr_full;
356
wire                            c3_p5_wr_empty;
357
wire[6:0]                        c3_p5_wr_count;
358
wire                            c3_p5_wr_underrun;
359
wire                            c3_p5_wr_error;
360
wire                            c3_p5_rd_clk;
361
wire                            c3_p5_rd_en;
362
wire[31:0]                       c3_p5_rd_data;
363
wire                            c3_p5_rd_full;
364
wire                            c3_p5_rd_empty;
365
wire[6:0]                        c3_p5_rd_count;
366
wire                            c3_p5_rd_overflow;
367
wire                            c3_p5_rd_error;
368
 
369
 
370
 
371
 
372
assign  c3_sys_clk_p = 1'b0;
373
assign  c3_sys_clk_n = 1'b0;
374
 
375
 
376
 
377
// Infrastructure-3 instantiation
378
      infrastructure #
379
      (
380
         .C_INCLK_PERIOD                 (C3_INCLK_PERIOD),
381
         .C_RST_ACT_LOW                  (C3_RST_ACT_LOW),
382
         .C_INPUT_CLK_TYPE               (C3_INPUT_CLK_TYPE),
383
         .C_CLKOUT0_DIVIDE               (C3_CLKOUT0_DIVIDE),
384
         .C_CLKOUT1_DIVIDE               (C3_CLKOUT1_DIVIDE),
385
         .C_CLKOUT2_DIVIDE               (C3_CLKOUT2_DIVIDE),
386
         .C_CLKOUT3_DIVIDE               (C3_CLKOUT3_DIVIDE),
387
         .C_CLKFBOUT_MULT                (C3_CLKFBOUT_MULT),
388
         .C_DIVCLK_DIVIDE                (C3_DIVCLK_DIVIDE)
389
      )
390
      memc3_infrastructure_inst
391
      (
392
         .sys_clk_p                      (c3_sys_clk_p),
393
         .sys_clk_n                      (c3_sys_clk_n),
394
         .sys_clk                        (c3_sys_clk),
395
         .sys_rst_n                      (c3_sys_rst_n),
396
         .clk0                           (c3_clk0),
397
         .rst0                           (c3_rst0),
398
         .async_rst                      (c3_async_rst),
399
         .sysclk_2x                      (c3_sysclk_2x),
400
         .sysclk_2x_180                  (c3_sysclk_2x_180),
401
         .pll_ce_0                       (c3_pll_ce_0),
402
         .pll_ce_90                      (c3_pll_ce_90),
403
         .pll_lock                       (c3_pll_lock),
404
         .mcb_drp_clk                    (c3_mcb_drp_clk)
405
      );
406
 
407
 
408
 
409
// Controller-3 instantiation
410
      memc_wrapper #
411
      (
412
         .C_MEMCLK_PERIOD                (C3_MEMCLK_PERIOD),
413
         .C_CALIB_SOFT_IP                (C3_CALIB_SOFT_IP),
414
         .C_SIMULATION                   (C3_SIMULATION),
415
         .C_ARB_NUM_TIME_SLOTS           (C3_ARB_NUM_TIME_SLOTS),
416
         .C_ARB_TIME_SLOT_0              (C3_ARB_TIME0_SLOT),
417
         .C_ARB_TIME_SLOT_1              (C3_ARB_TIME1_SLOT),
418
         .C_ARB_TIME_SLOT_2              (C3_ARB_TIME2_SLOT),
419
         .C_ARB_TIME_SLOT_3              (C3_ARB_TIME3_SLOT),
420
         .C_ARB_TIME_SLOT_4              (C3_ARB_TIME4_SLOT),
421
         .C_ARB_TIME_SLOT_5              (C3_ARB_TIME5_SLOT),
422
         .C_ARB_TIME_SLOT_6              (C3_ARB_TIME6_SLOT),
423
         .C_ARB_TIME_SLOT_7              (C3_ARB_TIME7_SLOT),
424
         .C_ARB_TIME_SLOT_8              (C3_ARB_TIME8_SLOT),
425
         .C_ARB_TIME_SLOT_9              (C3_ARB_TIME9_SLOT),
426
         .C_ARB_TIME_SLOT_10             (C3_ARB_TIME10_SLOT),
427
         .C_ARB_TIME_SLOT_11             (C3_ARB_TIME11_SLOT),
428
         .C_ARB_ALGORITHM                (C3_ARB_ALGORITHM),
429
         .C_PORT_ENABLE                  (C3_PORT_ENABLE),
430
         .C_PORT_CONFIG                  (C3_PORT_CONFIG),
431
         .C_MEM_TRAS                     (C3_MEM_TRAS),
432
         .C_MEM_TRCD                     (C3_MEM_TRCD),
433
         .C_MEM_TREFI                    (C3_MEM_TREFI),
434
         .C_MEM_TRFC                     (C3_MEM_TRFC),
435
         .C_MEM_TRP                      (C3_MEM_TRP),
436
         .C_MEM_TWR                      (C3_MEM_TWR),
437
         .C_MEM_TRTP                     (C3_MEM_TRTP),
438
         .C_MEM_TWTR                     (C3_MEM_TWTR),
439
         .C_MEM_ADDR_ORDER               (C3_MEM_ADDR_ORDER),
440
         .C_NUM_DQ_PINS                  (C3_NUM_DQ_PINS),
441
         .C_MEM_TYPE                     (C3_MEM_TYPE),
442
         .C_MEM_DENSITY                  (C3_MEM_DENSITY),
443
         .C_MEM_BURST_LEN                (C3_MEM_BURST_LEN),
444
         .C_MEM_CAS_LATENCY              (C3_MEM_CAS_LATENCY),
445
         .C_MEM_ADDR_WIDTH               (C3_MEM_ADDR_WIDTH),
446
         .C_MEM_BANKADDR_WIDTH           (C3_MEM_BANKADDR_WIDTH),
447
         .C_MEM_NUM_COL_BITS             (C3_MEM_NUM_COL_BITS),
448
         .C_MEM_DDR1_2_ODS               (C3_MEM_DDR1_2_ODS),
449
         .C_MEM_DDR2_RTT                 (C3_MEM_DDR2_RTT),
450
         .C_MEM_DDR2_DIFF_DQS_EN         (C3_MEM_DDR2_DIFF_DQS_EN),
451
         .C_MEM_DDR2_3_PA_SR             (C3_MEM_DDR2_3_PA_SR),
452
         .C_MEM_DDR2_3_HIGH_TEMP_SR      (C3_MEM_DDR2_3_HIGH_TEMP_SR),
453
         .C_MEM_DDR3_CAS_LATENCY         (C3_MEM_DDR3_CAS_LATENCY),
454
         .C_MEM_DDR3_ODS                 (C3_MEM_DDR3_ODS),
455
         .C_MEM_DDR3_RTT                 (C3_MEM_DDR3_RTT),
456
         .C_MEM_DDR3_CAS_WR_LATENCY      (C3_MEM_DDR3_CAS_WR_LATENCY),
457
         .C_MEM_DDR3_AUTO_SR             (C3_MEM_DDR3_AUTO_SR),
458
         .C_MEM_MOBILE_PA_SR             (C3_MEM_MOBILE_PA_SR),
459
         .C_MEM_MDDR_ODS                 (C3_MEM_MDDR_ODS),
460
         .C_MC_CALIB_BYPASS              (C3_MC_CALIB_BYPASS),
461
         .C_MC_CALIBRATION_MODE          (C3_MC_CALIBRATION_MODE),
462
         .C_MC_CALIBRATION_DELAY         (C3_MC_CALIBRATION_DELAY),
463
         .C_SKIP_IN_TERM_CAL             (C3_SKIP_IN_TERM_CAL),
464
         .C_SKIP_DYNAMIC_CAL             (C3_SKIP_DYNAMIC_CAL),
465
         .LDQSP_TAP_DELAY_VAL            (C3_LDQSP_TAP_DELAY_VAL),
466
         .UDQSP_TAP_DELAY_VAL            (C3_UDQSP_TAP_DELAY_VAL),
467
         .LDQSN_TAP_DELAY_VAL            (C3_LDQSN_TAP_DELAY_VAL),
468
         .UDQSN_TAP_DELAY_VAL            (C3_UDQSN_TAP_DELAY_VAL),
469
         .DQ0_TAP_DELAY_VAL              (C3_DQ0_TAP_DELAY_VAL),
470
         .DQ1_TAP_DELAY_VAL              (C3_DQ1_TAP_DELAY_VAL),
471
         .DQ2_TAP_DELAY_VAL              (C3_DQ2_TAP_DELAY_VAL),
472
         .DQ3_TAP_DELAY_VAL              (C3_DQ3_TAP_DELAY_VAL),
473
         .DQ4_TAP_DELAY_VAL              (C3_DQ4_TAP_DELAY_VAL),
474
         .DQ5_TAP_DELAY_VAL              (C3_DQ5_TAP_DELAY_VAL),
475
         .DQ6_TAP_DELAY_VAL              (C3_DQ6_TAP_DELAY_VAL),
476
         .DQ7_TAP_DELAY_VAL              (C3_DQ7_TAP_DELAY_VAL),
477
         .DQ8_TAP_DELAY_VAL              (C3_DQ8_TAP_DELAY_VAL),
478
         .DQ9_TAP_DELAY_VAL              (C3_DQ9_TAP_DELAY_VAL),
479
         .DQ10_TAP_DELAY_VAL             (C3_DQ10_TAP_DELAY_VAL),
480
         .DQ11_TAP_DELAY_VAL             (C3_DQ11_TAP_DELAY_VAL),
481
         .DQ12_TAP_DELAY_VAL             (C3_DQ12_TAP_DELAY_VAL),
482
         .DQ13_TAP_DELAY_VAL             (C3_DQ13_TAP_DELAY_VAL),
483
         .DQ14_TAP_DELAY_VAL             (C3_DQ14_TAP_DELAY_VAL),
484
         .DQ15_TAP_DELAY_VAL             (C3_DQ15_TAP_DELAY_VAL),
485
         .C_P0_MASK_SIZE                 (C3_P0_MASK_SIZE),
486
         .C_P0_DATA_PORT_SIZE            (C3_P0_DATA_PORT_SIZE),
487
         .C_P1_MASK_SIZE                 (C3_P1_MASK_SIZE),
488
         .C_P1_DATA_PORT_SIZE            (C3_P1_DATA_PORT_SIZE)
489
        )
490
 
491
      memc3_wrapper_inst
492
      (
493
         .mcbx_dram_addr                 (mcb3_dram_a),
494
         .mcbx_dram_ba                   (mcb3_dram_ba),
495
         .mcbx_dram_ras_n                (mcb3_dram_ras_n),
496
         .mcbx_dram_cas_n                (mcb3_dram_cas_n),
497
         .mcbx_dram_we_n                 (mcb3_dram_we_n),
498
         .mcbx_dram_cke                  (mcb3_dram_cke),
499
         .mcbx_dram_clk                  (mcb3_dram_ck),
500
         .mcbx_dram_clk_n                (mcb3_dram_ck_n),
501
         .mcbx_dram_dq                   (mcb3_dram_dq),
502
         .mcbx_dram_dqs                  (mcb3_dram_dqs),
503
         .mcbx_dram_dqs_n                (mcb3_dram_dqs_n),
504
         .mcbx_dram_udqs                 (mcb3_dram_udqs),
505
         .mcbx_dram_udqs_n               (mcb3_dram_udqs_n),
506
         .mcbx_dram_udm                  (mcb3_dram_udm),
507
         .mcbx_dram_ldm                  (mcb3_dram_dm),
508
         .mcbx_dram_odt                  (mcb3_dram_odt),
509
         .mcbx_dram_ddr3_rst             ( ),
510
         .mcbx_rzq                       (mcb3_rzq),
511
         .mcbx_zio                       (mcb3_zio),
512
         .calib_done                     (c3_calib_done),
513
         .async_rst                      (c3_async_rst),
514
         .sysclk_2x                      (c3_sysclk_2x),
515
         .sysclk_2x_180                  (c3_sysclk_2x_180),
516
         .pll_ce_0                       (c3_pll_ce_0),
517
         .pll_ce_90                      (c3_pll_ce_90),
518
         .pll_lock                       (c3_pll_lock),
519
         .mcb_drp_clk                    (c3_mcb_drp_clk),
520
 
521
         // The following port map shows all the six logical user ports. However, all
522
         // of them may not be active in this design. A port should be enabled to 
523
         // validate its port map. If it is not,the complete port is going to float 
524
         // by getting disconnected from the lower level MCB modules. The port enable
525
         // information of a controller can be obtained from the corresponding local
526
         // parameter CX_PORT_ENABLE. In such a case, we can simply ignore its port map.
527
         // The following comments will explain when a port is going to be active.
528
         // Config-1: Two 32-bit bi-directional and four 32-bit unidirectional ports
529
         // Config-2: Four 32-bit bi-directional ports
530
         // Config-3: One 64-bit bi-directional and two 32-bit bi-directional ports
531
         // Config-4: Two 64-bit bi-directional ports
532
         // Config-5: One 128-bit bi-directional port
533
 
534
         // User Port-0 command interface will be active only when the port is enabled in 
535
         // the port configurations Config-1, Config-2, Config-3, Config-4 and Config-5
536
         .p0_cmd_clk                     (c3_p0_cmd_clk),
537
         .p0_cmd_en                      (c3_p0_cmd_en),
538
         .p0_cmd_instr                   (c3_p0_cmd_instr),
539
         .p0_cmd_bl                      (c3_p0_cmd_bl),
540
         .p0_cmd_byte_addr               (c3_p0_cmd_byte_addr),
541
         .p0_cmd_full                    (c3_p0_cmd_full),
542
         .p0_cmd_empty                   (c3_p0_cmd_empty),
543
         // User Port-0 data write interface will be active only when the port is enabled in
544
         // the port configurations Config-1, Config-2, Config-3, Config-4 and Config-5
545
         .p0_wr_clk                      (c3_p0_wr_clk),
546
         .p0_wr_en                       (c3_p0_wr_en),
547
         .p0_wr_mask                     (c3_p0_wr_mask),
548
         .p0_wr_data                     (c3_p0_wr_data),
549
         .p0_wr_full                     (c3_p0_wr_full),
550
         .p0_wr_count                    (c3_p0_wr_count),
551
         .p0_wr_empty                    (c3_p0_wr_empty),
552
         .p0_wr_underrun                 (c3_p0_wr_underrun),
553
         .p0_wr_error                    (c3_p0_wr_error),
554
         // User Port-0 data read interface will be active only when the port is enabled in
555
         // the port configurations Config-1, Config-2, Config-3, Config-4 and Config-5
556
         .p0_rd_clk                      (c3_p0_rd_clk),
557
         .p0_rd_en                       (c3_p0_rd_en),
558
         .p0_rd_data                     (c3_p0_rd_data),
559
         .p0_rd_empty                    (c3_p0_rd_empty),
560
         .p0_rd_count                    (c3_p0_rd_count),
561
         .p0_rd_full                     (c3_p0_rd_full),
562
         .p0_rd_overflow                 (c3_p0_rd_overflow),
563
         .p0_rd_error                    (c3_p0_rd_error),
564
 
565
         // User Port-1 command interface will be active only when the port is enabled in 
566
         // the port configurations Config-1, Config-2, Config-3 and Config-4
567
         .p1_cmd_clk                     (c3_p1_cmd_clk),
568
         .p1_cmd_en                      (c3_p1_cmd_en),
569
         .p1_cmd_instr                   (c3_p1_cmd_instr),
570
         .p1_cmd_bl                      (c3_p1_cmd_bl),
571
         .p1_cmd_byte_addr               (c3_p1_cmd_byte_addr),
572
         .p1_cmd_full                    (c3_p1_cmd_full),
573
         .p1_cmd_empty                   (c3_p1_cmd_empty),
574
         // User Port-1 data write interface will be active only when the port is enabled in 
575
         // the port configurations Config-1, Config-2, Config-3 and Config-4
576
         .p1_wr_clk                      (c3_p1_wr_clk),
577
         .p1_wr_en                       (c3_p1_wr_en),
578
         .p1_wr_mask                     (c3_p1_wr_mask),
579
         .p1_wr_data                     (c3_p1_wr_data),
580
         .p1_wr_full                     (c3_p1_wr_full),
581
         .p1_wr_count                    (c3_p1_wr_count),
582
         .p1_wr_empty                    (c3_p1_wr_empty),
583
         .p1_wr_underrun                 (c3_p1_wr_underrun),
584
         .p1_wr_error                    (c3_p1_wr_error),
585
         // User Port-1 data read interface will be active only when the port is enabled in 
586
         // the port configurations Config-1, Config-2, Config-3 and Config-4
587
         .p1_rd_clk                      (c3_p1_rd_clk),
588
         .p1_rd_en                       (c3_p1_rd_en),
589
         .p1_rd_data                     (c3_p1_rd_data),
590
         .p1_rd_empty                    (c3_p1_rd_empty),
591
         .p1_rd_count                    (c3_p1_rd_count),
592
         .p1_rd_full                     (c3_p1_rd_full),
593
         .p1_rd_overflow                 (c3_p1_rd_overflow),
594
         .p1_rd_error                    (c3_p1_rd_error),
595
 
596
         // User Port-2 command interface will be active only when the port is enabled in 
597
         // the port configurations Config-1, Config-2 and Config-3
598
         .p2_cmd_clk                     (c3_p2_cmd_clk),
599
         .p2_cmd_en                      (c3_p2_cmd_en),
600
         .p2_cmd_instr                   (c3_p2_cmd_instr),
601
         .p2_cmd_bl                      (c3_p2_cmd_bl),
602
         .p2_cmd_byte_addr               (c3_p2_cmd_byte_addr),
603
         .p2_cmd_full                    (c3_p2_cmd_full),
604
         .p2_cmd_empty                   (c3_p2_cmd_empty),
605
         // User Port-2 data write interface will be active only when the port is enabled in 
606
         // the port configurations Config-1 write direction, Config-2 and Config-3
607
         .p2_wr_clk                      (c3_p2_wr_clk),
608
         .p2_wr_en                       (c3_p2_wr_en),
609
         .p2_wr_mask                     (c3_p2_wr_mask),
610
         .p2_wr_data                     (c3_p2_wr_data),
611
         .p2_wr_full                     (c3_p2_wr_full),
612
         .p2_wr_count                    (c3_p2_wr_count),
613
         .p2_wr_empty                    (c3_p2_wr_empty),
614
         .p2_wr_underrun                 (c3_p2_wr_underrun),
615
         .p2_wr_error                    (c3_p2_wr_error),
616
         // User Port-2 data read interface will be active only when the port is enabled in 
617
         // the port configurations Config-1 read direction, Config-2 and Config-3
618
         .p2_rd_clk                      (c3_p2_rd_clk),
619
         .p2_rd_en                       (c3_p2_rd_en),
620
         .p2_rd_data                     (c3_p2_rd_data),
621
         .p2_rd_empty                    (c3_p2_rd_empty),
622
         .p2_rd_count                    (c3_p2_rd_count),
623
         .p2_rd_full                     (c3_p2_rd_full),
624
         .p2_rd_overflow                 (c3_p2_rd_overflow),
625
         .p2_rd_error                    (c3_p2_rd_error),
626
 
627
         // User Port-3 command interface will be active only when the port is enabled in 
628
         // the port configurations Config-1 and Config-2
629
         .p3_cmd_clk                     (c3_p3_cmd_clk),
630
         .p3_cmd_en                      (c3_p3_cmd_en),
631
         .p3_cmd_instr                   (c3_p3_cmd_instr),
632
         .p3_cmd_bl                      (c3_p3_cmd_bl),
633
         .p3_cmd_byte_addr               (c3_p3_cmd_byte_addr),
634
         .p3_cmd_full                    (c3_p3_cmd_full),
635
         .p3_cmd_empty                   (c3_p3_cmd_empty),
636
         // User Port-3 data write interface will be active only when the port is enabled in 
637
         // the port configurations Config-1 write direction and Config-2
638
         .p3_wr_clk                      (c3_p3_wr_clk),
639
         .p3_wr_en                       (c3_p3_wr_en),
640
         .p3_wr_mask                     (c3_p3_wr_mask),
641
         .p3_wr_data                     (c3_p3_wr_data),
642
         .p3_wr_full                     (c3_p3_wr_full),
643
         .p3_wr_count                    (c3_p3_wr_count),
644
         .p3_wr_empty                    (c3_p3_wr_empty),
645
         .p3_wr_underrun                 (c3_p3_wr_underrun),
646
         .p3_wr_error                    (c3_p3_wr_error),
647
         // User Port-3 data read interface will be active only when the port is enabled in 
648
         // the port configurations Config-1 read direction and Config-2
649
         .p3_rd_clk                      (c3_p3_rd_clk),
650
         .p3_rd_en                       (c3_p3_rd_en),
651
         .p3_rd_data                     (c3_p3_rd_data),
652
         .p3_rd_empty                    (c3_p3_rd_empty),
653
         .p3_rd_count                    (c3_p3_rd_count),
654
         .p3_rd_full                     (c3_p3_rd_full),
655
         .p3_rd_overflow                 (c3_p3_rd_overflow),
656
         .p3_rd_error                    (c3_p3_rd_error),
657
 
658
         // User Port-4 command interface will be active only when the port is enabled in 
659
         // the port configuration Config-1
660
         .p4_cmd_clk                     (c3_p4_cmd_clk),
661
         .p4_cmd_en                      (c3_p4_cmd_en),
662
         .p4_cmd_instr                   (c3_p4_cmd_instr),
663
         .p4_cmd_bl                      (c3_p4_cmd_bl),
664
         .p4_cmd_byte_addr               (c3_p4_cmd_byte_addr),
665
         .p4_cmd_full                    (c3_p4_cmd_full),
666
         .p4_cmd_empty                   (c3_p4_cmd_empty),
667
         // User Port-4 data write interface will be active only when the port is enabled in 
668
         // the port configuration Config-1 write direction
669
         .p4_wr_clk                      (c3_p4_wr_clk),
670
         .p4_wr_en                       (c3_p4_wr_en),
671
         .p4_wr_mask                     (c3_p4_wr_mask),
672
         .p4_wr_data                     (c3_p4_wr_data),
673
         .p4_wr_full                     (c3_p4_wr_full),
674
         .p4_wr_count                    (c3_p4_wr_count),
675
         .p4_wr_empty                    (c3_p4_wr_empty),
676
         .p4_wr_underrun                 (c3_p4_wr_underrun),
677
         .p4_wr_error                    (c3_p4_wr_error),
678
         // User Port-4 data read interface will be active only when the port is enabled in 
679
         // the port configuration Config-1 read direction
680
         .p4_rd_clk                      (c3_p4_rd_clk),
681
         .p4_rd_en                       (c3_p4_rd_en),
682
         .p4_rd_data                     (c3_p4_rd_data),
683
         .p4_rd_empty                    (c3_p4_rd_empty),
684
         .p4_rd_count                    (c3_p4_rd_count),
685
         .p4_rd_full                     (c3_p4_rd_full),
686
         .p4_rd_overflow                 (c3_p4_rd_overflow),
687
         .p4_rd_error                    (c3_p4_rd_error),
688
 
689
         // User Port-5 command interface will be active only when the port is enabled in 
690
         // the port configuration Config-1
691
         .p5_cmd_clk                     (c3_p5_cmd_clk),
692
         .p5_cmd_en                      (c3_p5_cmd_en),
693
         .p5_cmd_instr                   (c3_p5_cmd_instr),
694
         .p5_cmd_bl                      (c3_p5_cmd_bl),
695
         .p5_cmd_byte_addr               (c3_p5_cmd_byte_addr),
696
         .p5_cmd_full                    (c3_p5_cmd_full),
697
         .p5_cmd_empty                   (c3_p5_cmd_empty),
698
         // User Port-5 data write interface will be active only when the port is enabled in 
699
         // the port configuration Config-1 write direction
700
         .p5_wr_clk                      (c3_p5_wr_clk),
701
         .p5_wr_en                       (c3_p5_wr_en),
702
         .p5_wr_mask                     (c3_p5_wr_mask),
703
         .p5_wr_data                     (c3_p5_wr_data),
704
         .p5_wr_full                     (c3_p5_wr_full),
705
         .p5_wr_count                    (c3_p5_wr_count),
706
         .p5_wr_empty                    (c3_p5_wr_empty),
707
         .p5_wr_underrun                 (c3_p5_wr_underrun),
708
         .p5_wr_error                    (c3_p5_wr_error),
709
         // User Port-5 data read interface will be active only when the port is enabled in 
710
         // the port configuration Config-1 read direction
711
         .p5_rd_clk                      (c3_p5_rd_clk),
712
         .p5_rd_en                       (c3_p5_rd_en),
713
         .p5_rd_data                     (c3_p5_rd_data),
714
         .p5_rd_empty                    (c3_p5_rd_empty),
715
         .p5_rd_count                    (c3_p5_rd_count),
716
         .p5_rd_full                     (c3_p5_rd_full),
717
         .p5_rd_overflow                 (c3_p5_rd_overflow),
718
         .p5_rd_error                    (c3_p5_rd_error),
719
 
720
         .selfrefresh_enter              (1'b0),
721
         .selfrefresh_mode               (c3_selfrefresh_mode)
722
      );
723
 
724
 
725
 
726
 
727
 
728
 
729
endmodule
730
 
731
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.