1 |
11 |
barabba |
//-----------------------------------------------------------------------------
|
2 |
|
|
//
|
3 |
|
|
// (c) Copyright 2009 Xilinx, Inc. All rights reserved.
|
4 |
|
|
//
|
5 |
|
|
// This file contains confidential and proprietary information of Xilinx, Inc.
|
6 |
|
|
// and is protected under U.S. and international copyright and other
|
7 |
|
|
// intellectual property laws.
|
8 |
|
|
//
|
9 |
|
|
// DISCLAIMER
|
10 |
|
|
//
|
11 |
|
|
// This disclaimer is not a license and does not grant any rights to the
|
12 |
|
|
// materials distributed herewith. Except as otherwise provided in a valid
|
13 |
|
|
// license issued to you by Xilinx, and to the maximum extent permitted by
|
14 |
|
|
// applicable law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND WITH ALL
|
15 |
|
|
// FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS,
|
16 |
|
|
// IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
|
17 |
|
|
// MERCHANTABILITY, NON-INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE;
|
18 |
|
|
// and (2) Xilinx shall not be liable (whether in contract or tort, including
|
19 |
|
|
// negligence, or under any other theory of liability) for any loss or damage
|
20 |
|
|
// of any kind or nature related to, arising under or in connection with these
|
21 |
|
|
// materials, including for any direct, or any indirect, special, incidental,
|
22 |
|
|
// or consequential loss or damage (including loss of data, profits, goodwill,
|
23 |
|
|
// or any type of loss or damage suffered as a result of any action brought by
|
24 |
|
|
// a third party) even if such damage or loss was reasonably foreseeable or
|
25 |
|
|
// Xilinx had been advised of the possibility of the same.
|
26 |
|
|
//
|
27 |
|
|
// CRITICAL APPLICATIONS
|
28 |
|
|
//
|
29 |
|
|
// Xilinx products are not designed or intended to be fail-safe, or for use in
|
30 |
|
|
// any application requiring fail-safe performance, such as life-support or
|
31 |
|
|
// safety devices or systems, Class III medical devices, nuclear facilities,
|
32 |
|
|
// applications related to the deployment of airbags, or any other
|
33 |
|
|
// applications that could lead to death, personal injury, or severe property
|
34 |
|
|
// or environmental damage (individually and collectively, "Critical
|
35 |
|
|
// Applications"). Customer assumes the sole risk and liability of any use of
|
36 |
|
|
// Xilinx products in Critical Applications, subject only to applicable laws
|
37 |
|
|
// and regulations governing limitations on product liability.
|
38 |
|
|
//
|
39 |
|
|
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS PART OF THIS FILE
|
40 |
|
|
// AT ALL TIMES.
|
41 |
|
|
//
|
42 |
|
|
//-----------------------------------------------------------------------------
|
43 |
|
|
// Project : Virtex-6 Integrated Block for PCI Express
|
44 |
|
|
// File : pcie_pipe_misc_v6.v
|
45 |
|
|
//--
|
46 |
|
|
//-- Description: Misc PIPE module for Virtex6 PCIe Block
|
47 |
|
|
//--
|
48 |
|
|
//--
|
49 |
|
|
//--
|
50 |
|
|
//--------------------------------------------------------------------------------
|
51 |
|
|
|
52 |
|
|
`timescale 1ns/1ns
|
53 |
|
|
|
54 |
|
|
module pcie_pipe_misc_v6 #
|
55 |
|
|
(
|
56 |
|
|
parameter PIPE_PIPELINE_STAGES = 0 // 0 - 0 stages, 1 - 1 stage, 2 - 2 stages
|
57 |
|
|
)
|
58 |
|
|
(
|
59 |
|
|
|
60 |
|
|
input wire pipe_tx_rcvr_det_i ,
|
61 |
|
|
input wire pipe_tx_reset_i ,
|
62 |
|
|
input wire pipe_tx_rate_i ,
|
63 |
|
|
input wire pipe_tx_deemph_i ,
|
64 |
|
|
input wire [2:0] pipe_tx_margin_i ,
|
65 |
|
|
input wire pipe_tx_swing_i ,
|
66 |
|
|
|
67 |
|
|
output wire pipe_tx_rcvr_det_o ,
|
68 |
|
|
output wire pipe_tx_reset_o ,
|
69 |
|
|
output wire pipe_tx_rate_o ,
|
70 |
|
|
output wire pipe_tx_deemph_o ,
|
71 |
|
|
output wire [2:0] pipe_tx_margin_o ,
|
72 |
|
|
output wire pipe_tx_swing_o ,
|
73 |
|
|
|
74 |
|
|
input wire pipe_clk ,
|
75 |
|
|
input wire rst_n
|
76 |
|
|
);
|
77 |
|
|
|
78 |
|
|
//******************************************************************//
|
79 |
|
|
// Reality check. //
|
80 |
|
|
//******************************************************************//
|
81 |
|
|
|
82 |
|
|
parameter TCQ = 1; // clock to out delay model
|
83 |
|
|
|
84 |
|
|
reg pipe_tx_rcvr_det_q ;
|
85 |
|
|
reg pipe_tx_reset_q ;
|
86 |
|
|
reg pipe_tx_rate_q ;
|
87 |
|
|
reg pipe_tx_deemph_q ;
|
88 |
|
|
reg [2:0] pipe_tx_margin_q ;
|
89 |
|
|
reg pipe_tx_swing_q ;
|
90 |
|
|
|
91 |
|
|
reg pipe_tx_rcvr_det_qq ;
|
92 |
|
|
reg pipe_tx_reset_qq ;
|
93 |
|
|
reg pipe_tx_rate_qq ;
|
94 |
|
|
reg pipe_tx_deemph_qq ;
|
95 |
|
|
reg [2:0] pipe_tx_margin_qq ;
|
96 |
|
|
reg pipe_tx_swing_qq ;
|
97 |
|
|
|
98 |
|
|
generate
|
99 |
|
|
|
100 |
|
|
if (PIPE_PIPELINE_STAGES == 0) begin
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
assign pipe_tx_rcvr_det_o = pipe_tx_rcvr_det_i;
|
104 |
|
|
assign pipe_tx_reset_o = pipe_tx_reset_i;
|
105 |
|
|
assign pipe_tx_rate_o = pipe_tx_rate_i;
|
106 |
|
|
assign pipe_tx_deemph_o = pipe_tx_deemph_i;
|
107 |
|
|
assign pipe_tx_margin_o = pipe_tx_margin_i;
|
108 |
|
|
assign pipe_tx_swing_o = pipe_tx_swing_i;
|
109 |
|
|
|
110 |
|
|
end else if (PIPE_PIPELINE_STAGES == 1) begin
|
111 |
|
|
|
112 |
|
|
always @(posedge pipe_clk) begin
|
113 |
|
|
|
114 |
|
|
if (rst_n) begin
|
115 |
|
|
|
116 |
|
|
pipe_tx_rcvr_det_q <= #TCQ 0;
|
117 |
|
|
pipe_tx_reset_q <= #TCQ 1'b1;
|
118 |
|
|
pipe_tx_rate_q <= #TCQ 0;
|
119 |
|
|
pipe_tx_deemph_q <= #TCQ 1'b1;
|
120 |
|
|
pipe_tx_margin_q <= #TCQ 0;
|
121 |
|
|
pipe_tx_swing_q <= #TCQ 0;
|
122 |
|
|
|
123 |
|
|
end else begin
|
124 |
|
|
|
125 |
|
|
pipe_tx_rcvr_det_q <= #TCQ pipe_tx_rcvr_det_i;
|
126 |
|
|
pipe_tx_reset_q <= #TCQ pipe_tx_reset_i;
|
127 |
|
|
pipe_tx_rate_q <= #TCQ pipe_tx_rate_i;
|
128 |
|
|
pipe_tx_deemph_q <= #TCQ pipe_tx_deemph_i;
|
129 |
|
|
pipe_tx_margin_q <= #TCQ pipe_tx_margin_i;
|
130 |
|
|
pipe_tx_swing_q <= #TCQ pipe_tx_swing_i;
|
131 |
|
|
|
132 |
|
|
end
|
133 |
|
|
|
134 |
|
|
end
|
135 |
|
|
|
136 |
|
|
assign pipe_tx_rcvr_det_o = pipe_tx_rcvr_det_q;
|
137 |
|
|
assign pipe_tx_reset_o = pipe_tx_reset_q;
|
138 |
|
|
assign pipe_tx_rate_o = pipe_tx_rate_q;
|
139 |
|
|
assign pipe_tx_deemph_o = pipe_tx_deemph_q;
|
140 |
|
|
assign pipe_tx_margin_o = pipe_tx_margin_q;
|
141 |
|
|
assign pipe_tx_swing_o = pipe_tx_swing_q;
|
142 |
|
|
|
143 |
|
|
end else if (PIPE_PIPELINE_STAGES == 2) begin
|
144 |
|
|
|
145 |
|
|
always @(posedge pipe_clk) begin
|
146 |
|
|
|
147 |
|
|
if (rst_n) begin
|
148 |
|
|
|
149 |
|
|
pipe_tx_rcvr_det_q <= #TCQ 0;
|
150 |
|
|
pipe_tx_reset_q <= #TCQ 1'b1;
|
151 |
|
|
pipe_tx_rate_q <= #TCQ 0;
|
152 |
|
|
pipe_tx_deemph_q <= #TCQ 1'b1;
|
153 |
|
|
pipe_tx_margin_q <= #TCQ 0;
|
154 |
|
|
pipe_tx_swing_q <= #TCQ 0;
|
155 |
|
|
|
156 |
|
|
pipe_tx_rcvr_det_qq <= #TCQ 0;
|
157 |
|
|
pipe_tx_reset_qq <= #TCQ 1'b1;
|
158 |
|
|
pipe_tx_rate_qq <= #TCQ 0;
|
159 |
|
|
pipe_tx_deemph_qq <= #TCQ 1'b1;
|
160 |
|
|
pipe_tx_margin_qq <= #TCQ 0;
|
161 |
|
|
pipe_tx_swing_qq <= #TCQ 0;
|
162 |
|
|
|
163 |
|
|
end else begin
|
164 |
|
|
|
165 |
|
|
pipe_tx_rcvr_det_q <= #TCQ pipe_tx_rcvr_det_i;
|
166 |
|
|
pipe_tx_reset_q <= #TCQ pipe_tx_reset_i;
|
167 |
|
|
pipe_tx_rate_q <= #TCQ pipe_tx_rate_i;
|
168 |
|
|
pipe_tx_deemph_q <= #TCQ pipe_tx_deemph_i;
|
169 |
|
|
pipe_tx_margin_q <= #TCQ pipe_tx_margin_i;
|
170 |
|
|
pipe_tx_swing_q <= #TCQ pipe_tx_swing_i;
|
171 |
|
|
|
172 |
|
|
pipe_tx_rcvr_det_qq <= #TCQ pipe_tx_rcvr_det_q;
|
173 |
|
|
pipe_tx_reset_qq <= #TCQ pipe_tx_reset_q;
|
174 |
|
|
pipe_tx_rate_qq <= #TCQ pipe_tx_rate_q;
|
175 |
|
|
pipe_tx_deemph_qq <= #TCQ pipe_tx_deemph_q;
|
176 |
|
|
pipe_tx_margin_qq <= #TCQ pipe_tx_margin_q;
|
177 |
|
|
pipe_tx_swing_qq <= #TCQ pipe_tx_swing_q;
|
178 |
|
|
|
179 |
|
|
end
|
180 |
|
|
|
181 |
|
|
end
|
182 |
|
|
|
183 |
|
|
assign pipe_tx_rcvr_det_o = pipe_tx_rcvr_det_qq;
|
184 |
|
|
assign pipe_tx_reset_o = pipe_tx_reset_qq;
|
185 |
|
|
assign pipe_tx_rate_o = pipe_tx_rate_qq;
|
186 |
|
|
assign pipe_tx_deemph_o = pipe_tx_deemph_qq;
|
187 |
|
|
assign pipe_tx_margin_o = pipe_tx_margin_qq;
|
188 |
|
|
assign pipe_tx_swing_o = pipe_tx_swing_qq;
|
189 |
|
|
|
190 |
|
|
end
|
191 |
|
|
|
192 |
|
|
endgenerate
|
193 |
|
|
|
194 |
|
|
endmodule
|