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

Subversion Repositories usb_fpga_2_14

[/] [usb_fpga_2_14/] [trunk/] [examples/] [memfifo/] [fpga-2.04b/] [ipcore_dir/] [mem0/] [example_design/] [rtl/] [example_top.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ZTEX
//*****************************************************************************
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.92
53
//  \   \         Application        : MIG
54
//  /   /         Filename           : example_top #.v
55
// /___/   /\     Date Last Modified : $Date: 2011/06/02 07:17:09 $
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_92_ddr_s6, Coregen 14.7" , CORE_GENERATION_INFO = "ddr_s6,mig_v3_92,{component_name=mem0, C3_MEM_INTERFACE_TYPE=DDR_SDRAM, C3_CLK_PERIOD=5000, C3_MEMORY_PART=mt46v32m16xx-5b-it, C3_MEMORY_DEVICE_WIDTH=16, C3_OUTPUT_DRV=FULL, C3_PORT_CONFIG=Two 32-bit bi-directional and four 32-bit unidirectional ports, C3_MEM_ADDR_ORDER=ROW_BANK_COLUMN, C3_PORT_ENABLE=Port0_Port1_Port2_Port3_Port4_Port5, C3_CLASS_ADDR=II, C3_CLASS_DATA=II, C3_INPUT_PIN_TERMINATION=EXTERN_TERM, C3_DATA_TERMINATION=25 Ohms, C3_CLKFBOUT_MULT_F=4, C3_CLKOUT_DIVIDE=2, C3_DEBUG_PORT=0, INPUT_CLK_TYPE=Single-Ended, LANGUAGE=Verilog, SYNTHESIS_TOOL=Foundation_ISE, NO_OF_CONTROLLERS=1}" *)
70
module example_top #
71
(
72
   parameter C3_P0_MASK_SIZE           = 4,
73
   parameter C3_P0_DATA_PORT_SIZE      = 32,
74
   parameter C3_P1_MASK_SIZE           = 4,
75
   parameter C3_P1_DATA_PORT_SIZE      = 32,
76
   parameter DEBUG_EN                = 0,
77
                                       // # = 1, Enable debug signals/controls,
78
                                       //   = 0, Disable debug signals/controls.
79
   parameter C3_MEMCLK_PERIOD        = 5000,
80
                                       // Memory data transfer clock period
81
   parameter C3_CALIB_SOFT_IP        = "TRUE",
82
                                       // # = TRUE, Enables the soft calibration logic,
83
                                       // # = FALSE, Disables the soft calibration logic.
84
   parameter C3_SIMULATION           = "FALSE",
85
                                       // # = TRUE, Simulating the design. Useful to reduce the simulation time,
86
                                       // # = FALSE, Implementing the design.
87
   parameter C3_HW_TESTING           = "FALSE",
88
                                       // Determines the address space accessed by the traffic generator,
89
                                       // # = FALSE, Smaller address space,
90
                                       // # = TRUE, Large address space.
91
   parameter C3_RST_ACT_LOW          = 0,
92
                                       // # = 1 for active low reset,
93
                                       // # = 0 for active high reset.
94
   parameter C3_INPUT_CLK_TYPE       = "SINGLE_ENDED",
95
                                       // input clock type DIFFERENTIAL or SINGLE_ENDED
96
   parameter C3_MEM_ADDR_ORDER       = "ROW_BANK_COLUMN",
97
                                       // The order in which user address is provided to the memory controller,
98
                                       // ROW_BANK_COLUMN or BANK_ROW_COLUMN
99
   parameter C3_NUM_DQ_PINS          = 16,
100
                                       // External memory data width
101
   parameter C3_MEM_ADDR_WIDTH       = 13,
102
                                       // External memory address width
103
   parameter C3_MEM_BANKADDR_WIDTH   = 2
104
                                       // External memory bank address width
105
)
106
 
107
(
108
   output                                           calib_done,
109
   output                                           error,
110
   inout  [C3_NUM_DQ_PINS-1:0]                      mcb3_dram_dq,
111
   output [C3_MEM_ADDR_WIDTH-1:0]                   mcb3_dram_a,
112
   output [C3_MEM_BANKADDR_WIDTH-1:0]               mcb3_dram_ba,
113
   output                                           mcb3_dram_cke,
114
   output                                           mcb3_dram_ras_n,
115
   output                                           mcb3_dram_cas_n,
116
   output                                           mcb3_dram_we_n,
117
   output                                           mcb3_dram_dm,
118
   inout                                            mcb3_dram_udqs,
119
   inout                                            mcb3_rzq,
120
   output                                           mcb3_dram_udm,
121
   input                                            c3_sys_clk,
122
   input                                            c3_sys_rst_i,
123
   inout                                            mcb3_dram_dqs,
124
   output                                           mcb3_dram_ck,
125
   output                                           mcb3_dram_ck_n
126
);
127
// The parameter CX_PORT_ENABLE shows all the active user ports in the design.
128
// For example, the value 6'b111100 tells that only port-2, port-3, port-4
129
// and port-5 are enabled. The other two ports are inactive. An inactive port
130
// can be a disabled port or an invisible logical port. Few examples to the 
131
// invisible logical port are port-4 and port-5 in the user port configuration,
132
// Config-2: Four 32-bit bi-directional ports and the ports port-2 through
133
// port-5 in Config-4: Two 64-bit bi-directional ports. Please look into the 
134
// Chapter-2 of ug388.pdf in the /docs directory for further details.
135
   localparam C3_PORT_ENABLE              = 6'b111111;
136
   localparam C3_PORT_CONFIG             =  "B32_B32_W32_R32_W32_R32";
137
   localparam C3_P0_PORT_MODE             =  "BI_MODE";
138
   localparam C3_P1_PORT_MODE             =  "BI_MODE";
139
   localparam C3_P2_PORT_MODE             =  "WR_MODE";
140
   localparam C3_P3_PORT_MODE             =  "RD_MODE";
141
   localparam C3_P4_PORT_MODE             =  "WR_MODE";
142
   localparam C3_P5_PORT_MODE             =  "RD_MODE";
143
   localparam C3_CLKOUT0_DIVIDE       = 2;
144
   localparam C3_CLKOUT1_DIVIDE       = 2;
145
   localparam C3_CLKOUT2_DIVIDE       = 16;
146
   localparam C3_CLKOUT3_DIVIDE       = 8;
147
   localparam C3_CLKFBOUT_MULT        = 4;
148
   localparam C3_DIVCLK_DIVIDE        = 1;
149
   localparam C3_ARB_ALGORITHM        = 0;
150
   localparam C3_ARB_NUM_TIME_SLOTS   = 12;
151
   localparam C3_ARB_TIME_SLOT_0      = 18'o012345;
152
   localparam C3_ARB_TIME_SLOT_1      = 18'o123450;
153
   localparam C3_ARB_TIME_SLOT_2      = 18'o234501;
154
   localparam C3_ARB_TIME_SLOT_3      = 18'o345012;
155
   localparam C3_ARB_TIME_SLOT_4      = 18'o450123;
156
   localparam C3_ARB_TIME_SLOT_5      = 18'o501234;
157
   localparam C3_ARB_TIME_SLOT_6      = 18'o012345;
158
   localparam C3_ARB_TIME_SLOT_7      = 18'o123450;
159
   localparam C3_ARB_TIME_SLOT_8      = 18'o234501;
160
   localparam C3_ARB_TIME_SLOT_9      = 18'o345012;
161
   localparam C3_ARB_TIME_SLOT_10     = 18'o450123;
162
   localparam C3_ARB_TIME_SLOT_11     = 18'o501234;
163
   localparam C3_MEM_TRAS             = 40000;
164
   localparam C3_MEM_TRCD             = 15000;
165
   localparam C3_MEM_TREFI            = 7800000;
166
   localparam C3_MEM_TRFC             = 70000;
167
   localparam C3_MEM_TRP              = 15000;
168
   localparam C3_MEM_TWR              = 15000;
169
   localparam C3_MEM_TRTP             = 7500;
170
   localparam C3_MEM_TWTR             = 2;
171
   localparam C3_MEM_TYPE             = "DDR";
172
   localparam C3_MEM_DENSITY          = "512Mb";
173
   localparam C3_MEM_BURST_LEN        = 4;
174
   localparam C3_MEM_CAS_LATENCY      = 3;
175
   localparam C3_MEM_NUM_COL_BITS     = 10;
176
   localparam C3_MEM_DDR1_2_ODS       = "FULL";
177
   localparam C3_MEM_DDR2_RTT         = "150OHMS";
178
   localparam C3_MEM_DDR2_DIFF_DQS_EN  = "YES";
179
   localparam C3_MEM_DDR2_3_PA_SR     = "FULL";
180
   localparam C3_MEM_DDR2_3_HIGH_TEMP_SR  = "NORMAL";
181
   localparam C3_MEM_DDR3_CAS_LATENCY  = 6;
182
   localparam C3_MEM_DDR3_ODS         = "DIV6";
183
   localparam C3_MEM_DDR3_RTT         = "DIV2";
184
   localparam C3_MEM_DDR3_CAS_WR_LATENCY  = 5;
185
   localparam C3_MEM_DDR3_AUTO_SR     = "ENABLED";
186
   localparam C3_MEM_MOBILE_PA_SR     = "FULL";
187
   localparam C3_MEM_MDDR_ODS         = "FULL";
188
   localparam C3_MC_CALIB_BYPASS      = "NO";
189
   localparam C3_MC_CALIBRATION_MODE  = "CALIBRATION";
190
   localparam C3_MC_CALIBRATION_DELAY  = "HALF";
191
   localparam C3_SKIP_IN_TERM_CAL     = 1;
192
   localparam C3_SKIP_DYNAMIC_CAL     = 0;
193
   localparam C3_LDQSP_TAP_DELAY_VAL  = 0;
194
   localparam C3_LDQSN_TAP_DELAY_VAL  = 0;
195
   localparam C3_UDQSP_TAP_DELAY_VAL  = 0;
196
   localparam C3_UDQSN_TAP_DELAY_VAL  = 0;
197
   localparam C3_DQ0_TAP_DELAY_VAL    = 0;
198
   localparam C3_DQ1_TAP_DELAY_VAL    = 0;
199
   localparam C3_DQ2_TAP_DELAY_VAL    = 0;
200
   localparam C3_DQ3_TAP_DELAY_VAL    = 0;
201
   localparam C3_DQ4_TAP_DELAY_VAL    = 0;
202
   localparam C3_DQ5_TAP_DELAY_VAL    = 0;
203
   localparam C3_DQ6_TAP_DELAY_VAL    = 0;
204
   localparam C3_DQ7_TAP_DELAY_VAL    = 0;
205
   localparam C3_DQ8_TAP_DELAY_VAL    = 0;
206
   localparam C3_DQ9_TAP_DELAY_VAL    = 0;
207
   localparam C3_DQ10_TAP_DELAY_VAL   = 0;
208
   localparam C3_DQ11_TAP_DELAY_VAL   = 0;
209
   localparam C3_DQ12_TAP_DELAY_VAL   = 0;
210
   localparam C3_DQ13_TAP_DELAY_VAL   = 0;
211
   localparam C3_DQ14_TAP_DELAY_VAL   = 0;
212
   localparam C3_DQ15_TAP_DELAY_VAL   = 0;
213
   localparam C3_MCB_USE_EXTERNAL_BUFPLL  = 1;
214
   localparam C3_SMALL_DEVICE         = "FALSE";       // The parameter is set to TRUE for all packages of xc6slx9 device
215
                                                       // as most of them cannot fit the complete example design when the
216
                                                       // Chip scope modules are enabled
217
   localparam C3_INCLK_PERIOD         = ((C3_MEMCLK_PERIOD * C3_CLKFBOUT_MULT) / (C3_DIVCLK_DIVIDE * C3_CLKOUT0_DIVIDE * 2));
218
   localparam C3_p0_BEGIN_ADDRESS                   = (C3_HW_TESTING == "TRUE") ? 32'h01000000:32'h00000100;
219
   localparam C3_p0_DATA_MODE                       = 4'b0010;
220
   localparam C3_p0_END_ADDRESS                     = (C3_HW_TESTING == "TRUE") ? 32'h02ffffff:32'h000002ff;
221
   localparam C3_p0_PRBS_EADDR_MASK_POS             = (C3_HW_TESTING == "TRUE") ? 32'hfc000000:32'hfffffc00;
222
   localparam C3_p0_PRBS_SADDR_MASK_POS             = (C3_HW_TESTING == "TRUE") ? 32'h01000000:32'h00000100;
223
   localparam C3_p1_BEGIN_ADDRESS                   = (C3_HW_TESTING == "TRUE") ? 32'h03000000:32'h00000300;
224
   localparam C3_p1_DATA_MODE                       = 4'b0010;
225
   localparam C3_p1_END_ADDRESS                     = (C3_HW_TESTING == "TRUE") ? 32'h04ffffff:32'h000004ff;
226
   localparam C3_p1_PRBS_EADDR_MASK_POS             = (C3_HW_TESTING == "TRUE") ? 32'hf8000000:32'hfffff800;
227
   localparam C3_p1_PRBS_SADDR_MASK_POS             = (C3_HW_TESTING == "TRUE") ? 32'h03000000:32'h00000300;
228
   localparam C3_p2_BEGIN_ADDRESS                   = (C3_HW_TESTING == "TRUE") ? 32'h05000000:32'h00000500;
229
   localparam C3_p2_DATA_MODE                       = 4'b0010;
230
   localparam C3_p2_END_ADDRESS                     = (C3_HW_TESTING == "TRUE") ? 32'h06ffffff:32'h000006ff;
231
   localparam C3_p2_PRBS_EADDR_MASK_POS             = (C3_HW_TESTING == "TRUE") ? 32'hf8000000:32'hfffff800;
232
   localparam C3_p2_PRBS_SADDR_MASK_POS             = (C3_HW_TESTING == "TRUE") ? 32'h05000000:32'h00000500;
233
   localparam C3_p3_BEGIN_ADDRESS                   = (C3_HW_TESTING == "TRUE") ? 32'h01000000:32'h00000100;
234
   localparam C3_p3_DATA_MODE                       = 4'b0010;
235
   localparam C3_p3_END_ADDRESS                     = (C3_HW_TESTING == "TRUE") ? 32'h02ffffff:32'h000002ff;
236
   localparam C3_p3_PRBS_EADDR_MASK_POS             = (C3_HW_TESTING == "TRUE") ? 32'hfc000000:32'hfffffc00;
237
   localparam C3_p3_PRBS_SADDR_MASK_POS             = (C3_HW_TESTING == "TRUE") ? 32'h01000000:32'h00000100;
238
   localparam C3_p4_BEGIN_ADDRESS                   = (C3_HW_TESTING == "TRUE") ? 32'h07000000:32'h00000700;
239
   localparam C3_p4_DATA_MODE                       = 4'b0010;
240
   localparam C3_p4_END_ADDRESS                     = (C3_HW_TESTING == "TRUE") ? 32'h08ffffff:32'h000008ff;
241
   localparam C3_p4_PRBS_EADDR_MASK_POS             = (C3_HW_TESTING == "TRUE") ? 32'hf0000000:32'hfffff000;
242
   localparam C3_p4_PRBS_SADDR_MASK_POS             = (C3_HW_TESTING == "TRUE") ? 32'h07000000:32'h00000800;
243
   localparam C3_p5_BEGIN_ADDRESS                   = (C3_HW_TESTING == "TRUE") ? 32'h01000000:32'h00000100;
244
   localparam C3_p5_DATA_MODE                       = 4'b0010;
245
   localparam C3_p5_END_ADDRESS                     = (C3_HW_TESTING == "TRUE") ? 32'h02ffffff:32'h000002ff;
246
   localparam C3_p5_PRBS_EADDR_MASK_POS             = (C3_HW_TESTING == "TRUE") ? 32'hfc000000:32'hfffffc00;
247
   localparam C3_p5_PRBS_SADDR_MASK_POS             = (C3_HW_TESTING == "TRUE") ? 32'h01000000:32'h00000100;
248
   localparam DBG_WR_STS_WIDTH        = 32;
249
   localparam DBG_RD_STS_WIDTH        = 32;
250
   localparam C3_ARB_TIME0_SLOT  = {C3_ARB_TIME_SLOT_0[17:15], C3_ARB_TIME_SLOT_0[14:12], C3_ARB_TIME_SLOT_0[11:9], C3_ARB_TIME_SLOT_0[8:6], C3_ARB_TIME_SLOT_0[5:3], C3_ARB_TIME_SLOT_0[2:0]};
251
   localparam C3_ARB_TIME1_SLOT  = {C3_ARB_TIME_SLOT_1[17:15], C3_ARB_TIME_SLOT_1[14:12], C3_ARB_TIME_SLOT_1[11:9], C3_ARB_TIME_SLOT_1[8:6], C3_ARB_TIME_SLOT_1[5:3], C3_ARB_TIME_SLOT_1[2:0]};
252
   localparam C3_ARB_TIME2_SLOT  = {C3_ARB_TIME_SLOT_2[17:15], C3_ARB_TIME_SLOT_2[14:12], C3_ARB_TIME_SLOT_2[11:9], C3_ARB_TIME_SLOT_2[8:6], C3_ARB_TIME_SLOT_2[5:3], C3_ARB_TIME_SLOT_2[2:0]};
253
   localparam C3_ARB_TIME3_SLOT  = {C3_ARB_TIME_SLOT_3[17:15], C3_ARB_TIME_SLOT_3[14:12], C3_ARB_TIME_SLOT_3[11:9], C3_ARB_TIME_SLOT_3[8:6], C3_ARB_TIME_SLOT_3[5:3], C3_ARB_TIME_SLOT_3[2:0]};
254
   localparam C3_ARB_TIME4_SLOT  = {C3_ARB_TIME_SLOT_4[17:15], C3_ARB_TIME_SLOT_4[14:12], C3_ARB_TIME_SLOT_4[11:9], C3_ARB_TIME_SLOT_4[8:6], C3_ARB_TIME_SLOT_4[5:3], C3_ARB_TIME_SLOT_4[2:0]};
255
   localparam C3_ARB_TIME5_SLOT  = {C3_ARB_TIME_SLOT_5[17:15], C3_ARB_TIME_SLOT_5[14:12], C3_ARB_TIME_SLOT_5[11:9], C3_ARB_TIME_SLOT_5[8:6], C3_ARB_TIME_SLOT_5[5:3], C3_ARB_TIME_SLOT_5[2:0]};
256
   localparam C3_ARB_TIME6_SLOT  = {C3_ARB_TIME_SLOT_6[17:15], C3_ARB_TIME_SLOT_6[14:12], C3_ARB_TIME_SLOT_6[11:9], C3_ARB_TIME_SLOT_6[8:6], C3_ARB_TIME_SLOT_6[5:3], C3_ARB_TIME_SLOT_6[2:0]};
257
   localparam C3_ARB_TIME7_SLOT  = {C3_ARB_TIME_SLOT_7[17:15], C3_ARB_TIME_SLOT_7[14:12], C3_ARB_TIME_SLOT_7[11:9], C3_ARB_TIME_SLOT_7[8:6], C3_ARB_TIME_SLOT_7[5:3], C3_ARB_TIME_SLOT_7[2:0]};
258
   localparam C3_ARB_TIME8_SLOT  = {C3_ARB_TIME_SLOT_8[17:15], C3_ARB_TIME_SLOT_8[14:12], C3_ARB_TIME_SLOT_8[11:9], C3_ARB_TIME_SLOT_8[8:6], C3_ARB_TIME_SLOT_8[5:3], C3_ARB_TIME_SLOT_8[2:0]};
259
   localparam C3_ARB_TIME9_SLOT  = {C3_ARB_TIME_SLOT_9[17:15], C3_ARB_TIME_SLOT_9[14:12], C3_ARB_TIME_SLOT_9[11:9], C3_ARB_TIME_SLOT_9[8:6], C3_ARB_TIME_SLOT_9[5:3], C3_ARB_TIME_SLOT_9[2:0]};
260
   localparam C3_ARB_TIME10_SLOT  = {C3_ARB_TIME_SLOT_10[17:15], C3_ARB_TIME_SLOT_10[14:12], C3_ARB_TIME_SLOT_10[11:9], C3_ARB_TIME_SLOT_10[8:6], C3_ARB_TIME_SLOT_10[5:3], C3_ARB_TIME_SLOT_10[2:0]};
261
   localparam C3_ARB_TIME11_SLOT  = {C3_ARB_TIME_SLOT_11[17:15], C3_ARB_TIME_SLOT_11[14:12], C3_ARB_TIME_SLOT_11[11:9], C3_ARB_TIME_SLOT_11[8:6], C3_ARB_TIME_SLOT_11[5:3], C3_ARB_TIME_SLOT_11[2:0]};
262
 
263
  wire                              c3_sys_clk_p;
264
  wire                              c3_sys_clk_n;
265
  wire                              c3_error;
266
  wire                              c3_calib_done;
267
  wire                              c3_clk0;
268
  wire                              c3_rst0;
269
  wire                              c3_async_rst;
270
  wire                              c3_sysclk_2x;
271
  wire                              c3_sysclk_2x_180;
272
  wire                              c3_pll_ce_0;
273
  wire                              c3_pll_ce_90;
274
  wire                              c3_pll_lock;
275
  wire                              c3_mcb_drp_clk;
276
  wire                              c3_cmp_error;
277
  wire                              c3_cmp_data_valid;
278
  wire                              c3_vio_modify_enable;
279
  wire  [127:0]                                 c3_p0_error_status;
280
  wire  [127:0]                                 c3_p1_error_status;
281
  wire  [127:0]                                 c3_p2_error_status;
282
  wire  [127:0]                                 c3_p3_error_status;
283
  wire  [127:0]                                 c3_p4_error_status;
284
  wire  [127:0]                                 c3_p5_error_status;
285
  wire  [2:0]                       c3_vio_data_mode_value;
286
  wire  [2:0]                       c3_vio_addr_mode_value;
287
  wire  [31:0]                       c3_cmp_data;
288
wire                            c3_p0_cmd_clk;
289
wire                            c3_p0_cmd_en;
290
wire[2:0]                        c3_p0_cmd_instr;
291
wire[5:0]                        c3_p0_cmd_bl;
292
wire[29:0]                       c3_p0_cmd_byte_addr;
293
wire                            c3_p0_cmd_empty;
294
wire                            c3_p0_cmd_full;
295
 
296
wire                            c3_p0_wr_clk;
297
wire                            c3_p0_wr_en;
298
wire[C3_P0_MASK_SIZE-1:0]        c3_p0_wr_mask;
299
wire[C3_P0_DATA_PORT_SIZE-1:0]   c3_p0_wr_data;
300
wire                            c3_p0_wr_full;
301
wire                            c3_p0_wr_empty;
302
wire[6:0]                        c3_p0_wr_count;
303
wire                            c3_p0_wr_underrun;
304
wire                            c3_p0_wr_error;
305
 
306
wire                            c3_p0_rd_clk;
307
wire                            c3_p0_rd_en;
308
wire[C3_P0_DATA_PORT_SIZE-1:0]   c3_p0_rd_data;
309
wire                            c3_p0_rd_full;
310
wire                            c3_p0_rd_empty;
311
wire[6:0]                        c3_p0_rd_count;
312
wire                            c3_p0_rd_overflow;
313
wire                            c3_p0_rd_error;
314
 
315
wire                            c3_p1_cmd_clk;
316
wire                            c3_p1_cmd_en;
317
wire[2:0]                        c3_p1_cmd_instr;
318
wire[5:0]                        c3_p1_cmd_bl;
319
wire[29:0]                       c3_p1_cmd_byte_addr;
320
wire                            c3_p1_cmd_empty;
321
wire                            c3_p1_cmd_full;
322
 
323
wire                            c3_p1_wr_clk;
324
wire                            c3_p1_wr_en;
325
wire[C3_P1_MASK_SIZE-1:0]        c3_p1_wr_mask;
326
wire[C3_P1_DATA_PORT_SIZE-1:0]   c3_p1_wr_data;
327
wire                            c3_p1_wr_full;
328
wire                            c3_p1_wr_empty;
329
wire[6:0]                        c3_p1_wr_count;
330
wire                            c3_p1_wr_underrun;
331
wire                            c3_p1_wr_error;
332
 
333
wire                            c3_p1_rd_clk;
334
wire                            c3_p1_rd_en;
335
wire[C3_P1_DATA_PORT_SIZE-1:0]   c3_p1_rd_data;
336
wire                            c3_p1_rd_full;
337
wire                            c3_p1_rd_empty;
338
wire[6:0]                        c3_p1_rd_count;
339
wire                            c3_p1_rd_overflow;
340
wire                            c3_p1_rd_error;
341
 
342
wire                            c3_p2_cmd_clk;
343
wire                            c3_p2_cmd_en;
344
wire[2:0]                        c3_p2_cmd_instr;
345
wire[5:0]                        c3_p2_cmd_bl;
346
wire[29:0]                       c3_p2_cmd_byte_addr;
347
wire                            c3_p2_cmd_empty;
348
wire                            c3_p2_cmd_full;
349
 
350
wire                            c3_p2_wr_clk;
351
wire                            c3_p2_wr_en;
352
wire[3:0]                        c3_p2_wr_mask;
353
wire[31:0]                       c3_p2_wr_data;
354
wire                            c3_p2_wr_full;
355
wire                            c3_p2_wr_empty;
356
wire[6:0]                        c3_p2_wr_count;
357
wire                            c3_p2_wr_underrun;
358
wire                            c3_p2_wr_error;
359
 
360
wire                            c3_p2_rd_clk;
361
wire                            c3_p2_rd_en;
362
wire[31:0]                       c3_p2_rd_data;
363
wire                            c3_p2_rd_full;
364
wire                            c3_p2_rd_empty;
365
wire[6:0]                        c3_p2_rd_count;
366
wire                            c3_p2_rd_overflow;
367
wire                            c3_p2_rd_error;
368
 
369
wire                            c3_p3_cmd_clk;
370
wire                            c3_p3_cmd_en;
371
wire[2:0]                        c3_p3_cmd_instr;
372
wire[5:0]                        c3_p3_cmd_bl;
373
wire[29:0]                       c3_p3_cmd_byte_addr;
374
wire                            c3_p3_cmd_empty;
375
wire                            c3_p3_cmd_full;
376
 
377
wire                            c3_p3_wr_clk;
378
wire                            c3_p3_wr_en;
379
wire[3:0]                        c3_p3_wr_mask;
380
wire[31:0]                       c3_p3_wr_data;
381
wire                            c3_p3_wr_full;
382
wire                            c3_p3_wr_empty;
383
wire[6:0]                        c3_p3_wr_count;
384
wire                            c3_p3_wr_underrun;
385
wire                            c3_p3_wr_error;
386
 
387
wire                            c3_p3_rd_clk;
388
wire                            c3_p3_rd_en;
389
wire[31:0]                       c3_p3_rd_data;
390
wire                            c3_p3_rd_full;
391
wire                            c3_p3_rd_empty;
392
wire[6:0]                        c3_p3_rd_count;
393
wire                            c3_p3_rd_overflow;
394
wire                            c3_p3_rd_error;
395
 
396
wire                            c3_p4_cmd_clk;
397
wire                            c3_p4_cmd_en;
398
wire[2:0]                        c3_p4_cmd_instr;
399
wire[5:0]                        c3_p4_cmd_bl;
400
wire[29:0]                       c3_p4_cmd_byte_addr;
401
wire                            c3_p4_cmd_empty;
402
wire                            c3_p4_cmd_full;
403
 
404
wire                            c3_p4_wr_clk;
405
wire                            c3_p4_wr_en;
406
wire[3:0]                        c3_p4_wr_mask;
407
wire[31:0]                       c3_p4_wr_data;
408
wire                            c3_p4_wr_full;
409
wire                            c3_p4_wr_empty;
410
wire[6:0]                        c3_p4_wr_count;
411
wire                            c3_p4_wr_underrun;
412
wire                            c3_p4_wr_error;
413
 
414
wire                            c3_p4_rd_clk;
415
wire                            c3_p4_rd_en;
416
wire[31:0]                       c3_p4_rd_data;
417
wire                            c3_p4_rd_full;
418
wire                            c3_p4_rd_empty;
419
wire[6:0]                        c3_p4_rd_count;
420
wire                            c3_p4_rd_overflow;
421
wire                            c3_p4_rd_error;
422
 
423
wire                            c3_p5_cmd_clk;
424
wire                            c3_p5_cmd_en;
425
wire[2:0]                        c3_p5_cmd_instr;
426
wire[5:0]                        c3_p5_cmd_bl;
427
wire[29:0]                       c3_p5_cmd_byte_addr;
428
wire                            c3_p5_cmd_empty;
429
wire                            c3_p5_cmd_full;
430
 
431
wire                            c3_p5_wr_clk;
432
wire                            c3_p5_wr_en;
433
wire[3:0]                        c3_p5_wr_mask;
434
wire[31:0]                       c3_p5_wr_data;
435
wire                            c3_p5_wr_full;
436
wire                            c3_p5_wr_empty;
437
wire[6:0]                        c3_p5_wr_count;
438
wire                            c3_p5_wr_underrun;
439
wire                            c3_p5_wr_error;
440
 
441
wire                            c3_p5_rd_clk;
442
wire                            c3_p5_rd_en;
443
wire[31:0]                       c3_p5_rd_data;
444
wire                            c3_p5_rd_full;
445
wire                            c3_p5_rd_empty;
446
wire[6:0]                        c3_p5_rd_count;
447
wire                            c3_p5_rd_overflow;
448
wire                            c3_p5_rd_error;
449
 
450
 
451
 
452
 
453
   reg   c1_aresetn;
454
   reg   c3_aresetn;
455
   reg   c4_aresetn;
456
   reg   c5_aresetn;
457
 
458
assign error = c3_error;
459
assign calib_done = c3_calib_done;
460
assign  c3_sys_clk_p = 1'b0;
461
assign  c3_sys_clk_n = 1'b0;
462
 
463
 
464
 
465
 
466
// Infrastructure-3 instantiation
467
      infrastructure #
468
      (
469
         .C_INCLK_PERIOD                 (C3_INCLK_PERIOD),
470
         .C_RST_ACT_LOW                  (C3_RST_ACT_LOW),
471
         .C_INPUT_CLK_TYPE               (C3_INPUT_CLK_TYPE),
472
         .C_CLKOUT0_DIVIDE               (C3_CLKOUT0_DIVIDE),
473
         .C_CLKOUT1_DIVIDE               (C3_CLKOUT1_DIVIDE),
474
         .C_CLKOUT2_DIVIDE               (C3_CLKOUT2_DIVIDE),
475
         .C_CLKOUT3_DIVIDE               (C3_CLKOUT3_DIVIDE),
476
         .C_CLKFBOUT_MULT                (C3_CLKFBOUT_MULT),
477
         .C_DIVCLK_DIVIDE                (C3_DIVCLK_DIVIDE)
478
      )
479
      memc3_infrastructure_inst
480
      (
481
         .sys_clk_p                      (c3_sys_clk_p),  // [input] differential p type clock from board
482
         .sys_clk_n                      (c3_sys_clk_n),  // [input] differential n type clock from board
483
         .sys_clk                        (c3_sys_clk),    // [input] single ended input clock from board
484
         .sys_rst_i                      (c3_sys_rst_i),
485
         .clk0                           (c3_clk0),       // [output] user clock which determines the operating frequency of user interface ports
486
         .rst0                           (c3_rst0),
487
         .async_rst                      (c3_async_rst),
488
         .sysclk_2x                      (c3_sysclk_2x),
489
         .sysclk_2x_180                  (c3_sysclk_2x_180),
490
         .pll_ce_0                       (c3_pll_ce_0),
491
         .pll_ce_90                      (c3_pll_ce_90),
492
         .pll_lock                       (c3_pll_lock),
493
         .mcb_drp_clk                    (c3_mcb_drp_clk)
494
      );
495
 
496
 
497
 
498
// Controller-3 instantiation
499
      memc_wrapper #
500
      (
501
         .C_MEMCLK_PERIOD                (C3_MEMCLK_PERIOD),
502
         .C_CALIB_SOFT_IP                (C3_CALIB_SOFT_IP),
503
         //synthesis translate_off
504
         .C_SIMULATION                   (C3_SIMULATION),
505
         //synthesis translate_on
506
         .C_ARB_NUM_TIME_SLOTS           (C3_ARB_NUM_TIME_SLOTS),
507
         .C_ARB_TIME_SLOT_0              (C3_ARB_TIME0_SLOT),
508
         .C_ARB_TIME_SLOT_1              (C3_ARB_TIME1_SLOT),
509
         .C_ARB_TIME_SLOT_2              (C3_ARB_TIME2_SLOT),
510
         .C_ARB_TIME_SLOT_3              (C3_ARB_TIME3_SLOT),
511
         .C_ARB_TIME_SLOT_4              (C3_ARB_TIME4_SLOT),
512
         .C_ARB_TIME_SLOT_5              (C3_ARB_TIME5_SLOT),
513
         .C_ARB_TIME_SLOT_6              (C3_ARB_TIME6_SLOT),
514
         .C_ARB_TIME_SLOT_7              (C3_ARB_TIME7_SLOT),
515
         .C_ARB_TIME_SLOT_8              (C3_ARB_TIME8_SLOT),
516
         .C_ARB_TIME_SLOT_9              (C3_ARB_TIME9_SLOT),
517
         .C_ARB_TIME_SLOT_10             (C3_ARB_TIME10_SLOT),
518
         .C_ARB_TIME_SLOT_11             (C3_ARB_TIME11_SLOT),
519
         .C_ARB_ALGORITHM                (C3_ARB_ALGORITHM),
520
         .C_PORT_ENABLE                  (C3_PORT_ENABLE),
521
         .C_PORT_CONFIG                  (C3_PORT_CONFIG),
522
         .C_MEM_TRAS                     (C3_MEM_TRAS),
523
         .C_MEM_TRCD                     (C3_MEM_TRCD),
524
         .C_MEM_TREFI                    (C3_MEM_TREFI),
525
         .C_MEM_TRFC                     (C3_MEM_TRFC),
526
         .C_MEM_TRP                      (C3_MEM_TRP),
527
         .C_MEM_TWR                      (C3_MEM_TWR),
528
         .C_MEM_TRTP                     (C3_MEM_TRTP),
529
         .C_MEM_TWTR                     (C3_MEM_TWTR),
530
         .C_MEM_ADDR_ORDER               (C3_MEM_ADDR_ORDER),
531
         .C_NUM_DQ_PINS                  (C3_NUM_DQ_PINS),
532
         .C_MEM_TYPE                     (C3_MEM_TYPE),
533
         .C_MEM_DENSITY                  (C3_MEM_DENSITY),
534
         .C_MEM_BURST_LEN                (C3_MEM_BURST_LEN),
535
         .C_MEM_CAS_LATENCY              (C3_MEM_CAS_LATENCY),
536
         .C_MEM_ADDR_WIDTH               (C3_MEM_ADDR_WIDTH),
537
         .C_MEM_BANKADDR_WIDTH           (C3_MEM_BANKADDR_WIDTH),
538
         .C_MEM_NUM_COL_BITS             (C3_MEM_NUM_COL_BITS),
539
         .C_MEM_DDR1_2_ODS               (C3_MEM_DDR1_2_ODS),
540
         .C_MEM_DDR2_RTT                 (C3_MEM_DDR2_RTT),
541
         .C_MEM_DDR2_DIFF_DQS_EN         (C3_MEM_DDR2_DIFF_DQS_EN),
542
         .C_MEM_DDR2_3_PA_SR             (C3_MEM_DDR2_3_PA_SR),
543
         .C_MEM_DDR2_3_HIGH_TEMP_SR      (C3_MEM_DDR2_3_HIGH_TEMP_SR),
544
         .C_MEM_DDR3_CAS_LATENCY         (C3_MEM_DDR3_CAS_LATENCY),
545
         .C_MEM_DDR3_ODS                 (C3_MEM_DDR3_ODS),
546
         .C_MEM_DDR3_RTT                 (C3_MEM_DDR3_RTT),
547
         .C_MEM_DDR3_CAS_WR_LATENCY      (C3_MEM_DDR3_CAS_WR_LATENCY),
548
         .C_MEM_DDR3_AUTO_SR             (C3_MEM_DDR3_AUTO_SR),
549
         .C_MEM_MOBILE_PA_SR             (C3_MEM_MOBILE_PA_SR),
550
         .C_MEM_MDDR_ODS                 (C3_MEM_MDDR_ODS),
551
         .C_MC_CALIB_BYPASS              (C3_MC_CALIB_BYPASS),
552
         .C_MC_CALIBRATION_MODE          (C3_MC_CALIBRATION_MODE),
553
         .C_MC_CALIBRATION_DELAY         (C3_MC_CALIBRATION_DELAY),
554
         .C_SKIP_IN_TERM_CAL             (C3_SKIP_IN_TERM_CAL),
555
         .C_SKIP_DYNAMIC_CAL             (C3_SKIP_DYNAMIC_CAL),
556
         .LDQSP_TAP_DELAY_VAL            (C3_LDQSP_TAP_DELAY_VAL),
557
         .UDQSP_TAP_DELAY_VAL            (C3_UDQSP_TAP_DELAY_VAL),
558
         .LDQSN_TAP_DELAY_VAL            (C3_LDQSN_TAP_DELAY_VAL),
559
         .UDQSN_TAP_DELAY_VAL            (C3_UDQSN_TAP_DELAY_VAL),
560
         .DQ0_TAP_DELAY_VAL              (C3_DQ0_TAP_DELAY_VAL),
561
         .DQ1_TAP_DELAY_VAL              (C3_DQ1_TAP_DELAY_VAL),
562
         .DQ2_TAP_DELAY_VAL              (C3_DQ2_TAP_DELAY_VAL),
563
         .DQ3_TAP_DELAY_VAL              (C3_DQ3_TAP_DELAY_VAL),
564
         .DQ4_TAP_DELAY_VAL              (C3_DQ4_TAP_DELAY_VAL),
565
         .DQ5_TAP_DELAY_VAL              (C3_DQ5_TAP_DELAY_VAL),
566
         .DQ6_TAP_DELAY_VAL              (C3_DQ6_TAP_DELAY_VAL),
567
         .DQ7_TAP_DELAY_VAL              (C3_DQ7_TAP_DELAY_VAL),
568
         .DQ8_TAP_DELAY_VAL              (C3_DQ8_TAP_DELAY_VAL),
569
         .DQ9_TAP_DELAY_VAL              (C3_DQ9_TAP_DELAY_VAL),
570
         .DQ10_TAP_DELAY_VAL             (C3_DQ10_TAP_DELAY_VAL),
571
         .DQ11_TAP_DELAY_VAL             (C3_DQ11_TAP_DELAY_VAL),
572
         .DQ12_TAP_DELAY_VAL             (C3_DQ12_TAP_DELAY_VAL),
573
         .DQ13_TAP_DELAY_VAL             (C3_DQ13_TAP_DELAY_VAL),
574
         .DQ14_TAP_DELAY_VAL             (C3_DQ14_TAP_DELAY_VAL),
575
         .DQ15_TAP_DELAY_VAL             (C3_DQ15_TAP_DELAY_VAL),
576
         .C_P0_MASK_SIZE                 (C3_P0_MASK_SIZE),
577
         .C_P0_DATA_PORT_SIZE            (C3_P0_DATA_PORT_SIZE),
578
         .C_P1_MASK_SIZE                 (C3_P1_MASK_SIZE),
579
         .C_P1_DATA_PORT_SIZE            (C3_P1_DATA_PORT_SIZE)
580
        )
581
 
582
      memc3_wrapper_inst
583
      (
584
         .mcbx_dram_addr                 (mcb3_dram_a),
585
         .mcbx_dram_ba                   (mcb3_dram_ba),
586
         .mcbx_dram_ras_n                (mcb3_dram_ras_n),
587
         .mcbx_dram_cas_n                (mcb3_dram_cas_n),
588
         .mcbx_dram_we_n                 (mcb3_dram_we_n),
589
         .mcbx_dram_cke                  (mcb3_dram_cke),
590
         .mcbx_dram_clk                  (mcb3_dram_ck),
591
         .mcbx_dram_clk_n                (mcb3_dram_ck_n),
592
         .mcbx_dram_dq                   (mcb3_dram_dq),
593
         .mcbx_dram_dqs                  (mcb3_dram_dqs),
594
         .mcbx_dram_udqs                 (mcb3_dram_udqs),
595
         .mcbx_dram_udm                  (mcb3_dram_udm),
596
         .mcbx_dram_ldm                  (mcb3_dram_dm),
597
         .mcbx_dram_dqs_n                ( ),
598
         .mcbx_dram_udqs_n               ( ),
599
         .mcbx_dram_odt                  ( ),
600
         .mcbx_dram_ddr3_rst             ( ),
601
         .mcbx_rzq                       (mcb3_rzq),
602
         .mcbx_zio                       (mcb3_zio),
603
         .calib_done                     (c3_calib_done),
604
         .async_rst                      (c3_async_rst),
605
         .sysclk_2x                      (c3_sysclk_2x),
606
         .sysclk_2x_180                  (c3_sysclk_2x_180),
607
         .pll_ce_0                       (c3_pll_ce_0),
608
         .pll_ce_90                      (c3_pll_ce_90),
609
         .pll_lock                       (c3_pll_lock),
610
         .mcb_drp_clk                    (c3_mcb_drp_clk),
611
 
612
         // The following port map shows all the six logical user ports. However, all
613
         // of them may not be active in this design. A port should be enabled to 
614
         // validate its port map. If it is not,the complete port is going to float 
615
         // by getting disconnected from the lower level MCB modules. The port enable
616
         // information of a controller can be obtained from the corresponding local
617
         // parameter CX_PORT_ENABLE. In such a case, we can simply ignore its port map.
618
         // The following comments will explain when a port is going to be active.
619
         // Config-1: Two 32-bit bi-directional and four 32-bit unidirectional ports
620
         // Config-2: Four 32-bit bi-directional ports
621
         // Config-3: One 64-bit bi-directional and two 32-bit bi-directional ports
622
         // Config-4: Two 64-bit bi-directional ports
623
         // Config-5: One 128-bit bi-directional port
624
 
625
         // User Port-0 command interface will be active only when the port is enabled in 
626
         // the port configurations Config-1, Config-2, Config-3, Config-4 and Config-5
627
         .p0_cmd_clk                     (c3_clk0),
628
         .p0_cmd_en                      (c3_p0_cmd_en),
629
         .p0_cmd_instr                   (c3_p0_cmd_instr),
630
         .p0_cmd_bl                      (c3_p0_cmd_bl),
631
         .p0_cmd_byte_addr               (c3_p0_cmd_byte_addr),
632
         .p0_cmd_full                    (c3_p0_cmd_full),
633
         .p0_cmd_empty                   (c3_p0_cmd_empty),
634
         // User Port-0 data write interface will be active only when the port is enabled in
635
         // the port configurations Config-1, Config-2, Config-3, Config-4 and Config-5
636
         .p0_wr_clk                      (c3_clk0),
637
         .p0_wr_en                       (c3_p0_wr_en),
638
         .p0_wr_mask                     (c3_p0_wr_mask),
639
         .p0_wr_data                     (c3_p0_wr_data),
640
         .p0_wr_full                     (c3_p0_wr_full),
641
         .p0_wr_count                    (c3_p0_wr_count),
642
         .p0_wr_empty                    (c3_p0_wr_empty),
643
         .p0_wr_underrun                 (c3_p0_wr_underrun),
644
         .p0_wr_error                    (c3_p0_wr_error),
645
         // User Port-0 data read interface will be active only when the port is enabled in
646
         // the port configurations Config-1, Config-2, Config-3, Config-4 and Config-5
647
         .p0_rd_clk                      (c3_clk0),
648
         .p0_rd_en                       (c3_p0_rd_en),
649
         .p0_rd_data                     (c3_p0_rd_data),
650
         .p0_rd_empty                    (c3_p0_rd_empty),
651
         .p0_rd_count                    (c3_p0_rd_count),
652
         .p0_rd_full                     (c3_p0_rd_full),
653
         .p0_rd_overflow                 (c3_p0_rd_overflow),
654
         .p0_rd_error                    (c3_p0_rd_error),
655
 
656
         // User Port-1 command interface will be active only when the port is enabled in 
657
         // the port configurations Config-1, Config-2, Config-3 and Config-4
658
         .p1_cmd_clk                     (c3_clk0),
659
         .p1_cmd_en                      (c3_p1_cmd_en),
660
         .p1_cmd_instr                   (c3_p1_cmd_instr),
661
         .p1_cmd_bl                      (c3_p1_cmd_bl),
662
         .p1_cmd_byte_addr               (c3_p1_cmd_byte_addr),
663
         .p1_cmd_full                    (c3_p1_cmd_full),
664
         .p1_cmd_empty                   (c3_p1_cmd_empty),
665
         // User Port-1 data write interface will be active only when the port is enabled in 
666
         // the port configurations Config-1, Config-2, Config-3 and Config-4
667
         .p1_wr_clk                      (c3_clk0),
668
         .p1_wr_en                       (c3_p1_wr_en),
669
         .p1_wr_mask                     (c3_p1_wr_mask),
670
         .p1_wr_data                     (c3_p1_wr_data),
671
         .p1_wr_full                     (c3_p1_wr_full),
672
         .p1_wr_count                    (c3_p1_wr_count),
673
         .p1_wr_empty                    (c3_p1_wr_empty),
674
         .p1_wr_underrun                 (c3_p1_wr_underrun),
675
         .p1_wr_error                    (c3_p1_wr_error),
676
         // User Port-1 data read interface will be active only when the port is enabled in 
677
         // the port configurations Config-1, Config-2, Config-3 and Config-4
678
         .p1_rd_clk                      (c3_clk0),
679
         .p1_rd_en                       (c3_p1_rd_en),
680
         .p1_rd_data                     (c3_p1_rd_data),
681
         .p1_rd_empty                    (c3_p1_rd_empty),
682
         .p1_rd_count                    (c3_p1_rd_count),
683
         .p1_rd_full                     (c3_p1_rd_full),
684
         .p1_rd_overflow                 (c3_p1_rd_overflow),
685
         .p1_rd_error                    (c3_p1_rd_error),
686
 
687
         // User Port-2 command interface will be active only when the port is enabled in 
688
         // the port configurations Config-1, Config-2 and Config-3
689
         .p2_cmd_clk                     (c3_clk0),
690
         .p2_cmd_en                      (c3_p2_cmd_en),
691
         .p2_cmd_instr                   (c3_p2_cmd_instr),
692
         .p2_cmd_bl                      (c3_p2_cmd_bl),
693
         .p2_cmd_byte_addr               (c3_p2_cmd_byte_addr),
694
         .p2_cmd_full                    (c3_p2_cmd_full),
695
         .p2_cmd_empty                   (c3_p2_cmd_empty),
696
         // User Port-2 data write interface will be active only when the port is enabled in 
697
         // the port configurations Config-1 write direction, Config-2 and Config-3
698
         .p2_wr_clk                      (c3_clk0),
699
         .p2_wr_en                       (c3_p2_wr_en),
700
         .p2_wr_mask                     (c3_p2_wr_mask),
701
         .p2_wr_data                     (c3_p2_wr_data),
702
         .p2_wr_full                     (c3_p2_wr_full),
703
         .p2_wr_count                    (c3_p2_wr_count),
704
         .p2_wr_empty                    (c3_p2_wr_empty),
705
         .p2_wr_underrun                 (c3_p2_wr_underrun),
706
         .p2_wr_error                    (c3_p2_wr_error),
707
         // User Port-2 data read interface will be active only when the port is enabled in 
708
         // the port configurations Config-1 read direction, Config-2 and Config-3
709
         .p2_rd_clk                      (c3_clk0),
710
         .p2_rd_en                       (c3_p2_rd_en),
711
         .p2_rd_data                     (c3_p2_rd_data),
712
         .p2_rd_empty                    (c3_p2_rd_empty),
713
         .p2_rd_count                    (c3_p2_rd_count),
714
         .p2_rd_full                     (c3_p2_rd_full),
715
         .p2_rd_overflow                 (c3_p2_rd_overflow),
716
         .p2_rd_error                    (c3_p2_rd_error),
717
 
718
         // User Port-3 command interface will be active only when the port is enabled in 
719
         // the port configurations Config-1 and Config-2
720
         .p3_cmd_clk                     (c3_clk0),
721
         .p3_cmd_en                      (c3_p3_cmd_en),
722
         .p3_cmd_instr                   (c3_p3_cmd_instr),
723
         .p3_cmd_bl                      (c3_p3_cmd_bl),
724
         .p3_cmd_byte_addr               (c3_p3_cmd_byte_addr),
725
         .p3_cmd_full                    (c3_p3_cmd_full),
726
         .p3_cmd_empty                   (c3_p3_cmd_empty),
727
         // User Port-3 data write interface will be active only when the port is enabled in 
728
         // the port configurations Config-1 write direction and Config-2
729
         .p3_wr_clk                      (c3_clk0),
730
         .p3_wr_en                       (c3_p3_wr_en),
731
         .p3_wr_mask                     (c3_p3_wr_mask),
732
         .p3_wr_data                     (c3_p3_wr_data),
733
         .p3_wr_full                     (c3_p3_wr_full),
734
         .p3_wr_count                    (c3_p3_wr_count),
735
         .p3_wr_empty                    (c3_p3_wr_empty),
736
         .p3_wr_underrun                 (c3_p3_wr_underrun),
737
         .p3_wr_error                    (c3_p3_wr_error),
738
         // User Port-3 data read interface will be active only when the port is enabled in 
739
         // the port configurations Config-1 read direction and Config-2
740
         .p3_rd_clk                      (c3_clk0),
741
         .p3_rd_en                       (c3_p3_rd_en),
742
         .p3_rd_data                     (c3_p3_rd_data),
743
         .p3_rd_empty                    (c3_p3_rd_empty),
744
         .p3_rd_count                    (c3_p3_rd_count),
745
         .p3_rd_full                     (c3_p3_rd_full),
746
         .p3_rd_overflow                 (c3_p3_rd_overflow),
747
         .p3_rd_error                    (c3_p3_rd_error),
748
 
749
         // User Port-4 command interface will be active only when the port is enabled in 
750
         // the port configuration Config-1
751
         .p4_cmd_clk                     (c3_clk0),
752
         .p4_cmd_en                      (c3_p4_cmd_en),
753
         .p4_cmd_instr                   (c3_p4_cmd_instr),
754
         .p4_cmd_bl                      (c3_p4_cmd_bl),
755
         .p4_cmd_byte_addr               (c3_p4_cmd_byte_addr),
756
         .p4_cmd_full                    (c3_p4_cmd_full),
757
         .p4_cmd_empty                   (c3_p4_cmd_empty),
758
         // User Port-4 data write interface will be active only when the port is enabled in 
759
         // the port configuration Config-1 write direction
760
         .p4_wr_clk                      (c3_clk0),
761
         .p4_wr_en                       (c3_p4_wr_en),
762
         .p4_wr_mask                     (c3_p4_wr_mask),
763
         .p4_wr_data                     (c3_p4_wr_data),
764
         .p4_wr_full                     (c3_p4_wr_full),
765
         .p4_wr_count                    (c3_p4_wr_count),
766
         .p4_wr_empty                    (c3_p4_wr_empty),
767
         .p4_wr_underrun                 (c3_p4_wr_underrun),
768
         .p4_wr_error                    (c3_p4_wr_error),
769
         // User Port-4 data read interface will be active only when the port is enabled in 
770
         // the port configuration Config-1 read direction
771
         .p4_rd_clk                      (c3_clk0),
772
         .p4_rd_en                       (c3_p4_rd_en),
773
         .p4_rd_data                     (c3_p4_rd_data),
774
         .p4_rd_empty                    (c3_p4_rd_empty),
775
         .p4_rd_count                    (c3_p4_rd_count),
776
         .p4_rd_full                     (c3_p4_rd_full),
777
         .p4_rd_overflow                 (c3_p4_rd_overflow),
778
         .p4_rd_error                    (c3_p4_rd_error),
779
 
780
         // User Port-5 command interface will be active only when the port is enabled in 
781
         // the port configuration Config-1
782
         .p5_cmd_clk                     (c3_clk0),
783
         .p5_cmd_en                      (c3_p5_cmd_en),
784
         .p5_cmd_instr                   (c3_p5_cmd_instr),
785
         .p5_cmd_bl                      (c3_p5_cmd_bl),
786
         .p5_cmd_byte_addr               (c3_p5_cmd_byte_addr),
787
         .p5_cmd_full                    (c3_p5_cmd_full),
788
         .p5_cmd_empty                   (c3_p5_cmd_empty),
789
         // User Port-5 data write interface will be active only when the port is enabled in 
790
         // the port configuration Config-1 write direction
791
         .p5_wr_clk                      (c3_clk0),
792
         .p5_wr_en                       (c3_p5_wr_en),
793
         .p5_wr_mask                     (c3_p5_wr_mask),
794
         .p5_wr_data                     (c3_p5_wr_data),
795
         .p5_wr_full                     (c3_p5_wr_full),
796
         .p5_wr_count                    (c3_p5_wr_count),
797
         .p5_wr_empty                    (c3_p5_wr_empty),
798
         .p5_wr_underrun                 (c3_p5_wr_underrun),
799
         .p5_wr_error                    (c3_p5_wr_error),
800
         // User Port-5 data read interface will be active only when the port is enabled in 
801
         // the port configuration Config-1 read direction
802
         .p5_rd_clk                      (c3_clk0),
803
         .p5_rd_en                       (c3_p5_rd_en),
804
         .p5_rd_data                     (c3_p5_rd_data),
805
         .p5_rd_empty                    (c3_p5_rd_empty),
806
         .p5_rd_count                    (c3_p5_rd_count),
807
         .p5_rd_full                     (c3_p5_rd_full),
808
         .p5_rd_overflow                 (c3_p5_rd_overflow),
809
         .p5_rd_error                    (c3_p5_rd_error),
810
 
811
         .selfrefresh_enter              (1'b0),
812
         .selfrefresh_mode               (c3_selfrefresh_mode)
813
      );
814
 
815
// Test bench top for the controller-3
816
      memc_tb_top #
817
      (
818
         .C_SIMULATION                   (C3_SIMULATION),
819
         .C_NUM_DQ_PINS                  (C3_NUM_DQ_PINS),
820
         .C_MEM_BURST_LEN                (C3_MEM_BURST_LEN),
821
         .C_MEM_NUM_COL_BITS             (C3_MEM_NUM_COL_BITS),
822
         .C_SMALL_DEVICE                 (C3_SMALL_DEVICE),
823
 
824
         // The following parameters from C_PORT_ENABLE to C_P5_PORT_MODE are introduced
825
         // to handle the static instances of all the six traffic generators inside the
826
         // memc_tb_top module. 
827
         .C_PORT_ENABLE                  (C3_PORT_ENABLE),
828
         .C_P0_MASK_SIZE                 (C3_P0_MASK_SIZE),
829
         .C_P0_DATA_PORT_SIZE            (C3_P0_DATA_PORT_SIZE),
830
         .C_P1_MASK_SIZE                 (C3_P1_MASK_SIZE),
831
         .C_P1_DATA_PORT_SIZE            (C3_P1_DATA_PORT_SIZE),
832
         .C_P0_PORT_MODE                 (C3_P0_PORT_MODE),
833
         .C_P1_PORT_MODE                 (C3_P1_PORT_MODE),
834
         .C_P2_PORT_MODE                 (C3_P2_PORT_MODE),
835
         .C_P3_PORT_MODE                 (C3_P3_PORT_MODE),
836
         .C_P4_PORT_MODE                 (C3_P4_PORT_MODE),
837
         .C_P5_PORT_MODE                 (C3_P5_PORT_MODE),
838
 
839
         .C_p0_BEGIN_ADDRESS             (C3_p0_BEGIN_ADDRESS),
840
         .C_p0_DATA_MODE                 (C3_p0_DATA_MODE),
841
         .C_p0_END_ADDRESS               (C3_p0_END_ADDRESS),
842
         .C_p0_PRBS_EADDR_MASK_POS       (C3_p0_PRBS_EADDR_MASK_POS),
843
         .C_p0_PRBS_SADDR_MASK_POS       (C3_p0_PRBS_SADDR_MASK_POS),
844
         .C_p1_BEGIN_ADDRESS             (C3_p1_BEGIN_ADDRESS),
845
         .C_p1_DATA_MODE                 (C3_p1_DATA_MODE),
846
         .C_p1_END_ADDRESS               (C3_p1_END_ADDRESS),
847
         .C_p1_PRBS_EADDR_MASK_POS       (C3_p1_PRBS_EADDR_MASK_POS),
848
         .C_p1_PRBS_SADDR_MASK_POS       (C3_p1_PRBS_SADDR_MASK_POS),
849
         .C_p2_BEGIN_ADDRESS             (C3_p2_BEGIN_ADDRESS),
850
         .C_p2_DATA_MODE                 (C3_p2_DATA_MODE),
851
         .C_p2_END_ADDRESS               (C3_p2_END_ADDRESS),
852
         .C_p2_PRBS_EADDR_MASK_POS       (C3_p2_PRBS_EADDR_MASK_POS),
853
         .C_p2_PRBS_SADDR_MASK_POS       (C3_p2_PRBS_SADDR_MASK_POS),
854
         .C_p3_BEGIN_ADDRESS             (C3_p3_BEGIN_ADDRESS),
855
         .C_p3_DATA_MODE                 (C3_p3_DATA_MODE),
856
         .C_p3_END_ADDRESS               (C3_p3_END_ADDRESS),
857
         .C_p3_PRBS_EADDR_MASK_POS       (C3_p3_PRBS_EADDR_MASK_POS),
858
         .C_p3_PRBS_SADDR_MASK_POS       (C3_p3_PRBS_SADDR_MASK_POS),
859
         .C_p4_BEGIN_ADDRESS             (C3_p4_BEGIN_ADDRESS),
860
         .C_p4_DATA_MODE                 (C3_p4_DATA_MODE),
861
         .C_p4_END_ADDRESS               (C3_p4_END_ADDRESS),
862
         .C_p4_PRBS_EADDR_MASK_POS       (C3_p4_PRBS_EADDR_MASK_POS),
863
         .C_p4_PRBS_SADDR_MASK_POS       (C3_p4_PRBS_SADDR_MASK_POS),
864
         .C_p5_BEGIN_ADDRESS             (C3_p5_BEGIN_ADDRESS),
865
         .C_p5_DATA_MODE                 (C3_p5_DATA_MODE),
866
         .C_p5_END_ADDRESS               (C3_p5_END_ADDRESS),
867
         .C_p5_PRBS_EADDR_MASK_POS       (C3_p5_PRBS_EADDR_MASK_POS),
868
         .C_p5_PRBS_SADDR_MASK_POS       (C3_p5_PRBS_SADDR_MASK_POS)
869
         )
870
      memc3_tb_top_inst
871
      (
872
         .error                                  (c3_error),
873
         .calib_done                             (c3_calib_done),
874
         .clk0                                   (c3_clk0),
875
         .rst0                                   (c3_rst0),
876
         .cmp_error                                  (c3_cmp_error),
877
         .cmp_data_valid                     (c3_cmp_data_valid),
878
         .cmp_data                                   (c3_cmp_data),
879
         .vio_modify_enable              (c3_vio_modify_enable),
880
         .vio_data_mode_value            (c3_vio_data_mode_value),
881
         .vio_addr_mode_value            (c3_vio_addr_mode_value),
882
         .p0_error_status                    (c3_p0_error_status),
883
         .p1_error_status                    (c3_p1_error_status),
884
         .p2_error_status                    (c3_p2_error_status),
885
         .p3_error_status                    (c3_p3_error_status),
886
         .p4_error_status                    (c3_p4_error_status),
887
         .p5_error_status                    (c3_p5_error_status),
888
 
889
         // The following port map shows that all the memory controller ports are connected
890
         // to the test bench top. However, a traffic generator can be connected to the 
891
         // corresponding port only if the port is enabled, whose information can be obtained
892
         // from the parameters C_PORT_ENABLE. 
893
 
894
         // User Port-0 command interface will be active only when the port is enabled in 
895
         // the port configurations Config-1, Config-2, Config-3, Config-4 and Config-5
896
         .p0_mcb_cmd_en                  (c3_p0_cmd_en),
897
         .p0_mcb_cmd_instr               (c3_p0_cmd_instr),
898
         .p0_mcb_cmd_bl                  (c3_p0_cmd_bl),
899
         .p0_mcb_cmd_addr                (c3_p0_cmd_byte_addr),
900
         .p0_mcb_cmd_full                (c3_p0_cmd_full),
901
         // User Port-0 data write interface will be active only when the port is enabled in
902
         // the port configurations Config-1, Config-2, Config-3, Config-4 and Config-5
903
         .p0_mcb_wr_en                   (c3_p0_wr_en),
904
         .p0_mcb_wr_mask                 (c3_p0_wr_mask),
905
         .p0_mcb_wr_data                 (c3_p0_wr_data),
906
         .p0_mcb_wr_full                 (c3_p0_wr_full),
907
         .p0_mcb_wr_fifo_counts          (c3_p0_wr_count),
908
         // User Port-0 data read interface will be active only when the port is enabled in
909
         // the port configurations Config-1, Config-2, Config-3, Config-4 and Config-5
910
         .p0_mcb_rd_en                   (c3_p0_rd_en),
911
         .p0_mcb_rd_data                 (c3_p0_rd_data),
912
         .p0_mcb_rd_empty                (c3_p0_rd_empty),
913
         .p0_mcb_rd_fifo_counts          (c3_p0_rd_count),
914
 
915
         // User Port-1 command interface will be active only when the port is enabled in 
916
         // the port configurations Config-1, Config-2, Config-3 and Config-4
917
         .p1_mcb_cmd_en                  (c3_p1_cmd_en),
918
         .p1_mcb_cmd_instr               (c3_p1_cmd_instr),
919
         .p1_mcb_cmd_bl                  (c3_p1_cmd_bl),
920
         .p1_mcb_cmd_addr                (c3_p1_cmd_byte_addr),
921
         .p1_mcb_cmd_full                (c3_p1_cmd_full),
922
         // User Port-1 data write interface will be active only when the port is enabled in 
923
         // the port configurations Config-1, Config-2, Config-3 and Config-4
924
         .p1_mcb_wr_en                   (c3_p1_wr_en),
925
         .p1_mcb_wr_mask                 (c3_p1_wr_mask),
926
         .p1_mcb_wr_data                 (c3_p1_wr_data),
927
         .p1_mcb_wr_full                 (c3_p1_wr_full),
928
         .p1_mcb_wr_fifo_counts          (c3_p1_wr_count),
929
         // User Port-1 data read interface will be active only when the port is enabled in 
930
         // the port configurations Config-1, Config-2, Config-3 and Config-4
931
         .p1_mcb_rd_en                   (c3_p1_rd_en),
932
         .p1_mcb_rd_data                 (c3_p1_rd_data),
933
         .p1_mcb_rd_empty                (c3_p1_rd_empty),
934
         .p1_mcb_rd_fifo_counts          (c3_p1_rd_count),
935
 
936
         // User Port-2 command interface will be active only when the port is enabled in 
937
         // the port configurations Config-1, Config-2 and Config-3
938
         .p2_mcb_cmd_en                  (c3_p2_cmd_en),
939
         .p2_mcb_cmd_instr               (c3_p2_cmd_instr),
940
         .p2_mcb_cmd_bl                  (c3_p2_cmd_bl),
941
         .p2_mcb_cmd_addr                (c3_p2_cmd_byte_addr),
942
         .p2_mcb_cmd_full                (c3_p2_cmd_full),
943
         // User Port-2 data write interface will be active only when the port is enabled in 
944
         // the port configurations Config-1 write direction, Config-2 and Config-3
945
         .p2_mcb_wr_en                   (c3_p2_wr_en),
946
         .p2_mcb_wr_mask                 (c3_p2_wr_mask),
947
         .p2_mcb_wr_data                 (c3_p2_wr_data),
948
         .p2_mcb_wr_full                 (c3_p2_wr_full),
949
         .p2_mcb_wr_fifo_counts          (c3_p2_wr_count),
950
         // User Port-2 data read interface will be active only when the port is enabled in 
951
         // the port configurations Config-1 read direction, Config-2 and Config-3
952
         .p2_mcb_rd_en                   (c3_p2_rd_en),
953
         .p2_mcb_rd_data                 (c3_p2_rd_data),
954
         .p2_mcb_rd_empty                (c3_p2_rd_empty),
955
         .p2_mcb_rd_fifo_counts          (c3_p2_rd_count),
956
 
957
         // User Port-3 command interface will be active only when the port is enabled in 
958
         // the port configurations Config-1 and Config-2
959
         .p3_mcb_cmd_en                  (c3_p3_cmd_en),
960
         .p3_mcb_cmd_instr               (c3_p3_cmd_instr),
961
         .p3_mcb_cmd_bl                  (c3_p3_cmd_bl),
962
         .p3_mcb_cmd_addr                (c3_p3_cmd_byte_addr),
963
         .p3_mcb_cmd_full                (c3_p3_cmd_full),
964
         // User Port-3 data write interface will be active only when the port is enabled in 
965
         // the port configurations Config-1 write direction and Config-2
966
         .p3_mcb_wr_en                   (c3_p3_wr_en),
967
         .p3_mcb_wr_mask                 (c3_p3_wr_mask),
968
         .p3_mcb_wr_data                 (c3_p3_wr_data),
969
         .p3_mcb_wr_full                 (c3_p3_wr_full),
970
         .p3_mcb_wr_fifo_counts          (c3_p3_wr_count),
971
         // User Port-3 data read interface will be active only when the port is enabled in 
972
         // the port configurations Config-1 read direction and Config-2
973
         .p3_mcb_rd_en                   (c3_p3_rd_en),
974
         .p3_mcb_rd_data                 (c3_p3_rd_data),
975
         .p3_mcb_rd_empty                (c3_p3_rd_empty),
976
         .p3_mcb_rd_fifo_counts          (c3_p3_rd_count),
977
 
978
         // User Port-4 command interface will be active only when the port is enabled in 
979
         // the port configuration Config-1
980
         .p4_mcb_cmd_en                  (c3_p4_cmd_en),
981
         .p4_mcb_cmd_instr               (c3_p4_cmd_instr),
982
         .p4_mcb_cmd_bl                  (c3_p4_cmd_bl),
983
         .p4_mcb_cmd_addr                (c3_p4_cmd_byte_addr),
984
         .p4_mcb_cmd_full                (c3_p4_cmd_full),
985
         // User Port-4 data write interface will be active only when the port is enabled in 
986
         // the port configuration Config-1 write direction
987
         .p4_mcb_wr_en                   (c3_p4_wr_en),
988
         .p4_mcb_wr_mask                 (c3_p4_wr_mask),
989
         .p4_mcb_wr_data                 (c3_p4_wr_data),
990
         .p4_mcb_wr_full                 (c3_p4_wr_full),
991
         .p4_mcb_wr_fifo_counts          (c3_p4_wr_count),
992
         // User Port-4 data read interface will be active only when the port is enabled in 
993
         // the port configuration Config-1 read direction
994
         .p4_mcb_rd_en                   (c3_p4_rd_en),
995
         .p4_mcb_rd_data                 (c3_p4_rd_data),
996
         .p4_mcb_rd_empty                (c3_p4_rd_empty),
997
         .p4_mcb_rd_fifo_counts          (c3_p4_rd_count),
998
 
999
         // User Port-5 command interface will be active only when the port is enabled in 
1000
         // the port configuration Config-1
1001
         .p5_mcb_cmd_en                  (c3_p5_cmd_en),
1002
         .p5_mcb_cmd_instr               (c3_p5_cmd_instr),
1003
         .p5_mcb_cmd_bl                  (c3_p5_cmd_bl),
1004
         .p5_mcb_cmd_addr                (c3_p5_cmd_byte_addr),
1005
         .p5_mcb_cmd_full                (c3_p5_cmd_full),
1006
         // User Port-5 data write interface will be active only when the port is enabled in 
1007
         // the port configuration Config-1 write direction
1008
         .p5_mcb_wr_en                   (c3_p5_wr_en),
1009
         .p5_mcb_wr_mask                 (c3_p5_wr_mask),
1010
         .p5_mcb_wr_data                 (c3_p5_wr_data),
1011
         .p5_mcb_wr_full                 (c3_p5_wr_full),
1012
         .p5_mcb_wr_fifo_counts          (c3_p5_wr_count),
1013
         // User Port-5 data read interface will be active only when the port is enabled in 
1014
         // the port configuration Config-1 read direction
1015
         .p5_mcb_rd_en                   (c3_p5_rd_en),
1016
         .p5_mcb_rd_data                 (c3_p5_rd_data),
1017
         .p5_mcb_rd_empty                (c3_p5_rd_empty),
1018
         .p5_mcb_rd_fifo_counts          (c3_p5_rd_count)
1019
        );
1020
 
1021
 
1022
 
1023
 
1024
 
1025
 
1026
endmodule
1027
 
1028
 

powered by: WebSVN 2.1.0

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