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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [boards/] [xilinx/] [s3adsp1800/] [rtl/] [verilog/] [xilinx_s3adsp_ddr2/] [s3adsp_ddr2_infrastructure_top.v] - Blame information for rev 568

Details | Compare with Previous | View Log

Line No. Rev Author Line
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_infrastructure_top.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      : This module has instantiations clk_dcm and cal_top.
52
//                This generate reset signals.
53
//*****************************************************************************
54
 
55
`timescale 1ns/100ps
56
`include "s3adsp_ddr2_parameters_0.v"
57
module s3adsp_ddr2_infrastructure_top
58
  (
59
   input        sys_clk,
60
   input        sys_clkb,
61
   input        sys_clk_in,
62
   input        reset_in_n,
63
   output [4:0] delay_sel_val1_val,
64
   output       sys_rst_val,
65
   output       sys_rst90_val,
66
   output       sys_rst180_val,
67
   output reg   wait_200us_rout,
68
   output       clk_int_val,
69
   output       clk90_int_val,
70
   // debug signals
71
   output [4:0] dbg_phase_cnt,
72
   output [5:0] dbg_cnt,
73
   output       dbg_trans_onedtct,
74
   output       dbg_trans_twodtct,
75
   output       dbg_enb_trans_two_dtct
76
 
77
   );
78
 
79
   wire       user_rst;
80
   wire       clk_int;
81
   wire       clk90_int;
82
   wire       dcm_lock;
83
   wire       sys_clk_ibuf;
84
   wire       clk_int_val1;
85
   wire       clk_int_val2;
86
   wire       clk90_int_val1;
87
   wire       clk90_int_val2;
88
   wire [4:0] delay_sel_val;
89
   wire       user_cal_rst;
90
   reg        sys_rst_o;
91
   reg        sys_rst_1;
92
   reg        sys_rst;
93
   reg        sys_rst90_o;
94
   reg        sys_rst90_1;
95
   reg        sys_rst90;
96
   reg        sys_rst180_o;
97
   reg        sys_rst180_1;
98
   reg        sys_rst180;
99
   reg [15:0] counter200;
100
   reg        wait_200us;
101
   reg        wait_clk90;
102
   reg        wait_clk270;
103
   reg        wait_200us_r;
104
 
105
   generate
106
   if(`CLK_TYPE == "DIFFERENTIAL") begin : DIFF_ENDED_CLKS_INST
107
 
108
     IBUFGDS_LVDS_25  SYS_CLK_INST
109
       (
110
        .I  (sys_clk),
111
        .IB (sys_clkb),
112
        .O  (sys_clk_ibuf)
113
        );
114
   end else if(`CLK_TYPE == "SINGLE_ENDED") begin : SINGLE_ENDED_CLKS_INST
115
/*
116
     IBUFG  SYS_CLK_INST
117
       (
118
        .I  (sys_clk_in),
119
        .O  (sys_clk_ibuf)
120
        );
121
 */
122
      assign sys_clk_ibuf = sys_clk_in;
123
 
124
   end
125
   endgenerate
126
 
127
   assign clk_int_val        = clk_int;
128
   assign clk90_int_val      = clk90_int;
129
   assign sys_rst_val        = sys_rst;
130
   assign sys_rst90_val      = sys_rst90;
131
   assign sys_rst180_val     = sys_rst180;
132
   assign delay_sel_val1_val = delay_sel_val;
133
   assign clk_int_val1       = clk_int;
134
   assign clk90_int_val1     = clk90_int;
135
   assign clk_int_val2       = clk_int_val1;
136
   assign clk90_int_val2     = clk90_int_val1;
137
   assign user_rst           = `RESET_ACTIVE_LOW  == 1'b1 ?
138
                                ~reset_in_n :  reset_in_n;
139
   assign user_cal_rst       = `RESET_ACTIVE_LOW  == 1'b1 ?
140
                                reset_in_n : ~reset_in_n;
141
 
