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