1 |
13 |
barabba |
|
2 |
|
|
|
3 |
|
|
//-----------------------------------------------------------------------------
|
4 |
|
|
//
|
5 |
|
|
// (c) Copyright 2009-2011 Xilinx, Inc. All rights reserved.
|
6 |
|
|
//
|
7 |
|
|
// This file contains confidential and proprietary information
|
8 |
|
|
// of Xilinx, Inc. and is protected under U.S. and
|
9 |
|
|
// international copyright and other intellectual property
|
10 |
|
|
// laws.
|
11 |
|
|
//
|
12 |
|
|
// DISCLAIMER
|
13 |
|
|
// This disclaimer is not a license and does not grant any
|
14 |
|
|
// rights to the materials distributed herewith. Except as
|
15 |
|
|
// otherwise provided in a valid license issued to you by
|
16 |
|
|
// Xilinx, and to the maximum extent permitted by applicable
|
17 |
|
|
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
|
18 |
|
|
// WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
|
19 |
|
|
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
|
20 |
|
|
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
|
21 |
|
|
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
|
22 |
|
|
// (2) Xilinx shall not be liable (whether in contract or tort,
|
23 |
|
|
// including negligence, or under any other theory of
|
24 |
|
|
// liability) for any loss or damage of any kind or nature
|
25 |
|
|
// related to, arising under or in connection with these
|
26 |
|
|
// materials, including for any direct, or any indirect,
|
27 |
|
|
// special, incidental, or consequential loss or damage
|
28 |
|
|
// (including loss of data, profits, goodwill, or any type of
|
29 |
|
|
// loss or damage suffered as a result of any action brought
|
30 |
|
|
// by a third party) even if such damage or loss was
|
31 |
|
|
// reasonably foreseeable or Xilinx had been advised of the
|
32 |
|
|
// possibility of the same.
|
33 |
|
|
//
|
34 |
|
|
// CRITICAL APPLICATIONS
|
35 |
|
|
// Xilinx products are not designed or intended to be fail-
|
36 |
|
|
// safe, or for use in any application requiring fail-safe
|
37 |
|
|
// performance, such as life-support or safety devices or
|
38 |
|
|
// systems, Class III medical devices, nuclear facilities,
|
39 |
|
|
// applications related to the deployment of airbags, or any
|
40 |
|
|
// other applications that could lead to death, personal
|
41 |
|
|
// injury, or severe property or environmental damage
|
42 |
|
|
// (individually and collectively, "Critical
|
43 |
|
|
// Applications"). Customer assumes the sole risk and
|
44 |
|
|
// liability of any use of Xilinx products in Critical
|
45 |
|
|
// Applications, subject only to applicable laws and
|
46 |
|
|
// regulations governing limitations on product liability.
|
47 |
|
|
//
|
48 |
|
|
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
|
49 |
|
|
// PART OF THIS FILE AT ALL TIMES.
|
50 |
|
|
//
|
51 |
|
|
//-----------------------------------------------------------------------------
|
52 |
|
|
// Project : Virtex-6 Integrated Block for PCI Express
|
53 |
|
|
// File : pci_exp_usrapp_pl.v
|
54 |
|
|
// Version : 1.7
|
55 |
|
|
//--
|
56 |
|
|
//--------------------------------------------------------------------------------
|
57 |
|
|
|
58 |
|
|
module pci_exp_usrapp_pl (
|
59 |
|
|
|
60 |
|
|
pl_initial_link_width,
|
61 |
|
|
pl_lane_reversal_mode,
|
62 |
|
|
pl_link_gen2_capable,
|
63 |
|
|
pl_link_partner_gen2_supported,
|
64 |
|
|
pl_link_upcfg_capable,
|
65 |
|
|
pl_ltssm_state,
|
66 |
|
|
pl_received_hot_rst,
|
67 |
|
|
pl_sel_link_rate,
|
68 |
|
|
pl_sel_link_width,
|
69 |
|
|
pl_directed_link_auton,
|
70 |
|
|
pl_directed_link_change,
|
71 |
|
|
pl_directed_link_speed,
|
72 |
|
|
pl_directed_link_width,
|
73 |
|
|
pl_upstream_prefer_deemph,
|
74 |
|
|
speed_change_done_n,
|
75 |
|
|
|
76 |
|
|
trn_lnk_up_n,
|
77 |
|
|
trn_clk,
|
78 |
|
|
trn_reset_n
|
79 |
|
|
|
80 |
|
|
);
|
81 |
|
|
|
82 |
|
|
|
83 |
|
|
input [2:0] pl_initial_link_width;
|
84 |
|
|
input [1:0] pl_lane_reversal_mode;
|
85 |
|
|
input pl_link_gen2_capable;
|
86 |
|
|
input pl_link_partner_gen2_supported;
|
87 |
|
|
input pl_link_upcfg_capable;
|
88 |
|
|
input [5:0] pl_ltssm_state;
|
89 |
|
|
input pl_received_hot_rst;
|
90 |
|
|
input pl_sel_link_rate;
|
91 |
|
|
input [1:0] pl_sel_link_width;
|
92 |
|
|
output pl_directed_link_auton;
|
93 |
|
|
output [1:0] pl_directed_link_change;
|
94 |
|
|
output pl_directed_link_speed;
|
95 |
|
|
output [1:0] pl_directed_link_width;
|
96 |
|
|
output pl_upstream_prefer_deemph;
|
97 |
|
|
output speed_change_done_n;
|
98 |
|
|
|
99 |
|
|
|
100 |
|
|
input trn_lnk_up_n;
|
101 |
|
|
input trn_clk;
|
102 |
|
|
input trn_reset_n;
|
103 |
|
|
|
104 |
|
|
parameter Tcq = 1;
|
105 |
|
|
parameter LINK_CAP_MAX_LINK_SPEED = 4'h1;
|
106 |
|
|
|
107 |
|
|
reg pl_directed_link_auton;
|
108 |
|
|
reg [1:0] pl_directed_link_change;
|
109 |
|
|
reg pl_directed_link_speed;
|
110 |
|
|
reg [1:0] pl_directed_link_width;
|
111 |
|
|
reg pl_upstream_prefer_deemph;
|
112 |
|
|
reg speed_change_done_n;
|
113 |
|
|
|
114 |
|
|
initial begin
|
115 |
|
|
|
116 |
|
|
pl_directed_link_auton <= 1'b0;
|
117 |
|
|
pl_directed_link_change <= 2'b0;
|
118 |
|
|
pl_directed_link_speed <= 1'b0;
|
119 |
|
|
pl_directed_link_width <= 2'b0;
|
120 |
|
|
pl_upstream_prefer_deemph <= 1'b0;
|
121 |
|
|
speed_change_done_n <= 1'b1;
|
122 |
|
|
|
123 |
|
|
if (LINK_CAP_MAX_LINK_SPEED == 4'h2) begin
|
124 |
|
|
|
125 |
|
|
wait (trn_lnk_up_n == 1'b0);
|
126 |
|
|
|
127 |
|
|
pl_directed_link_speed <= 1'b1;
|
128 |
|
|
pl_directed_link_change <= 2'b10;
|
129 |
|
|
|
130 |
|
|
wait (pl_ltssm_state == 6'h20);
|
131 |
|
|
|
132 |
|
|
pl_directed_link_speed <= 1'b0;
|
133 |
|
|
pl_directed_link_change <= 2'b00;
|
134 |
|
|
|
135 |
|
|
wait (pl_sel_link_rate == 1'h1);
|
136 |
|
|
|
137 |
|
|
speed_change_done_n <= 1'b0;
|
138 |
|
|
|
139 |
|
|
end
|
140 |
|
|
|
141 |
|
|
end
|
142 |
|
|
|
143 |
|
|
endmodule // pci_exp_usrapp_pl
|
144 |
|
|
|