142
   always @(posedge clk_int_val2) begin
143
      if(user_rst == 1'b1 || dcm_lock == 1'b0) begin
144
         wait_200us <= 1'b1;
145
         counter200     <= 16'd0;
146
      end
147
      else
148
`ifdef simulation
149
        wait_200us <= 1'b0;
150
`else
151
      if ( counter200 < 16'd33400 ) begin
152
         counter200 <= counter200 + 1'b1;
153
         wait_200us <= 1'b1;
154
      end
155
      else begin
156
         counter200 <= counter200;
157
         wait_200us <= 1'b0;
158
      end
159
`endif
160
   end
161
 
162
   always @( posedge clk_int_val2 )
163
     wait_200us_r <= wait_200us;
164
 
165
   always @( posedge clk_int_val2 )
166
     wait_200us_rout <= wait_200us;
167
 
168
   always @(negedge clk90_int_val2) begin
169
      if(user_rst == 1'b1 || dcm_lock == 1'b0)
170
        wait_clk270 <= 1'b1;
171
      else
172
        wait_clk270 <= wait_200us_r;
173
   end
174
 
175
   always @(posedge clk90_int_val2) begin
176
      wait_clk90 <= wait_clk270;
177
   end
178
 
179
   always@(posedge clk_int_val2) begin
180
      if(user_rst == 1'b1 || dcm_lock == 1'b0 || wait_200us_r == 1'b1 ) begin
181
         sys_rst_o <= 1'b1;
182
         sys_rst_1 <= 1'b1;
183
         sys_rst   <= 1'b1;
184
      end
185
      else begin
186
         sys_rst_o <= 1'b0;
187
         sys_rst_1 <= sys_rst_o;
188
         sys_rst   <= sys_rst_1;
189
      end
190
   end
191
 
192
   always@(posedge clk90_int_val2) begin
193
      if (user_rst == 1'b1 || dcm_lock == 1'b0 || wait_clk90 == 1'b1) begin
194
         sys_rst90_o <= 1'b1;
195
         sys_rst90_1 <= 1'b1;
196
         sys_rst90   <= 1'b1;
197
      end
198
      else begin
199
         sys_rst90_o <= 1'b0;
200
         sys_rst90_1 <= sys_rst90_o;
201
         sys_rst90   <= sys_rst90_1;
202
      end
203
   end
204
 
205
   always@(negedge clk_int_val2) begin
206
      if (user_rst == 1'b1 || dcm_lock == 1'b0 || wait_clk270 == 1'b1) begin
207
         sys_rst180_o <= 1'b1;
208
         sys_rst180_1 <= 1'b1;
209
         sys_rst180   <= 1'b1;
210
      end
211
      else begin
212
         sys_rst180_o <= 1'b0;
213
         sys_rst180_1 <= sys_rst180_o;
214
         sys_rst180   <= sys_rst180_1;
215
      end
216
   end
217
 
218
   s3adsp_ddr2_clk_dcm clk_dcm0
219
     (
220
      .input_clk   (sys_clk_ibuf),
221
      .rst         (user_rst),
222
      .clk         (clk_int),
223
      .clk90       (clk90_int),
224
      .dcm_lock    (dcm_lock)
225
      );
226
 
227
   s3adsp_ddr2_cal_top cal_top0
228
     (
229
      .clk0                   (clk_int_val2),
230
      .clk0dcmlock            (dcm_lock),
231
      .reset                  (user_cal_rst),
232
      .tapfordqs              (delay_sel_val),
233
      .dbg_phase_cnt          (dbg_phase_cnt),
234
      .dbg_cnt                (dbg_cnt),
235
      .dbg_trans_onedtct      (dbg_trans_onedtct),
236
      .dbg_trans_twodtct      (dbg_trans_twodtct),
237
      .dbg_enb_trans_two_dtct (dbg_enb_trans_two_dtct)
238
      );
239
 
240
endmodule

powered by: WebSVN 2.1.0

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