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 : xilinx_pcie_2_0_rport_v6.v
|
52 |
|
|
// Version : 1.7
|
53 |
|
|
//--
|
54 |
|
|
//--------------------------------------------------------------------------------
|
55 |
|
|
|
56 |
|
|
`timescale 1ns / 1ps
|
57 |
|
|
|
58 |
|
|
`include "board_common.v"
|
59 |
|
|
|
60 |
|
|
module xilinx_pcie_2_0_rport_v6 # (
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
parameter REF_CLK_FREQ = 0, // 0 - 100 MHz, 1 - 125 MHz, 2 - 250 MHz
|
64 |
|
|
parameter ALLOW_X8_GEN2 = "FALSE",
|
65 |
|
|
parameter PL_FAST_TRAIN = "FALSE",
|
66 |
|
|
parameter LINK_CAP_MAX_LINK_WIDTH = 6'h08,
|
67 |
|
|
parameter DEVICE_ID = 16'h506F,
|
68 |
|
|
parameter LINK_CAP_MAX_LINK_SPEED = 4'h1,
|
69 |
|
|
parameter LINK_CTRL2_TARGET_LINK_SPEED = 4'h1,
|
70 |
|
|
parameter DEV_CAP_MAX_PAYLOAD_SUPPORTED = 1,
|
71 |
|
|
parameter USER_CLK_FREQ = 3,
|
72 |
|
|
parameter VC0_TX_LASTPACKET = 28,
|
73 |
|
|
parameter VC0_RX_RAM_LIMIT = 13'h03ff,
|
74 |
|
|
parameter VC0_CPL_INFINITE = "TRUE",
|
75 |
|
|
parameter VC0_TOTAL_CREDITS_PD = 154,
|
76 |
|
|
parameter VC0_TOTAL_CREDITS_CD = 154
|
77 |
|
|
|
78 |
|
|
)
|
79 |
|
|
(
|
80 |
|
|
|
81 |
|
|
input sys_clk,
|
82 |
|
|
input sys_reset_n,
|
83 |
|
|
|
84 |
|
|
input [0:0] pci_exp_rxn, pci_exp_rxp,
|
85 |
|
|
output [0:0] pci_exp_txn, pci_exp_txp
|
86 |
|
|
|
87 |
|
|
);
|
88 |
|
|
|
89 |
|
|
// Local Wires
|
90 |
|
|
// Common
|
91 |
|
|
wire trn_clk;
|
92 |
|
|
wire trn_reset_n;
|
93 |
|
|
wire trn_lnk_up_n;
|
94 |
|
|
|
95 |
|
|
// Tx
|
96 |
|
|
wire [63:0] trn_td;
|
97 |
|
|
wire [7:0] trn_trem_n;
|
98 |
|
|
wire trn_tsof_n;
|
99 |
|
|
wire trn_teof_n;
|
100 |
|
|
wire trn_tsrc_rdy_n;
|
101 |
|
|
wire trn_tdst_rdy_n;
|
102 |
|
|
wire trn_tsrc_dsc_n;
|
103 |
|
|
wire trn_terrfwd_n;
|
104 |
|
|
wire trn_tdst_dsc_n;
|
105 |
|
|
wire [5:0] trn_tbuf_av;
|
106 |
|
|
|
107 |
|
|
// Rx
|
108 |
|
|
wire [63:0] trn_rd;
|
109 |
|
|
wire trn_rrem_n;
|
110 |
|
|
wire trn_rsof_n;
|
111 |
|
|
wire trn_reof_n;
|
112 |
|
|
wire trn_rsrc_rdy_n;
|
113 |
|
|
wire trn_rsrc_dsc_n;
|
114 |
|
|
wire trn_rdst_rdy_n;
|
115 |
|
|
wire trn_rerrfwd_n;
|
116 |
|
|
wire trn_rnp_ok_n;
|
117 |
|
|
wire [6:0] trn_rbar_hit_n;
|
118 |
|
|
wire [7:0] trn_rfc_nph_av;
|
119 |
|
|
wire [11:0] trn_rfc_npd_av;
|
120 |
|
|
wire [7:0] trn_rfc_ph_av;
|
121 |
|
|
wire [11:0] trn_rfc_pd_av;
|
122 |
|
|
wire [7:0] trn_rfc_cplh_av;
|
123 |
|
|
wire [11:0] trn_rfc_cpld_av;
|
124 |
|
|
|
125 |
|
|
wire [31:0] cfg_do;
|
126 |
|
|
wire [31:0] cfg_di;
|
127 |
|
|
wire [3:0] cfg_byte_en_n;
|
128 |
|
|
wire [9:0] cfg_dwaddr;
|
129 |
|
|
wire [47:0] cfg_err_tlp_cpl_header;
|
130 |
|
|
wire cfg_wr_en_n;
|
131 |
|
|
wire cfg_rd_wr_done_n;
|
132 |
|
|
wire cfg_rd_en_n;
|
133 |
|
|
wire cfg_err_cor_n;
|
134 |
|
|
wire cfg_err_ur_n;
|
135 |
|
|
wire cfg_err_ecrc_n;
|
136 |
|
|
wire cfg_err_cpl_timeout_n;
|
137 |
|
|
wire cfg_err_cpl_abort_n;
|
138 |
|
|
wire cfg_err_cpl_unexpect_n;
|
139 |
|
|
wire cfg_err_posted_n;
|
140 |
|
|
wire cfg_interrupt_n;
|
141 |
|
|
wire cfg_interrupt_rdy_n;
|
142 |
|
|
wire cfg_pm_send_pme_to_n;
|
143 |
|
|
wire [15:0] cfg_status;
|
144 |
|
|
wire [15:0] cfg_command;
|
145 |
|
|
wire [15:0] cfg_dstatus;
|
146 |
|
|
wire [15:0] cfg_dcommand;
|
147 |
|
|
wire [15:0] cfg_lstatus;
|
148 |
|
|
wire [15:0] cfg_lcommand;
|
149 |
|
|
wire cfg_rdy_n;
|
150 |
|
|
wire [2:0] cfg_pcie_link_state_n;
|
151 |
|
|
wire cfg_trn_pending_n;
|
152 |
|
|
|
153 |
|
|
wire cfg_msg_received;
|
154 |
|
|
wire [15:0] cfg_msg_data;
|
155 |
|
|
wire cfg_msg_received_err_cor;
|
156 |
|
|
wire cfg_msg_received_err_non_fatal;
|
157 |
|
|
wire cfg_msg_received_err_fatal;
|
158 |
|
|
wire cfg_msg_received_pme_to_ack;
|
159 |
|
|
wire cfg_msg_received_assert_inta;
|
160 |
|
|
wire cfg_msg_received_assert_intb;
|
161 |
|
|
wire cfg_msg_received_assert_intc;
|
162 |
|
|
wire cfg_msg_received_assert_intd;
|
163 |
|
|
wire cfg_msg_received_deassert_inta;
|
164 |
|
|
wire cfg_msg_received_deassert_intb;
|
165 |
|
|
wire cfg_msg_received_deassert_intc;
|
166 |
|
|
wire cfg_msg_received_deassert_intd;
|
167 |
|
|
|
168 |
|
|
wire [2:0] pl_initial_link_width;
|
169 |
|
|
wire [1:0] pl_lane_reversal_mode;
|
170 |
|
|
wire pl_link_gen2_capable;
|
171 |
|
|
wire pl_link_partner_gen2_supported;
|
172 |
|
|
wire pl_link_upcfg_capable;
|
173 |
|
|
wire [5:0] pl_ltssm_state;
|
174 |
|
|
wire pl_sel_link_rate;
|
175 |
|
|
wire [1:0] pl_sel_link_width;
|
176 |
|
|
wire pl_directed_link_auton;
|
177 |
|
|
wire [1:0] pl_directed_link_change;
|
178 |
|
|
wire pl_directed_link_speed;
|
179 |
|
|
wire [1:0] pl_directed_link_width;
|
180 |
|
|
wire pl_upstream_prefer_deemph;
|
181 |
|
|
|
182 |
|
|
wire speed_change_done_n;
|
183 |
|
|
|
184 |
|
|
|
185 |
|
|
// PCI-Express FPGA Endpoint Instance
|
186 |
|
|
|
187 |
|
|
pcie_2_0_rport_v6 # (
|
188 |
|
|
|
189 |
|
|
.ALLOW_X8_GEN2(ALLOW_X8_GEN2),
|
190 |
|
|
.REF_CLK_FREQ(REF_CLK_FREQ),
|
191 |
|
|
.PL_FAST_TRAIN(PL_FAST_TRAIN),
|
192 |
|
|
|
193 |
|
|
.LINK_CAP_MAX_LINK_WIDTH(LINK_CAP_MAX_LINK_WIDTH),
|
194 |
|
|
.DEVICE_ID(DEVICE_ID),
|
195 |
|
|
|
196 |
|
|
.LINK_CAP_MAX_LINK_SPEED(LINK_CAP_MAX_LINK_SPEED),
|
197 |
|
|
.LINK_CTRL2_TARGET_LINK_SPEED(LINK_CTRL2_TARGET_LINK_SPEED),
|
198 |
|
|
|
199 |
|
|
.DEV_CAP_MAX_PAYLOAD_SUPPORTED(DEV_CAP_MAX_PAYLOAD_SUPPORTED),
|
200 |
|
|
.USER_CLK_FREQ(USER_CLK_FREQ),
|
201 |
|
|
.VC0_TX_LASTPACKET(VC0_TX_LASTPACKET),
|
202 |
|
|
.VC0_RX_RAM_LIMIT(VC0_RX_RAM_LIMIT),
|
203 |
|
|
.VC0_CPL_INFINITE(VC0_CPL_INFINITE),
|
204 |
|
|
.VC0_TOTAL_CREDITS_PD(VC0_TOTAL_CREDITS_PD),
|
205 |
|
|
.VC0_TOTAL_CREDITS_CD(VC0_TOTAL_CREDITS_CD)
|
206 |
|
|
|
207 |
|
|
)
|
208 |
|
|
rport (
|
209 |
|
|
|
210 |
|
|
//
|
211 |
|
|
// PCI Express (PCI_EXP) Interface
|
212 |
|
|
//
|
213 |
|
|
|
214 |
|
|
.pci_exp_txp(pci_exp_txp),
|
215 |
|
|
.pci_exp_txn(pci_exp_txn),
|
216 |
|
|
.pci_exp_rxp(pci_exp_rxp),
|
217 |
|
|
.pci_exp_rxn(pci_exp_rxn),
|
218 |
|
|
|
219 |
|
|
//
|
220 |
|
|
// Transaction (TRN) Interface
|
221 |
|
|
//
|
222 |
|
|
|
223 |
|
|
.trn_clk(trn_clk),
|
224 |
|
|
.trn_reset_n(trn_reset_n),
|
225 |
|
|
.trn_lnk_up_n(trn_lnk_up_n),
|
226 |
|
|
|
227 |
|
|
// Tx
|
228 |
|
|
.trn_td(trn_td),
|
229 |
|
|
.trn_trem_n(trn_trem_n[0]),
|
230 |
|
|
.trn_tsof_n(trn_tsof_n),
|
231 |
|
|
.trn_teof_n(trn_teof_n),
|
232 |
|
|
.trn_tsrc_rdy_n(trn_tsrc_rdy_n),
|
233 |
|
|
.trn_tdst_rdy_n(trn_tdst_rdy_n),
|
234 |
|
|
.trn_tsrc_dsc_n(trn_tsrc_dsc_n),
|
235 |
|
|
.trn_terrfwd_n(trn_terrfwd_n),
|
236 |
|
|
.trn_terr_drop_n(trn_tdst_dsc_n),
|
237 |
|
|
.trn_tbuf_av(trn_tbuf_av),
|
238 |
|
|
.trn_tcfg_gnt_n(1'b0),
|
239 |
|
|
.trn_tstr_n(1'b1),
|
240 |
|
|
.trn_tcfg_req_n(),
|
241 |
|
|
|
242 |
|
|
// Rx
|
243 |
|
|
.trn_rd(trn_rd),
|
244 |
|
|
.trn_rrem_n(trn_rrem_n),
|
245 |
|
|
.trn_rsof_n(trn_rsof_n),
|
246 |
|
|
.trn_reof_n(trn_reof_n),
|
247 |
|
|
.trn_rsrc_rdy_n(trn_rsrc_rdy_n),
|
248 |
|
|
.trn_rsrc_dsc_n(trn_rsrc_dsc_n),
|
249 |
|
|
.trn_rdst_rdy_n(trn_rdst_rdy_n),
|
250 |
|
|
.trn_rerrfwd_n(trn_rerrfwd_n),
|
251 |
|
|
.trn_rnp_ok_n(trn_rnp_ok_n),
|
252 |
|
|
.trn_rbar_hit_n(trn_rbar_hit_n),
|
253 |
|
|
.trn_recrc_err_n(),
|
254 |
|
|
|
255 |
|
|
.trn_fc_cpld(),
|
256 |
|
|
.trn_fc_cplh(),
|
257 |
|
|
.trn_fc_npd(),
|
258 |
|
|
.trn_fc_nph(),
|
259 |
|
|
.trn_fc_pd(),
|
260 |
|
|
.trn_fc_ph(),
|
261 |
|
|
.trn_fc_sel(3'b0),
|
262 |
|
|
|
263 |
|
|
|
264 |
|
|
//
|
265 |
|
|
// Host (CFG) Interface
|
266 |
|
|
//
|
267 |
|
|
|
268 |
|
|
.cfg_do(cfg_do),
|
269 |
|
|
.cfg_rd_wr_done_n(cfg_rd_wr_done_n),
|
270 |
|
|
.cfg_di(cfg_di),
|
271 |
|
|
.cfg_byte_en_n(cfg_byte_en_n),
|
272 |
|
|
.cfg_dwaddr(cfg_dwaddr),
|
273 |
|
|
.cfg_wr_en_n(cfg_wr_en_n),
|
274 |
|
|
.cfg_wr_rw1c_as_rw_n(1'b1),
|
275 |
|
|
.cfg_rd_en_n(cfg_rd_en_n),
|
276 |
|
|
|
277 |
|
|
.cfg_err_cor_n(cfg_err_cor_n),
|
278 |
|
|
.cfg_err_ur_n(cfg_err_ur_n),
|
279 |
|
|
.cfg_err_ecrc_n(cfg_err_ecrc_n),
|
280 |
|
|
.cfg_err_cpl_timeout_n(cfg_err_cpl_timeout_n),
|
281 |
|
|
.cfg_err_cpl_abort_n(cfg_err_cpl_abort_n),
|
282 |
|
|
.cfg_err_cpl_unexpect_n(cfg_err_cpl_unexpect_n),
|
283 |
|
|
.cfg_err_posted_n(cfg_err_posted_n),
|
284 |
|
|
.cfg_err_tlp_cpl_header(cfg_err_tlp_cpl_header),
|
285 |
|
|
|
286 |
|
|
.cfg_interrupt_n(cfg_interrupt_n),
|
287 |
|
|
.cfg_interrupt_rdy_n(cfg_interrupt_rdy_n),
|
288 |
|
|
|
289 |
|
|
.cfg_pm_send_pme_to_n( cfg_pm_send_pme_to_n ),
|
290 |
|
|
|
291 |
|
|
.cfg_status(cfg_status),
|
292 |
|
|
.cfg_command(cfg_command),
|
293 |
|
|
.cfg_dstatus(cfg_dstatus),
|
294 |
|
|
.cfg_dcommand(cfg_dcommand),
|
295 |
|
|
.cfg_lstatus(cfg_lstatus),
|
296 |
|
|
.cfg_lcommand(cfg_lcommand),
|
297 |
|
|
|
298 |
|
|
.cfg_pcie_link_state_n(cfg_pcie_link_state_n),
|
299 |
|
|
.cfg_trn_pending_n(cfg_trn_pending_n),
|
300 |
|
|
|
301 |
|
|
.cfg_dsn(64'h0),
|
302 |
|
|
.cfg_err_locked_n(1'b1),
|
303 |
|
|
.cfg_interrupt_assert_n(1'b1),
|
304 |
|
|
.cfg_interrupt_di(8'h0),
|
305 |
|
|
|
306 |
|
|
.cfg_err_cpl_rdy_n(),
|
307 |
|
|
.cfg_interrupt_do(),
|
308 |
|
|
.cfg_interrupt_mmenable(),
|
309 |
|
|
.cfg_interrupt_msienable(),
|
310 |
|
|
.cfg_interrupt_msixenable(),
|
311 |
|
|
.cfg_interrupt_msixfm(),
|
312 |
|
|
.cfg_dcommand2(),
|
313 |
|
|
|
314 |
|
|
.cfg_pmcsr_pme_en(),
|
315 |
|
|
.cfg_pmcsr_pme_status(),
|
316 |
|
|
.cfg_pmcsr_powerstate(),
|
317 |
|
|
|
318 |
|
|
.cfg_msg_received(cfg_msg_received),
|
319 |
|
|
.cfg_msg_data(cfg_msg_data),
|
320 |
|
|
.cfg_msg_received_err_cor(cfg_msg_received_err_cor),
|
321 |
|
|
.cfg_msg_received_err_non_fatal(cfg_msg_received_err_non_fatal),
|
322 |
|
|
.cfg_msg_received_err_fatal(cfg_msg_received_err_fatal),
|
323 |
|
|
.cfg_msg_received_pme_to_ack(cfg_msg_received_pme_to_ack),
|
324 |
|
|
.cfg_msg_received_assert_inta(cfg_msg_received_assert_inta),
|
325 |
|
|
.cfg_msg_received_assert_intb(cfg_msg_received_assert_intb),
|
326 |
|
|
.cfg_msg_received_assert_intc(cfg_msg_received_assert_intc),
|
327 |
|
|
.cfg_msg_received_assert_intd(cfg_msg_received_assert_intd),
|
328 |
|
|
.cfg_msg_received_deassert_inta(cfg_msg_received_deassert_inta),
|
329 |
|
|
.cfg_msg_received_deassert_intb(cfg_msg_received_deassert_intb),
|
330 |
|
|
.cfg_msg_received_deassert_intc(cfg_msg_received_deassert_intc),
|
331 |
|
|
.cfg_msg_received_deassert_intd(cfg_msg_received_deassert_intd),
|
332 |
|
|
|
333 |
|
|
.cfg_ds_bus_number(8'h0),
|
334 |
|
|
.cfg_ds_device_number(5'h0),
|
335 |
|
|
|
336 |
|
|
// PL Control and Status
|
337 |
|
|
|
338 |
|
|
.pl_initial_link_width( pl_initial_link_width ),
|
339 |
|
|
.pl_lane_reversal_mode( pl_lane_reversal_mode ),
|
340 |
|
|
.pl_link_gen2_capable( pl_link_gen2_capable ),
|
341 |
|
|
.pl_link_partner_gen2_supported( pl_link_partner_gen2_supported ),
|
342 |
|
|
.pl_link_upcfg_capable( pl_link_upcfg_capable ),
|
343 |
|
|
.pl_ltssm_state( pl_ltssm_state ),
|
344 |
|
|
.pl_sel_link_rate( pl_sel_link_rate ),
|
345 |
|
|
.pl_sel_link_width( pl_sel_link_width ),
|
346 |
|
|
.pl_directed_link_auton( pl_directed_link_auton ),
|
347 |
|
|
.pl_directed_link_change( pl_directed_link_change ),
|
348 |
|
|
.pl_directed_link_speed( pl_directed_link_speed ),
|
349 |
|
|
.pl_directed_link_width( pl_directed_link_width ),
|
350 |
|
|
.pl_upstream_prefer_deemph( pl_upstream_prefer_deemph ),
|
351 |
|
|
|
352 |
|
|
.pl_transmit_hot_rst(1'b0),
|
353 |
|
|
|
354 |
|
|
// PCIe DRP
|
355 |
|
|
.pcie_drp_do(),
|
356 |
|
|
.pcie_drp_drdy(),
|
357 |
|
|
.pcie_drp_clk(1'b0),
|
358 |
|
|
.pcie_drp_den(1'b0),
|
359 |
|
|
.pcie_drp_dwe(1'b0),
|
360 |
|
|
.pcie_drp_daddr(9'd0),
|
361 |
|
|
.pcie_drp_di(16'h0),
|
362 |
|
|
|
363 |
|
|
// System (SYS) Interface
|
364 |
|
|
|
365 |
|
|
.sys_clk(sys_clk),
|
366 |
|
|
.sys_reset_n(sys_reset_n)
|
367 |
|
|
|
368 |
|
|
);
|
369 |
|
|
|
370 |
|
|
// User Application Instances
|
371 |
|
|
|
372 |
|
|
// Rx User Application Interface
|
373 |
|
|
|
374 |
|
|
pci_exp_usrapp_rx rx_usrapp (
|
375 |
|
|
|
376 |
|
|
.trn_clk(trn_clk),
|
377 |
|
|
.trn_reset_n(trn_reset_n),
|
378 |
|
|
.trn_lnk_up_n(trn_lnk_up_n),
|
379 |
|
|
|
380 |
|
|
.trn_rd(trn_rd),
|
381 |
|
|
.trn_rrem_n(trn_rrem_n ? 8'h0F : 8'h00 ),
|
382 |
|
|
.trn_rsof_n(trn_rsof_n),
|
383 |
|
|
.trn_reof_n(trn_reof_n),
|
384 |
|
|
.trn_rsrc_rdy_n(trn_rsrc_rdy_n),
|
385 |
|
|
.trn_rsrc_dsc_n(trn_rsrc_dsc_n),
|
386 |
|
|
.trn_rdst_rdy_n(trn_rdst_rdy_n),
|
387 |
|
|
.trn_rerrfwd_n(trn_rerrfwd_n),
|
388 |
|
|
.trn_rnp_ok_n(trn_rnp_ok_n),
|
389 |
|
|
.trn_rbar_hit_n(trn_rbar_hit_n)
|
390 |
|
|
|
391 |
|
|
);
|
392 |
|
|
|
393 |
|
|
// Tx User Application Interface
|
394 |
|
|
|
395 |
|
|
pci_exp_usrapp_tx # (
|
396 |
|
|
|
397 |
|
|
.LINK_CAP_MAX_LINK_SPEED(LINK_CAP_MAX_LINK_SPEED)
|
398 |
|
|
|
399 |
|
|
)
|
400 |
|
|
tx_usrapp (
|
401 |
|
|
|
402 |
|
|
.trn_clk(trn_clk),
|
403 |
|
|
.trn_reset_n(trn_reset_n),
|
404 |
|
|
.trn_lnk_up_n(trn_lnk_up_n),
|
405 |
|
|
|
406 |
|
|
.trn_td(trn_td),
|
407 |
|
|
.trn_trem_n(trn_trem_n),
|
408 |
|
|
.trn_tsof_n(trn_tsof_n),
|
409 |
|
|
.trn_teof_n(trn_teof_n),
|
410 |
|
|
.trn_terrfwd_n(trn_terrfwd_n),
|
411 |
|
|
.trn_tsrc_rdy_n(trn_tsrc_rdy_n),
|
412 |
|
|
.trn_tdst_rdy_n(trn_tdst_rdy_n),
|
413 |
|
|
.trn_tsrc_dsc_n(trn_tsrc_dsc_n),
|
414 |
|
|
.trn_tdst_dsc_n(trn_tdst_dsc_n),
|
415 |
|
|
.trn_tbuf_av(trn_tbuf_av),
|
416 |
|
|
.speed_change_done_n(speed_change_done_n)
|
417 |
|
|
|
418 |
|
|
);
|
419 |
|
|
|
420 |
|
|
// Cfg UsrApp
|
421 |
|
|
|
422 |
|
|
pci_exp_usrapp_cfg cfg_usrapp (
|
423 |
|
|
|
424 |
|
|
|
425 |
|
|
.trn_clk(trn_clk),
|
426 |
|
|
.trn_reset_n(trn_reset_n),
|
427 |
|
|
|
428 |
|
|
.cfg_do(cfg_do),
|
429 |
|
|
.cfg_di(cfg_di),
|
430 |
|
|
.cfg_byte_en_n(cfg_byte_en_n),
|
431 |
|
|
.cfg_dwaddr(cfg_dwaddr),
|
432 |
|
|
.cfg_wr_en_n(cfg_wr_en_n),
|
433 |
|
|
.cfg_rd_en_n(cfg_rd_en_n),
|
434 |
|
|
.cfg_rd_wr_done_n(cfg_rd_wr_done_n),
|
435 |
|
|
|
436 |
|
|
.cfg_err_cor_n(cfg_err_cor_n),
|
437 |
|
|
.cfg_err_ur_n(cfg_err_ur_n),
|
438 |
|
|
.cfg_err_ecrc_n(cfg_err_ecrc_n),
|
439 |
|
|
.cfg_err_cpl_timeout_n(cfg_err_cpl_timeout_n),
|
440 |
|
|
.cfg_err_cpl_abort_n(cfg_err_cpl_abort_n),
|
441 |
|
|
.cfg_err_cpl_unexpect_n(cfg_err_cpl_unexpect_n),
|
442 |
|
|
.cfg_err_posted_n(cfg_err_posted_n),
|
443 |
|
|
.cfg_err_tlp_cpl_header(cfg_err_tlp_cpl_header),
|
444 |
|
|
.cfg_interrupt_n(cfg_interrupt_n),
|
445 |
|
|
.cfg_interrupt_rdy_n(cfg_interrupt_rdy_n),
|
446 |
|
|
.cfg_turnoff_ok_n(),
|
447 |
|
|
.cfg_pm_wake_n(),
|
448 |
|
|
.cfg_to_turnoff_n(1'b1),
|
449 |
|
|
.cfg_bus_number(8'h0),
|
450 |
|
|
.cfg_device_number(5'h0),
|
451 |
|
|
.cfg_function_number(3'h0),
|
452 |
|
|
.cfg_status(cfg_status),
|
453 |
|
|
.cfg_command(cfg_command),
|
454 |
|
|
.cfg_dstatus(cfg_dstatus),
|
455 |
|
|
.cfg_dcommand(cfg_dcommand),
|
456 |
|
|
.cfg_lstatus(cfg_lstatus),
|
457 |
|
|
.cfg_lcommand(cfg_lcommand),
|
458 |
|
|
.cfg_pcie_link_state_n(cfg_pcie_link_state_n),
|
459 |
|
|
.cfg_trn_pending_n(cfg_trn_pending_n)
|
460 |
|
|
|
461 |
|
|
);
|
462 |
|
|
|
463 |
|
|
// Common UsrApp
|
464 |
|
|
|
465 |
|
|
pci_exp_usrapp_com com_usrapp ();
|
466 |
|
|
|
467 |
|
|
// PL UsrApp
|
468 |
|
|
|
469 |
|
|
pci_exp_usrapp_pl # (
|
470 |
|
|
.LINK_CAP_MAX_LINK_SPEED(LINK_CAP_MAX_LINK_SPEED)
|
471 |
|
|
)
|
472 |
|
|
pl_usrapp (
|
473 |
|
|
|
474 |
|
|
.pl_initial_link_width( pl_initial_link_width ),
|
475 |
|
|
.pl_lane_reversal_mode( pl_lane_reversal_mode ),
|
476 |
|
|
.pl_link_gen2_capable( pl_link_gen2_capable ),
|
477 |
|
|
.pl_link_partner_gen2_supported( pl_link_partner_gen2_supported ),
|
478 |
|
|
.pl_link_upcfg_capable( pl_link_upcfg_capable ),
|
479 |
|
|
.pl_ltssm_state( pl_ltssm_state ),
|
480 |
|
|
.pl_received_hot_rst( 1'b0 ),
|
481 |
|
|
.pl_sel_link_rate( pl_sel_link_rate ),
|
482 |
|
|
.pl_sel_link_width( pl_sel_link_width ),
|
483 |
|
|
.pl_directed_link_auton( pl_directed_link_auton ),
|
484 |
|
|
.pl_directed_link_change( pl_directed_link_change ),
|
485 |
|
|
.pl_directed_link_speed( pl_directed_link_speed ),
|
486 |
|
|
.pl_directed_link_width( pl_directed_link_width ),
|
487 |
|
|
.pl_upstream_prefer_deemph( pl_upstream_prefer_deemph ),
|
488 |
|
|
.speed_change_done_n(speed_change_done_n),
|
489 |
|
|
|
490 |
|
|
.trn_lnk_up_n( trn_lnk_up_n ),
|
491 |
|
|
.trn_clk( trn_clk ),
|
492 |
|
|
.trn_reset_n( trn_reset_n )
|
493 |
|
|
|
494 |
|
|
);
|
495 |
|
|
|
496 |
|
|
|
497 |
|
|
endmodule
|
498 |
|
|
|