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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [boards/] [xilinx/] [ml501/] [rtl/] [verilog/] [xilinx_ddr2/] [ddr2_phy_dqs_iob.v] - Blame information for rev 412

Details | Compare with Previous | View Log

Line No. Rev Author Line
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, 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.0
44
//  \   \         Application: MIG
45
//  /   /         Filename: ddr2_phy_dqs_iob.v
46
// /___/   /\     Date Last Modified: $Date: 2008/12/23 14:26:00 $
47
// \   \  /  \    Date Created: Wed Aug 16 2006
48
//  \___\/\___\
49
//
50
//Device: Virtex-5
51
//Design Name: DDR2
52
//Purpose:
53
//   This module places the data strobes in the IOBs.
54
//Reference:
55
//Revision History:
56
//   Rev 1.1 - Parameter HIGH_PERFORMANCE_MODE added. PK. 7/10/08
57
//   Rev 1.2 - Parameter IODELAY_GRP added and constraint IODELAY_GROUP added
58
//             on IODELAY primitives. PK. 11/27/08
59
//*****************************************************************************
60
 
61
`timescale 1ns/1ps
62
 
63
module ddr2_phy_dqs_iob #
64
  (
65
   // Following parameters are for 72-bit RDIMM design (for ML561 Reference
66
   // board design). Actual values may be different. Actual parameters values
67
   // are passed from design top module ddr2_mig module. Please refer to
68
   // the ddr2_mig module for actual values.
69
   parameter DDR_TYPE              = 1,
70
   parameter HIGH_PERFORMANCE_MODE = "TRUE",
71
   parameter IODELAY_GRP           = "IODELAY_MIG"
72
   )
73
  (
74
   input        clk0,
75
   input        clkdiv0,
76
   input        rst0,
77
   input        dlyinc_dqs,
78
   input        dlyce_dqs,
79
   input        dlyrst_dqs,
80
   input        dlyinc_gate,
81
   input        dlyce_gate,
82
   input        dlyrst_gate,
83
   input        dqs_oe_n,
84
   input        dqs_rst_n,
85
   input        en_dqs,
86
   inout        ddr_dqs,
87
   inout        ddr_dqs_n,
88
   output       dq_ce,
89
   output       delayed_dqs
90
   );
91
 
92
  wire                     clk180;
93
  wire                     dqs_bufio;
94
 
95
  wire                     dqs_ibuf;
96
  wire                     dqs_idelay;
97
  wire                     dqs_oe_n_delay;
98
  wire                     dqs_oe_n_r;
99
  wire                     dqs_rst_n_delay;
100
  reg                      dqs_rst_n_r /* synthesis syn_preserve = 1*/;
101
  wire                     dqs_out;
102
  wire                     en_dqs_sync /* synthesis syn_keep = 1 */;
103
 
104
  // for simulation only. Synthesis should ignore this delay
105
  localparam    DQS_NET_DELAY = 0.8;
106
 
107
  assign        clk180 = ~clk0;
108
 
109
  // add delta delay to inputs clocked by clk180 to avoid delta-delay
110
  // simulation issues
111
  assign dqs_rst_n_delay = dqs_rst_n;
112
  assign dqs_oe_n_delay  = dqs_oe_n;
113
 
114
  //***************************************************************************
115
  // DQS input-side resources:
116
  //  - IODELAY (pad -> IDELAY)
117
  //  - BUFIO (IDELAY -> BUFIO)
118
  //***************************************************************************
119
 
120
  // Route DQS from PAD to IDELAY
121
  (* IODELAY_GROUP = IODELAY_GRP *) IODELAY #
122
    (
123
     .DELAY_SRC("I"),
124
     .IDELAY_TYPE("VARIABLE"),
125
     .HIGH_PERFORMANCE_MODE(HIGH_PERFORMANCE_MODE),
126
     .IDELAY_VALUE(0),
127
     .ODELAY_VALUE(0)
128
     )
129
    u_idelay_dqs
130
      (
131
       .DATAOUT (dqs_idelay),
132
       .C       (clkdiv0),
133
       .CE      (dlyce_dqs),
134
       .DATAIN  (),
135
       .IDATAIN (dqs_ibuf),
136
       .INC     (dlyinc_dqs),
137
       .ODATAIN (),
138
       .RST     (dlyrst_dqs),
139
       .T       ()
140
       );
141
 
142
  // From IDELAY to BUFIO
143
  BUFIO u_bufio_dqs
144
    (
145
     .I  (dqs_idelay),
146
     .O  (dqs_bufio)
147
     );
148
 
149
  // To model additional delay of DQS BUFIO + gating network
150
  // for behavioral simulation. Make sure to select a delay number smaller
151
  // than half clock cycle (otherwise output will not track input changes
152
  // because of inertial delay). Duplicate to avoid delta delay issues.
153
  assign #(DQS_NET_DELAY) i_delayed_dqs = dqs_bufio;
154
  assign #(DQS_NET_DELAY) delayed_dqs   = dqs_bufio;
155
 
156
  //***************************************************************************
157
  // DQS gate circuit (not supported for all controllers)
158
  //***************************************************************************
159
 
160
  // Gate routing:
161
  //   en_dqs -> IDELAY -> en_dqs_sync -> IDDR.S -> dq_ce ->
162
  //   capture IDDR.CE
163
 
164
  // Delay CE control so that it's in phase with delayed DQS
165
  (* IODELAY_GROUP = IODELAY_GRP *) IODELAY #
166
    (
167
     .DELAY_SRC             ("DATAIN"),
168
     .IDELAY_TYPE           ("VARIABLE"),
169
     .HIGH_PERFORMANCE_MODE (HIGH_PERFORMANCE_MODE),
170
     .IDELAY_VALUE          (0),
171
     .ODELAY_VALUE          (0)
172
     )
173
    u_iodelay_dq_ce
174
      (
175
       .DATAOUT (en_dqs_sync),
176
       .C       (clkdiv0),
177
       .CE      (dlyce_gate),
178
       .DATAIN  (en_dqs),
179
       .IDATAIN (),
180
       .INC     (dlyinc_gate),
181
       .ODATAIN (),
182
       .RST     (dlyrst_gate),
183
       .T       ()
184
       );
185
 
186
  // Generate sync'ed CE to DQ IDDR's using an IDDR clocked by DQS
187
  // We could also instantiate a negative-edge SDR flop here
188
  IDDR #
189
    (
190
     .DDR_CLK_EDGE ("OPPOSITE_EDGE"),
191
     .INIT_Q1      (1'b0),
192
     .INIT_Q2      (1'b0),
193
     .SRTYPE       ("ASYNC")
194
     )
195
    u_iddr_dq_ce
196
      (
197
       .Q1 (),
198
       .Q2 (dq_ce),           // output on falling edge
199
       .C  (i_delayed_dqs),
200
       .CE (1'b1),
201
       .D  (en_dqs_sync),
202
       .R  (1'b0),
203
       .S  (en_dqs_sync)
204
       );
205
 
206
  //***************************************************************************
207
  // DQS output-side resources
208
  //***************************************************************************
209
 
210
  // synthesis attribute keep of dqs_rst_n_r is "true"
211
  always @(posedge clk180)
212
    dqs_rst_n_r <= dqs_rst_n_delay;
213
 
214
  ODDR #
215
    (
216
     .SRTYPE("SYNC"),
217
     .DDR_CLK_EDGE("OPPOSITE_EDGE")
218
     )
219
    u_oddr_dqs
220
      (
221
       .Q  (dqs_out),
222
       .C  (clk180),
223
       .CE (1'b1),
224
       .D1 (dqs_rst_n_r),      // keep output deasserted for write preamble
225
       .D2 (1'b0),
226
       .R  (1'b0),
227
       .S  (1'b0)
228
       );
229
 
230
  (* IOB = "FORCE" *) FDP u_tri_state_dqs
231
    (
232
     .D   (dqs_oe_n_delay),
233
     .Q   (dqs_oe_n_r),
234
     .C   (clk180),
235
     .PRE (rst0)
236
     ) /* synthesis syn_useioff = 1 */;
237
 
238
  //***************************************************************************
239
 
240
  // use either single-ended (for DDR1) or differential (for DDR2) DQS input
241
 
242
  generate
243
    if (DDR_TYPE > 0) begin: gen_dqs_iob_ddr2
244
      IOBUFDS u_iobuf_dqs
245
        (
246
         .O   (dqs_ibuf),
247
         .IO  (ddr_dqs),
248
         .IOB (ddr_dqs_n),
249
         .I   (dqs_out),
250
         .T   (dqs_oe_n_r)
251
         );
252
    end else begin: gen_dqs_iob_ddr1
253
      IOBUF u_iobuf_dqs
254
        (
255
         .O   (dqs_ibuf),
256
         .IO  (ddr_dqs),
257
         .I   (dqs_out),
258
         .T   (dqs_oe_n_r)
259
         );
260
    end
261
  endgenerate
262
 
263
endmodule

powered by: WebSVN 2.1.0

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