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

Subversion Repositories pcie_ds_dma

[/] [pcie_ds_dma/] [trunk/] [core/] [ds_dma64/] [pcie_src/] [pcie_core64_m1/] [source/] [extend_clk.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dsmv
 
2
//-----------------------------------------------------------------------------
3
//
4
// (c) Copyright 2009-2010 Xilinx, Inc. All rights reserved.
5
//
6
// This file contains confidential and proprietary information
7
// of Xilinx, Inc. and is protected under U.S. and
8
// international copyright and other intellectual property
9
// laws.
10
//
11
// DISCLAIMER
12
// This disclaimer is not a license and does not grant any
13
// rights to the materials distributed herewith. Except as
14
// otherwise provided in a valid license issued to you by
15
// Xilinx, and to the maximum extent permitted by applicable
16
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
17
// WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
18
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
19
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
20
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
21
// (2) Xilinx shall not be liable (whether in contract or tort,
22
// including negligence, or under any other theory of
23
// liability) for any loss or damage of any kind or nature
24
// related to, arising under or in connection with these
25
// materials, including for any direct, or any indirect,
26
// special, incidental, or consequential loss or damage
27
// (including loss of data, profits, goodwill, or any type of
28
// loss or damage suffered as a result of any action brought
29
// by a third party) even if such damage or loss was
30
// reasonably foreseeable or Xilinx had been advised of the
31
// possibility of the same.
32
//
33
// CRITICAL APPLICATIONS
34
// Xilinx products are not designed or intended to be fail-
35
// safe, or for use in any application requiring fail-safe
36
// performance, such as life-support or safety devices or
37
// systems, Class III medical devices, nuclear facilities,
38
// applications related to the deployment of airbags, or any
39
// other applications that could lead to death, personal
40
// injury, or severe property or environmental damage
41
// (individually and collectively, "Critical
42
// Applications"). Customer assumes the sole risk and
43
// liability of any use of Xilinx products in Critical
44
// Applications, subject only to applicable laws and
45
// regulations governing limitations on product liability.
46
//
47
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
48
// PART OF THIS FILE AT ALL TIMES.
49
//
50
//-----------------------------------------------------------------------------
51
// Project    : V5-Block Plus for PCI Express
52
// File       : extend_clk.v
53
//--------------------------------------------------------------------------------
54
//--------------------------------------------------------------------------------
55
 
56
//
57
//   ____  ____
58
//  /   /\/   /
59
// /___/  \  /    Vendor      : Xilinx
60
// \   \   \/     Version     : 1.1
61
//  \   \         Application : Generated by Xilinx PCI Express Wizard
62
//  /   /         Filename    : extend_clk.v
63
// /___/   /\     Module      : Extend Clk period of certain signals 
64
// \   \  /  \
65
//  \___\/\___\
66
//
67
//------------------------------------------------------------------------------
68
 
69
//  Purpose: Extend signals coming out of Block that are clocked with core_clk
70
//  by 0, 2 or 4 signals depending on frequency so BlkPlus(clocked using
71
//  user_clk) logic does not miss them.  
72
 
73
 
74
`ifndef Tcq
75
   `define Tcq 1
76
`endif
77
 
78
module extend_clk
79
#(
80
   // use 1 for 250Mhz use 2 for 125Mhz and 4 for 62.5Mhz
81
   parameter CLKRATIO=1
82
)
83
(
84
   input            clk,
85
   input            rst_n,
86
   input   [6:0]    l0_dll_error_vector,
87
   input   [1:0]    l0_rx_mac_link_error,
88
 
89
   output  [6:0]    l0_dll_error_vector_retime,
90
   output  [1:0]    l0_rx_mac_link_error_retime
91
);
92
 
93
 
94
   reg     [6:0]    l0_dll_error_vector_d;
95
   reg     [6:0]    l0_dll_error_vector_dd;
96
   reg     [6:0]    l0_dll_error_vector_ddd;
97
   reg     [1:0]    l0_rx_mac_link_error_d;
98
   reg     [1:0]    l0_rx_mac_link_error_dd;
99
   reg     [1:0]    l0_rx_mac_link_error_ddd;
100
 
101
 
102
 
103
always @(posedge clk) begin
104
   if (CLKRATIO == 2) begin          // 125Mhz
105
      if (!rst_n) begin
106
         l0_dll_error_vector_d   <= #`Tcq 6'h00;
107
         l0_rx_mac_link_error_d  <= #`Tcq 2'h0;
108
      end else begin
109
         l0_dll_error_vector_d   <= #`Tcq l0_dll_error_vector;
110
         l0_rx_mac_link_error_d  <= #`Tcq l0_rx_mac_link_error;
111
      end
112
   end else if (CLKRATIO == 4) begin // 62.5Mhz
113
      if (!rst_n)
114
      begin
115
         l0_dll_error_vector_d     <= #`Tcq 6'h00;
116
         l0_dll_error_vector_dd    <= #`Tcq 6'h00;
117
         l0_dll_error_vector_ddd   <= #`Tcq 6'h00;
118
 
119
         l0_rx_mac_link_error_d    <= #`Tcq 2'h0;
120
         l0_rx_mac_link_error_dd   <= #`Tcq 2'h0;
121
         l0_rx_mac_link_error_ddd  <= #`Tcq 2'h0;
122
      end else begin
123
         l0_dll_error_vector_d     <= #`Tcq l0_dll_error_vector;
124
         l0_dll_error_vector_dd    <= #`Tcq l0_dll_error_vector_d;
125
         l0_dll_error_vector_ddd   <= #`Tcq l0_dll_error_vector_dd;
126
 
127
         l0_rx_mac_link_error_d    <= #`Tcq l0_rx_mac_link_error;
128
         l0_rx_mac_link_error_dd   <= #`Tcq l0_rx_mac_link_error_d;
129
         l0_rx_mac_link_error_ddd  <= #`Tcq l0_rx_mac_link_error_dd;
130
      end
131
   end
132
end
133
 
134
 
135
 
136
assign l0_dll_error_vector_retime[6] =
137
   (CLKRATIO==2) ? (l0_dll_error_vector[6]    | l0_dll_error_vector_d[6]) :
138
   (CLKRATIO==4) ? (l0_dll_error_vector[6]    | l0_dll_error_vector_d[6] |
139
                    l0_dll_error_vector_dd[6] | l0_dll_error_vector_ddd[6]) :
140
                    l0_dll_error_vector[6];
141
 
142
assign l0_dll_error_vector_retime[5] =
143
   (CLKRATIO==2) ? (l0_dll_error_vector[5]    | l0_dll_error_vector_d[5]) :
144
   (CLKRATIO==4) ? (l0_dll_error_vector[5]    | l0_dll_error_vector_d[5] |
145
                    l0_dll_error_vector_dd[5] | l0_dll_error_vector_ddd[5]) :
146
                    l0_dll_error_vector[5];
147
 
148
assign l0_dll_error_vector_retime[4] =
149
   (CLKRATIO==2) ? (l0_dll_error_vector[4]    | l0_dll_error_vector_d[4]) :
150
   (CLKRATIO==4) ? (l0_dll_error_vector[4]    | l0_dll_error_vector_d[4] |
151
                    l0_dll_error_vector_dd[4] | l0_dll_error_vector_ddd[4]) :
152
                    l0_dll_error_vector[4];
153
 
154
assign l0_dll_error_vector_retime[3] =
155
   (CLKRATIO==2) ? (l0_dll_error_vector[3]    | l0_dll_error_vector_d[3]) :
156
   (CLKRATIO==4) ? (l0_dll_error_vector[3]    | l0_dll_error_vector_d[3] |
157
                    l0_dll_error_vector_dd[3] | l0_dll_error_vector_ddd[3]) :
158
                    l0_dll_error_vector[3];
159
 
160
assign l0_dll_error_vector_retime[2] =
161
   (CLKRATIO==2) ? (l0_dll_error_vector[2]    | l0_dll_error_vector_d[2]) :
162
   (CLKRATIO==4) ? (l0_dll_error_vector[2]    | l0_dll_error_vector_d[2] |
163
                    l0_dll_error_vector_dd[2] | l0_dll_error_vector_ddd[2]) :
164
                    l0_dll_error_vector[2];
165
 
166
assign l0_dll_error_vector_retime[1] =
167
   (CLKRATIO==2) ? (l0_dll_error_vector[1]    | l0_dll_error_vector_d[1]) :
168
   (CLKRATIO==4) ? (l0_dll_error_vector[1]    | l0_dll_error_vector_d[1] |
169
                    l0_dll_error_vector_dd[1] | l0_dll_error_vector_ddd[1]) :
170
                    l0_dll_error_vector[1];
171
 
172
assign l0_dll_error_vector_retime[0] =
173
   (CLKRATIO==2) ? (l0_dll_error_vector[0]    | l0_dll_error_vector_d[0]) :
174
   (CLKRATIO==4) ? (l0_dll_error_vector[0]    | l0_dll_error_vector_d[0] |
175
                    l0_dll_error_vector_dd[0] | l0_dll_error_vector_ddd[0]) :
176
                    l0_dll_error_vector[0];
177
 
178
 
179
 
180
assign l0_rx_mac_link_error_retime[1] =
181
   (CLKRATIO==2) ? (l0_rx_mac_link_error[1]    | l0_rx_mac_link_error_d[1]) :
182
   (CLKRATIO==4) ? (l0_rx_mac_link_error_d[1]  | l0_rx_mac_link_error_dd[1] |
183
                    l0_rx_mac_link_error_dd[1] | l0_rx_mac_link_error_ddd[1]) :
184
                    l0_rx_mac_link_error;
185
 
186
assign l0_rx_mac_link_error_retime[0] =
187
   (CLKRATIO==2) ? (l0_rx_mac_link_error[0]    | l0_rx_mac_link_error_d[0]) :
188
   (CLKRATIO==4) ? (l0_rx_mac_link_error_d[0]  | l0_rx_mac_link_error_dd[0] |
189
                    l0_rx_mac_link_error_dd[0] | l0_rx_mac_link_error_ddd[0]) :
190
                    l0_rx_mac_link_error;
191
 
192
 
193
 
194
endmodule

powered by: WebSVN 2.1.0

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