1 |
568 |
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 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 : s3adsp_ddr2_data_read_0.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 : ram8d modules are instantiated for Read data FIFOs. RAM8D is
|
52 |
|
|
// each 8 bits or 4 bits depending on number data bits per strobe.
|
53 |
|
|
// Each strobe will have two instances, one for rising edge data
|
54 |
|
|
// and one for falling edge data.
|
55 |
|
|
//*****************************************************************************
|
56 |
|
|
|
57 |
|
|
`timescale 1ns/100ps
|
58 |
|
|
`include "s3adsp_ddr2_parameters_0.v"
|
59 |
|
|
|
60 |
|
|
|
61 |
|
|
module s3adsp_ddr2_data_read_0
|
62 |
|
|
(
|
63 |
|
|
input clk90,
|
64 |
|
|
input reset90,
|
65 |
|
|
input [(`DATA_WIDTH-1):0] ddr_dq_in,
|
66 |
|
|
input [(`DATA_STROBE_WIDTH-1):0] fifo_0_wr_en,
|
67 |
|
|
input [(`DATA_STROBE_WIDTH-1):0] fifo_1_wr_en,
|
68 |
|
|
input [(4*`DATA_STROBE_WIDTH)-1:0] fifo_0_wr_addr ,
|
69 |
|
|
input [(4*`DATA_STROBE_WIDTH)-1:0] fifo_1_wr_addr ,
|
70 |
|
|
input [(`DATA_STROBE_WIDTH-1):0] dqs_delayed_col0,
|
71 |
|
|
input [(`DATA_STROBE_WIDTH-1):0] dqs_delayed_col1,
|
72 |
|
|
input read_fifo_rden,
|
73 |
|
|
output [((`DATA_WIDTH*2)-1):0] user_output_data,
|
74 |
|
|
output u_data_val
|
75 |
|
|
);
|
76 |
|
|
|
77 |
|
|
reg reset90_r;
|
78 |
|
|
|
79 |
|
|
reg [(4*`DATA_STROBE_WIDTH)-1:0] fifo0_rd_addr_r
|
80 |
|
|
/* synthesis syn_preserve=1 */;
|
81 |
|
|
reg [(4*`DATA_STROBE_WIDTH)-1:0] fifo1_rd_addr_r
|
82 |
|
|
/* synthesis syn_preserve=1 */;
|
83 |
|
|
|
84 |
|
|
reg [`DATA_WIDTH-1:0] fifo_0_data_out_r
|
85 |
|
|
/* synthesis syn_preserve=1 */;
|
86 |
|
|
reg [`DATA_WIDTH-1:0] fifo_1_data_out_r
|
87 |
|
|
/* synthesis syn_preserve=1 */;
|
88 |
|
|
|
89 |
|
|
reg [((`DATA_WIDTH*2)-1):0] first_sdr_data;
|
90 |
|
|
reg read_fifo_rden_90r1;
|
91 |
|
|
reg read_fifo_rden_90r2;
|
92 |
|
|
reg read_fifo_rden_90r3;
|
93 |
|
|
reg read_fifo_rden_90r4;
|
94 |
|
|
reg read_fifo_rden_90r5;
|
95 |
|
|
reg read_fifo_rden_90r6;
|
96 |
|
|
|
97 |
|
|
wire [3:0] fifo0_rd_addr;
|
98 |
|
|
wire [3:0] fifo1_rd_addr;
|
99 |
|
|
wire [`DATA_WIDTH-1:0] fifo_0_data_out;
|
100 |
|
|
wire [`DATA_WIDTH-1:0] fifo_1_data_out;
|
101 |
|
|
wire [(`DATA_STROBE_WIDTH-1):0] dqs_delayed_col0_n;
|
102 |
|
|
wire [(`DATA_STROBE_WIDTH-1):0] dqs_delayed_col1_n;
|
103 |
|
|
|
104 |
|
|
|
105 |
|
|
assign dqs_delayed_col0_n = ~ dqs_delayed_col0;
|
106 |
|
|
assign dqs_delayed_col1_n = ~ dqs_delayed_col1;
|
107 |
|
|
assign user_output_data = first_sdr_data;
|
108 |
|
|
assign u_data_val = read_fifo_rden_90r6;
|
109 |
|
|
|
110 |
|
|
|
111 |
|
|
always @( posedge clk90 )
|
112 |
|
|
reset90_r <= reset90;
|
113 |
|
|
|
114 |
|
|
// Read fifo read enable signal phase is changed from 180 to 90 clock domain
|
115 |
|
|
always@(posedge clk90) begin
|
116 |
|
|
if(reset90_r)begin
|
117 |
|
|
read_fifo_rden_90r1 <= 1'b0;
|
118 |
|
|
read_fifo_rden_90r2 <= 1'b0;
|
119 |
|
|
read_fifo_rden_90r3 <= 1'b0;
|
120 |
|
|
read_fifo_rden_90r4 <= 1'b0;
|
121 |
|
|
read_fifo_rden_90r5 <= 1'b0;
|
122 |
|
|
read_fifo_rden_90r6 <= 1'b0;
|
123 |
|
|
|
124 |
|
|
end
|
125 |
|
|
else begin
|
126 |
|
|
read_fifo_rden_90r1 <= read_fifo_rden;
|
127 |
|
|
read_fifo_rden_90r2 <= read_fifo_rden_90r1;
|
128 |
|
|
read_fifo_rden_90r3 <= read_fifo_rden_90r2;
|
129 |
|
|
read_fifo_rden_90r4 <= read_fifo_rden_90r3;
|
130 |
|
|
read_fifo_rden_90r5 <= read_fifo_rden_90r4;
|
131 |
|
|
read_fifo_rden_90r6 <= read_fifo_rden_90r5;
|
132 |
|
|
end
|
133 |
|
|
end
|
134 |
|
|
|
135 |
|
|
always@(posedge clk90) begin
|
136 |
|
|
fifo_0_data_out_r <= fifo_0_data_out;
|
137 |
|
|
fifo_1_data_out_r <= fifo_1_data_out;
|
138 |
|
|
end
|
139 |
|
|
|
140 |
|
|
genvar addr_i;
|
141 |
|
|
generate for(addr_i = 0; addr_i < `DATA_STROBE_WIDTH; addr_i = addr_i + 1) begin: gen_rd_addr
|
142 |
|
|
always@(posedge clk90) begin
|
143 |
|
|
fifo0_rd_addr_r[addr_i*4+:4] <= fifo0_rd_addr;
|
144 |
|
|
fifo1_rd_addr_r[addr_i*4+:4] <= fifo1_rd_addr;
|
145 |
|
|
end
|
146 |
|
|
end
|
147 |
|
|
endgenerate
|
148 |
|
|
always@(posedge clk90)begin
|
149 |
|
|
if(reset90_r)
|
150 |
|
|
first_sdr_data <= {(`DATA_WIDTH*2){1'b0}};
|
151 |
|
|
else if(read_fifo_rden_90r5)
|
152 |
|
|
first_sdr_data <= {fifo_0_data_out_r, fifo_1_data_out_r};
|
153 |
|
|
end
|
154 |
|
|
|
155 |
|
|
|
156 |
|
|
s3adsp_ddr2_rd_gray_cntr fifo0_rd_addr_inst
|
157 |
|
|
(
|
158 |
|
|
.clk90 (clk90),
|
159 |
|
|
.reset90 (reset90),
|
160 |
|
|
.cnt_en (read_fifo_rden_90r3),
|
161 |
|
|
.rgc_gcnt (fifo0_rd_addr)
|
162 |
|
|
);
|
163 |
|
|
|
164 |
|
|
s3adsp_ddr2_rd_gray_cntr fifo1_rd_addr_inst
|
165 |
|
|
(
|
166 |
|
|
.clk90 (clk90),
|
167 |
|
|
.reset90 (reset90),
|
168 |
|
|
.cnt_en (read_fifo_rden_90r3),
|
169 |
|
|
.rgc_gcnt (fifo1_rd_addr)
|
170 |
|
|
);
|
171 |
|
|
|
172 |
|
|
|
173 |
|
|
|
174 |
|
|
genvar strobe_i;
|
175 |
|
|
generate for(strobe_i = 0; strobe_i < `DATA_STROBE_WIDTH; strobe_i = strobe_i + 1)
|
176 |
|
|
begin: gen_strobe
|
177 |
|
|
s3adsp_ddr2_ram8d_0 strobe
|
178 |
|
|
(
|
179 |
|
|
.dout (fifo_0_data_out[strobe_i*`DATABITSPERSTROBE+:`DATABITSPERSTROBE]),
|
180 |
|
|
.waddr (fifo_0_wr_addr[strobe_i*4+:4]),
|
181 |
|
|
.din (ddr_dq_in[strobe_i*`DATABITSPERSTROBE+:`DATABITSPERSTROBE]),
|
182 |
|
|
.raddr (fifo0_rd_addr_r[strobe_i*4+:4]),
|
183 |
|
|
.wclk0 (dqs_delayed_col0[strobe_i]),
|
184 |
|
|
.wclk1 (dqs_delayed_col1[strobe_i]),
|
185 |
|
|
.we (fifo_0_wr_en[strobe_i])
|
186 |
|
|
);
|
187 |
|
|
|
188 |
|
|
s3adsp_ddr2_ram8d_0 strobe_n
|
189 |
|
|
(
|
190 |
|
|
.dout (fifo_1_data_out[strobe_i*`DATABITSPERSTROBE+:`DATABITSPERSTROBE]),
|
191 |
|
|
.waddr (fifo_1_wr_addr[strobe_i*4+:4]),
|
192 |
|
|
.din (ddr_dq_in[strobe_i*`DATABITSPERSTROBE+:`DATABITSPERSTROBE]),
|
193 |
|
|
.raddr (fifo1_rd_addr_r[strobe_i*4+:4]),
|
194 |
|
|
.wclk0 (dqs_delayed_col0_n[strobe_i]),
|
195 |
|
|
.wclk1 (dqs_delayed_col1_n[strobe_i]),
|
196 |
|
|
.we (fifo_1_wr_en[strobe_i])
|
197 |
|
|
);
|
198 |
|
|
end
|
199 |
|
|
endgenerate
|
200 |
|
|
|
201 |
|
|
endmodule
|