| 1 |
2 |
ndumitrach |
//*****************************************************************************
|
| 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 2005, 2006, 2007, 2008 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.6.1
|
| 44 |
|
|
// \ \ Application : MIG
|
| 45 |
|
|
// / / Filename : data_write.v
|
| 46 |
|
|
// /___/ /\ Date Last Modified : $Date: 2010/11/26 18:25:41 $
|
| 47 |
|
|
// \ \ / \ Date Created : Mon May 2 2005
|
| 48 |
|
|
// \___\/\___\
|
| 49 |
|
|
// Device : Spartan-3/3A/3A-DSP
|
| 50 |
|
|
// Design Name : DDR2 SDRAM
|
| 51 |
|
|
// Purpose : Data write operation performed through the pipelines in this
|
| 52 |
|
|
// module.
|
| 53 |
|
|
//*****************************************************************************
|
| 54 |
|
|
|
| 55 |
|
|
`timescale 1ns/100ps
|
| 56 |
|
|
`include "../rtl/ddr_parameters_0.v"
|
| 57 |
|
|
|
| 58 |
|
|
module ddr_data_write_0
|
| 59 |
|
|
(
|
| 60 |
|
|
input [((`DATA_WIDTH*2)-1):0] user_input_data,
|
| 61 |
|
|
input [((`DATA_MASK_WIDTH*2)-1):0] user_data_mask,
|
| 62 |
|
|
input clk90,
|
| 63 |
|
|
input write_enable,
|
| 64 |
|
|
output reg write_en_val,
|
| 65 |
|
|
output [((`DATA_WIDTH)-1):0] write_data_falling,
|
| 66 |
|
|
output [((`DATA_WIDTH)-1):0] write_data_rising,
|
| 67 |
|
|
output [((`DATA_MASK_WIDTH)-1):0] data_mask_f,
|
| 68 |
|
|
output [((`DATA_MASK_WIDTH)-1):0] data_mask_r
|
| 69 |
|
|
);
|
| 70 |
|
|
|
| 71 |
|
|
reg write_en_P1;
|
| 72 |
|
|
|
| 73 |
|
|
reg [((`DATA_WIDTH*2)-1):0] write_data1;
|
| 74 |
|
|
reg [((`DATA_WIDTH*2)-1):0] write_data2;
|
| 75 |
|
|
reg [((`DATA_WIDTH*2)-1):0] write_data3;
|
| 76 |
|
|
reg [((`DATA_WIDTH*2)-1):0] write_data4
|
| 77 |
|
|
/* synthesis syn_srlstyle="registers" */;
|
| 78 |
|
|
reg [((`DATA_MASK_WIDTH*2)-1):0] write_data_m1;
|
| 79 |
|
|
reg [((`DATA_MASK_WIDTH*2)-1):0] write_data_m2;
|
| 80 |
|
|
reg [((`DATA_MASK_WIDTH*2)-1):0] write_data_m3;
|
| 81 |
|
|
reg [((`DATA_MASK_WIDTH*2)-1):0] write_data_m4;
|
| 82 |
|
|
|
| 83 |
|
|
reg [(`DATA_WIDTH-1):0] write_data90;
|
| 84 |
|
|
reg [(`DATA_WIDTH-1):0] write_data90_1;
|
| 85 |
|
|
reg [(`DATA_WIDTH-1):0] write_data90_2;
|
| 86 |
|
|
reg [(`DATA_WIDTH-1):0] write_data270;
|
| 87 |
|
|
reg [(`DATA_WIDTH-1):0] write_data270_1;
|
| 88 |
|
|
reg [(`DATA_WIDTH-1):0] write_data270_2;
|
| 89 |
|
|
|
| 90 |
|
|
reg [(`DATA_MASK_WIDTH-1):0] write_data_m90;
|
| 91 |
|
|
reg [(`DATA_MASK_WIDTH-1):0] write_data_m90_1;
|
| 92 |
|
|
reg [(`DATA_MASK_WIDTH-1):0] write_data_m90_2;
|
| 93 |
|
|
|
| 94 |
|
|
reg [((`DATA_MASK_WIDTH)-1):0] write_data_m270;
|
| 95 |
|
|
reg [((`DATA_MASK_WIDTH)-1):0] write_data_m270_1;
|
| 96 |
|
|
reg [((`DATA_MASK_WIDTH)-1):0] write_data_m270_2;
|
| 97 |
|
|
|
| 98 |
|
|
wire [((`DATA_WIDTH*2)-1):0] write_data0;
|
| 99 |
|
|
wire [((`DATA_MASK_WIDTH*2)-1):0] write_data_m0;
|
| 100 |
|
|
|
| 101 |
|
|
|
| 102 |
|
|
assign write_data0 = user_input_data;
|
| 103 |
|
|
assign write_data_m0 = user_data_mask;
|
| 104 |
|
|
|
| 105 |
|
|
always@(posedge clk90) begin
|
| 106 |
|
|
write_data1 <= write_data0;
|
| 107 |
|
|
write_data2 <= write_data1;
|
| 108 |
|
|
write_data3 <= write_data2;
|
| 109 |
|
|
write_data4 <= write_data3;
|
| 110 |
|
|
end
|
| 111 |
|
|
|
| 112 |
|
|
always@(posedge clk90) begin
|
| 113 |
|
|
write_data_m1 <= write_data_m0;
|
| 114 |
|
|
write_data_m2 <= write_data_m1;
|
| 115 |
|
|
write_data_m3 <= write_data_m2;
|
| 116 |
|
|
write_data_m4 <= write_data_m3;
|
| 117 |
|
|
end
|
| 118 |
|
|
|
| 119 |
|
|
always@(posedge clk90) begin
|
| 120 |
|
|
write_data90 <= write_data4[`DATA_WIDTH-1 : 0];
|
| 121 |
|
|
write_data_m90 <= write_data_m4[`DATA_MASK_WIDTH-1:0];
|
| 122 |
|
|
write_data90_1 <= write_data90;
|
| 123 |
|
|
write_data_m90_1 <= write_data_m90;
|
| 124 |
|
|
write_data90_2 <= write_data90_1;
|
| 125 |
|
|
write_data_m90_2 <= write_data_m90_1;
|
| 126 |
|
|
|
| 127 |
|
|
end
|
| 128 |
|
|
|
| 129 |
|
|
always@ (negedge clk90) begin
|
| 130 |
|
|
write_data270 <= write_data4[(`DATA_WIDTH*2)-1 : `DATA_WIDTH];
|
| 131 |
|
|
write_data_m270 <= write_data_m4[(`DATA_MASK_WIDTH*2)-1:`DATA_MASK_WIDTH];
|
| 132 |
|
|
|
| 133 |
|
|
write_data270_1 <= write_data270;
|
| 134 |
|
|
write_data_m270_1 <= write_data_m270;
|
| 135 |
|
|
write_data270_2 <= write_data270_1;
|
| 136 |
|
|
write_data_m270_2 <= write_data_m270_1;
|
| 137 |
|
|
|
| 138 |
|
|
end
|
| 139 |
|
|
|
| 140 |
|
|
assign write_data_rising = write_data270_2;
|
| 141 |
|
|
assign write_data_falling = write_data90_2;
|
| 142 |
|
|
|
| 143 |
|
|
assign data_mask_r = write_data_m270_2;
|
| 144 |
|
|
assign data_mask_f = write_data_m90_2;
|
| 145 |
|
|
|
| 146 |
|
|
|
| 147 |
|
|
// write enable for data path
|
| 148 |
|
|
always@(posedge clk90) begin
|
| 149 |
|
|
write_en_P1 <= write_enable;
|
| 150 |
|
|
end
|
| 151 |
|
|
|
| 152 |
|
|
always@(negedge clk90) begin
|
| 153 |
|
|
write_en_val <= write_en_P1;
|
| 154 |
|
|
end
|
| 155 |
|
|
|
| 156 |
|
|
endmodule
|