| 1 |
412 |
julius |
//*****************************************************************************
|
| 2 |
|
|
// DISCLAIMER OF LIABILITY
|
| 3 |
|
|
//
|
| 4 |
|
|
// This file contains proprietary and confidential information of
|
| 5 |
|
|
// Xilinx, Inc. ("Xilinx"), that is distributed under a license
|
| 6 |
|
|
// from Xilinx, and may be used, copied and/or disclosed only
|
| 7 |
|
|
// pursuant to the terms of a valid license agreement with Xilinx.
|
| 8 |
|
|
//
|
| 9 |
|
|
// XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION
|
| 10 |
|
|
// ("MATERIALS") "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
| 11 |
|
|
// EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING WITHOUT
|
| 12 |
|
|
// LIMITATION, ANY WARRANTY WITH RESPECT TO NONINFRINGEMENT,
|
| 13 |
|
|
// MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. Xilinx
|
| 14 |
|
|
// does not warrant that functions included in the Materials will
|
| 15 |
|
|
// meet the requirements of Licensee, or that the operation of the
|
| 16 |
|
|
// Materials will be uninterrupted or error-free, or that defects
|
| 17 |
|
|
// in the Materials will be corrected. Furthermore, Xilinx does
|
| 18 |
|
|
// not warrant or make any representations regarding use, or the
|
| 19 |
|
|
// results of the use, of the Materials in terms of correctness,
|
| 20 |
|
|
// accuracy, reliability or otherwise.
|
| 21 |
|
|
//
|
| 22 |
|
|
// Xilinx products are not designed or intended to be fail-safe,
|
| 23 |
|
|
// or for use in any application requiring fail-safe performance,
|
| 24 |
|
|
// such as life-support or safety devices or systems, Class III
|
| 25 |
|
|
// medical devices, nuclear facilities, applications related to
|
| 26 |
|
|
// the deployment of airbags, or any other applications that could
|
| 27 |
|
|
// lead to death, personal injury or severe property or
|
| 28 |
|
|
// environmental damage (individually and collectively, "critical
|
| 29 |
|
|
// applications"). Customer assumes the sole risk and liability
|
| 30 |
|
|
// of any use of Xilinx products in critical applications,
|
| 31 |
|
|
// subject only to applicable laws and regulations governing
|
| 32 |
|
|
// limitations on product liability.
|
| 33 |
|
|
//
|
| 34 |
|
|
// Copyright 2006, 2007 Xilinx, Inc.
|
| 35 |
|
|
// All rights reserved.
|
| 36 |
|
|
//
|
| 37 |
|
|
// This disclaimer and copyright notice must be retained as part
|
| 38 |
|
|
// of this file at all times.
|
| 39 |
|
|
//*****************************************************************************
|
| 40 |
|
|
// ____ ____
|
| 41 |
|
|
// / /\/ /
|
| 42 |
|
|
// /___/ \ / Vendor: Xilinx
|
| 43 |
|
|
// \ \ \/ Version: 3.0
|
| 44 |
|
|
// \ \ Application: MIG
|
| 45 |
|
|
// / / Filename: ddr2_usr_top.v
|
| 46 |
|
|
// /___/ /\ Date Last Modified: $Date: 2008/12/23 14:26:01 $
|
| 47 |
|
|
// \ \ / \ Date Created: Mon Aug 28 2006
|
| 48 |
|
|
// \___\/\___\
|
| 49 |
|
|
//
|
| 50 |
|
|
//Device: Virtex-5
|
| 51 |
|
|
//Design Name: DDR2
|
| 52 |
|
|
//Purpose:
|
| 53 |
|
|
// This module interfaces with the user. The user should provide the data
|
| 54 |
|
|
// and various commands.
|
| 55 |
|
|
//Reference:
|
| 56 |
|
|
//Revision History:
|
| 57 |
|
|
//*****************************************************************************
|
| 58 |
|
|
|
| 59 |
|
|
`timescale 1ns/1ps
|
| 60 |
|
|
|
| 61 |
|
|
module ddr2_usr_top #
|
| 62 |
|
|
(
|
| 63 |
|
|
// Following parameters are for 72-bit RDIMM design (for ML561 Reference
|
| 64 |
|
|
// board design). Actual values may be different. Actual parameters values
|
| 65 |
|
|
// are passed from design top module ddr2_mig module. Please refer to
|
| 66 |
|
|
// the ddr2_mig module for actual values.
|
| 67 |
|
|
parameter BANK_WIDTH = 2,
|
| 68 |
|
|
parameter CS_BITS = 0,
|
| 69 |
|
|
parameter COL_WIDTH = 10,
|
| 70 |
|
|
parameter DQ_WIDTH = 72,
|
| 71 |
|
|
parameter DQ_PER_DQS = 8,
|
| 72 |
|
|
parameter APPDATA_WIDTH = 144,
|
| 73 |
|
|
parameter ECC_ENABLE = 0,
|
| 74 |
|
|
parameter DQS_WIDTH = 9,
|
| 75 |
|
|
parameter ROW_WIDTH = 14
|
| 76 |
|
|
)
|
| 77 |
|
|
(
|
| 78 |
|
|
input clk0,
|
| 79 |
|
|
input usr_clk, //jb
|
| 80 |
|
|
input clk90,
|
| 81 |
|
|
input rst0,
|
| 82 |
|
|
input [DQ_WIDTH-1:0] rd_data_in_rise,
|
| 83 |
|
|
input [DQ_WIDTH-1:0] rd_data_in_fall,
|
| 84 |
|
|
input [DQS_WIDTH-1:0] phy_calib_rden,
|
| 85 |
|
|
input [DQS_WIDTH-1:0] phy_calib_rden_sel,
|
| 86 |
|
|
output rd_data_valid,
|
| 87 |
|
|
output [APPDATA_WIDTH-1:0] rd_data_fifo_out,
|
| 88 |
|
|
input [2:0] app_af_cmd,
|
| 89 |
|
|
input [30:0] app_af_addr,
|
| 90 |
|
|
input app_af_wren,
|
| 91 |
|
|
input ctrl_af_rden,
|
| 92 |
|
|
output [2:0] af_cmd,
|
| 93 |
|
|
output [30:0] af_addr,
|
| 94 |
|
|
output af_empty,
|
| 95 |
|
|
output app_af_afull,
|
| 96 |
|
|
output [1:0] rd_ecc_error,
|
| 97 |
|
|
input app_wdf_wren,
|
| 98 |
|
|
input [APPDATA_WIDTH-1:0] app_wdf_data,
|
| 99 |
|
|
input [(APPDATA_WIDTH/8)-1:0] app_wdf_mask_data,
|
| 100 |
|
|
input wdf_rden,
|
| 101 |
|
|
output app_wdf_afull,
|
| 102 |
|
|
output [(2*DQ_WIDTH)-1:0] wdf_data,
|
| 103 |
|
|
output [((2*DQ_WIDTH)/8)-1:0] wdf_mask_data
|
| 104 |
|
|
);
|
| 105 |
|
|
|
| 106 |
|
|
wire [(APPDATA_WIDTH/2)-1:0] i_rd_data_fifo_out_fall;
|
| 107 |
|
|
wire [(APPDATA_WIDTH/2)-1:0] i_rd_data_fifo_out_rise;
|
| 108 |
|
|
|
| 109 |
|
|
//***************************************************************************
|
| 110 |
|
|
|
| 111 |
|
|
assign rd_data_fifo_out = {i_rd_data_fifo_out_fall,
|
| 112 |
|
|
i_rd_data_fifo_out_rise};
|
| 113 |
|
|
|
| 114 |
|
|
// read data de-skew and ECC calculation
|
| 115 |
|
|
ddr2_usr_rd #
|
| 116 |
|
|
(
|
| 117 |
|
|
.DQ_PER_DQS (DQ_PER_DQS),
|
| 118 |
|
|
.ECC_ENABLE (ECC_ENABLE),
|
| 119 |
|
|
.APPDATA_WIDTH (APPDATA_WIDTH),
|
| 120 |
|
|
.DQS_WIDTH (DQS_WIDTH)
|
| 121 |
|
|
)
|
| 122 |
|
|
u_usr_rd
|
| 123 |
|
|
(
|
| 124 |
|
|
.clk0 (clk0),
|
| 125 |
|
|
.rst0 (rst0),
|
| 126 |
|
|
.rd_data_in_rise (rd_data_in_rise),
|
| 127 |
|
|
.rd_data_in_fall (rd_data_in_fall),
|
| 128 |
|
|
.rd_ecc_error (rd_ecc_error),
|
| 129 |
|
|
.ctrl_rden (phy_calib_rden),
|
| 130 |
|
|
.ctrl_rden_sel (phy_calib_rden_sel),
|
| 131 |
|
|
.rd_data_valid (rd_data_valid),
|
| 132 |
|
|
.rd_data_out_rise (i_rd_data_fifo_out_rise),
|
| 133 |
|
|
.rd_data_out_fall (i_rd_data_fifo_out_fall)
|
| 134 |
|
|
);
|
| 135 |
|
|
|
| 136 |
|
|
// Command/Addres FIFO
|
| 137 |
|
|
ddr2_usr_addr_fifo #
|
| 138 |
|
|
(
|
| 139 |
|
|
.BANK_WIDTH (BANK_WIDTH),
|
| 140 |
|
|
.COL_WIDTH (COL_WIDTH),
|
| 141 |
|
|
.CS_BITS (CS_BITS),
|
| 142 |
|
|
.ROW_WIDTH (ROW_WIDTH)
|
| 143 |
|
|
)
|
| 144 |
|
|
u_usr_addr_fifo
|
| 145 |
|
|
(
|
| 146 |
|
|
.clk0 (clk0),
|
| 147 |
|
|
.usr_clk (usr_clk), //jb
|
| 148 |
|
|
.rst0 (rst0),
|
| 149 |
|
|
.app_af_cmd (app_af_cmd),
|
| 150 |
|
|
.app_af_addr (app_af_addr),
|
| 151 |
|
|
.app_af_wren (app_af_wren),
|
| 152 |
|
|
.ctrl_af_rden (ctrl_af_rden),
|
| 153 |
|
|
.af_cmd (af_cmd),
|
| 154 |
|
|
.af_addr (af_addr),
|
| 155 |
|
|
.af_empty (af_empty),
|
| 156 |
|
|
.app_af_afull (app_af_afull)
|
| 157 |
|
|
);
|
| 158 |
|
|
|
| 159 |
|
|
ddr2_usr_wr #
|
| 160 |
|
|
(
|
| 161 |
|
|
.BANK_WIDTH (BANK_WIDTH),
|
| 162 |
|
|
.COL_WIDTH (COL_WIDTH),
|
| 163 |
|
|
.CS_BITS (CS_BITS),
|
| 164 |
|
|
.DQ_WIDTH (DQ_WIDTH),
|
| 165 |
|
|
.APPDATA_WIDTH (APPDATA_WIDTH),
|
| 166 |
|
|
.ECC_ENABLE (ECC_ENABLE),
|
| 167 |
|
|
.ROW_WIDTH (ROW_WIDTH)
|
| 168 |
|
|
)
|
| 169 |
|
|
u_usr_wr
|
| 170 |
|
|
(
|
| 171 |
|
|
.clk0 (clk0),
|
| 172 |
|
|
.usr_clk (usr_clk), // jb
|
| 173 |
|
|
.clk90 (clk90),
|
| 174 |
|
|
.rst0 (rst0),
|
| 175 |
|
|
.app_wdf_wren (app_wdf_wren),
|
| 176 |
|
|
.app_wdf_data (app_wdf_data),
|
| 177 |
|
|
.app_wdf_mask_data (app_wdf_mask_data),
|
| 178 |
|
|
.wdf_rden (wdf_rden),
|
| 179 |
|
|
.app_wdf_afull (app_wdf_afull),
|
| 180 |
|
|
.wdf_data (wdf_data),
|
| 181 |
|
|
.wdf_mask_data (wdf_mask_data)
|
| 182 |
|
|
);
|
| 183 |
|
|
|
| 184 |
|
|
endmodule
|