Commit 2bafae64 authored by Adrian Byszuk's avatar Adrian Byszuk

Incorporate Xilinx's PCIe Root Port model for simulation

parent 230d9e1e
//-----------------------------------------------------------------------------
//
// (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
// laws.
//
// DISCLAIMER
// This disclaimer is not a license and does not grant any
// rights to the materials distributed herewith. Except as
// otherwise provided in a valid license issued to you by
// Xilinx, and to the maximum extent permitted by applicable
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
// WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
// (2) Xilinx shall not be liable (whether in contract or tort,
// including negligence, or under any other theory of
// liability) for any loss or damage of any kind or nature
// related to, arising under or in connection with these
// materials, including for any direct, or any indirect,
// special, incidental, or consequential loss or damage
// (including loss of data, profits, goodwill, or any type of
// loss or damage suffered as a result of any action brought
// by a third party) even if such damage or loss was
// reasonably foreseeable or Xilinx had been advised of the
// possibility of the same.
//
// CRITICAL APPLICATIONS
// Xilinx products are not designed or intended to be fail-
// safe, or for use in any application requiring fail-safe
// performance, such as life-support or safety devices or
// systems, Class III medical devices, nuclear facilities,
// applications related to the deployment of airbags, or any
// other applications that could lead to death, personal
// injury, or severe property or environmental damage
// (individually and collectively, "Critical
// Applications"). Customer assumes the sole risk and
// liability of any use of Xilinx products in Critical
// Applications, subject only to applicable laws and
// regulations governing limitations on product liability.
//
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
// PART OF THIS FILE AT ALL TIMES.
//
//-----------------------------------------------------------------------------
// Project : Series-7 Integrated Block for PCI Express
// File : board_common.v
// Version : 1.7
//--
//--------------------------------------------------------------------------------
`timescale 1ns/1ns
`define IO_TRUE 1
`define IO_FALSE 0
`define TX_TASKS board.RP.tx_usrapp
// Endpoint Sys clock clock frequency 100 MHz -> half clock -> 5000 pS
`define SYS_CLK_COR_HALF_CLK_PERIOD 5000
// Downstrean Port Sys clock clock frequency 250 MHz -> half clock -> 2000 pS
`define SYS_CLK_DSPORT_HALF_CLK_PERIOD 2000
`define RX_LOG 0
`define TX_LOG 1
// PCI Express TLP Types constants
`define PCI_EXP_MEM_READ32 7'b0000000
`define PCI_EXP_IO_READ 7'b0000010
`define PCI_EXP_CFG_READ0 7'b0000100
`define PCI_EXP_COMPLETION_WO_DATA 7'b0001010
`define PCI_EXP_MEM_READ64 7'b0100000
`define PCI_EXP_MSG_NODATA 7'b0110xxx
`define PCI_EXP_MEM_WRITE32 7'b1000000
`define PCI_EXP_IO_WRITE 7'b1000010
`define PCI_EXP_CFG_WRITE0 7'b1000100
`define PCI_EXP_COMPLETION_DATA 7'b1001010
`define PCI_EXP_MEM_WRITE64 7'b1100000
`define PCI_EXP_MSG_DATA 7'b1110xxx
`define TRN_RX_TIMEOUT 5000
//////////////////
// tf64_pcie_exi defines
/////////////////
//`define RANDOM_SEQUENCE
/* Time parameters */
`define T_DELAY_AFTER 0.0
`define T_DELTA 0.1
`define T_PIO_INTERVAL 50.0
`define T_DMA_INTERVAL 300.0
`define T_RX_NO_FC_PERIOD 1900000.0
`define T_TX_NO_FC_PERIOD 1500000.0
/* Memory size for simulation */
`define C_ARRAY_DIMENSION 4096
/* Start indices */
`define PIO_START_INDEX 'H0300
`define DMA_START_INDEX 'H0000
/* Request completion boundary */
`define C_RCB_16_DW 'H10
`define C_RCB_32_DW 'H20
/* BAR */
`define C_BAR0_HIT 7'H01
`define C_BAR1_HIT 7'H02
`define C_BAR2_HIT 7'H03
`define C_BAR3_HIT 7'H04
`define C_BAR4_HIT 7'H05
`define C_BAR5_HIT 7'H06
`define C_BAR6_HIT 7'H07
`define C_NO_BAR_HIT 7'H00
/* Requester ID and Completer ID */
`define C_HOST_WRREQ_ID 16'H0ABC
`define C_HOST_RDREQ_ID 16'HE1E2
`define C_HOST_CPLD_ID 16'HC01D
/* 1st header */
`define HEADER0_MWR3_ 32'H40000000
`define HEADER0_MWR4_ 32'H60000000
`define HEADER0_MRD3_ 32'H00000000
`define HEADER0_MRD4_ 32'H20000000
`define HEADER0_CPLD 32'H4A000000
`define HEADER0_CPL 32'H0A000000
`define HEADER0_MSG 32'H34000001
/* Message codes */
`define C_MSG_CODE_INTA 8'H20
`define C_MSG_CODE_INTA_N 8'H24
/* Payload type */
`define USE_PRIVATE 1
`define USE_PUBLIC 0
/* General registers */
`define C_ADDR_VERSION 32'H0000
`define C_ADDR_IRQ_STAT 32'H0008
`define C_ADDR_IRQ_EN 32'H0010
`define C_ADDR_GSR 32'H0020
`define C_ADDR_GCR 32'H0028
/* Control registers for special ports */
`define C_ADDR_MRD_CTRL 32'H0074
`define C_ADDR_TX_CTRL 32'H0078
`define C_ADDR_ICAP 32'H007C
`define C_ADDR_EB_STACON 32'H0090
/* Downstream DMA channel registers */
`define C_ADDR_DMA_DS_PAH 32'H0050
`define C_ADDR_DMA_DS_CTRL 32'H006C
`define C_ADDR_DMA_DS_STA 32'H0070
/* Upstream DMA channel registers */
`define C_ADDR_DMA_US_PAH 32'H002C
`define C_ADDR_DMA_US_CTRL 32'H0048
`define C_ADDR_DMA_US_STA 32'H004C
/* DMA-specific constants */
`define C_DMA_RST_CMD 32'H0200000A
// ***************************************** //
// Tasks //
// ***************************************** //
task dword_pack_data_store;
input [31:0] dword;
input [10:0] offset;
begin
board.RP.tx_usrapp.DATA_STORE[offset*4 + 3] = dword[31:24];
board.RP.tx_usrapp.DATA_STORE[offset*4 + 2] = dword[23:16];
board.RP.tx_usrapp.DATA_STORE[offset*4 + 1] = dword[15:8];
board.RP.tx_usrapp.DATA_STORE[offset*4 + 0] = dword[7:0];
end
endtask //dword_pack_data_store
///////////////////////////////////////////////
// Copy random data to tx send buffer //
///////////////////////////////////////////////
task Copy_rnd_data;
reg [7:0] i;
begin
for (i = 0; i <= 100; i = i + 1) begin
board.RP.tx_usrapp.DATA_STORE[i*4 + 3] = board.D_Array[i][31:24];
board.RP.tx_usrapp.DATA_STORE[i*4 + 2] = board.D_Array[i][23:16];
board.RP.tx_usrapp.DATA_STORE[i*4 + 1] = board.D_Array[i][15:8];
board.RP.tx_usrapp.DATA_STORE[i*4 + 0] = board.D_Array[i][7:0];
end
end
endtask // Copy_rnd_data
///////////////////////////////////////////////
// //
// Feed TLP to Rx: MRd, MWr, Cpl/D, Msg //
// //
///////////////////////////////////////////////
task TLP_Feed_Rx;
input [ 6:0] BAR_Hit_N; // Which BAR is hit
reg [63:0] sys_addr;
reg [31:0] hdr_type;
reg [31:0] hdr_mask;
begin
hdr_mask = 32'hFF000000;
sys_addr = board.RP.tx_usrapp.BAR_INIT_P_BAR[BAR_Hit_N - 1] +
board.Hdr_Array[2];
hdr_type = board.Hdr_Array[0] & hdr_mask;
$display("addr=%x, hdr_type=%x", sys_addr, hdr_type);
$display("hdr=%x, mwr3=%x", board.Hdr_Array[0], `HEADER0_MWR3_);
if ((board.Hdr_Array[0] & 32'hFF000000) == `HEADER0_MWR4_) begin
board.RP.tx_usrapp.TSK_TX_MEMORY_WRITE_64(board.Hdr_Array[1][15:8],
board.Hdr_Array[0][22:20],
board.Hdr_Array[0][9:0],
sys_addr,
board.Hdr_Array[0][7:4],
board.Hdr_Array[0][3:0],
0);
end
else if ((board.Hdr_Array[0] & 32'hFF000000) == `HEADER0_MWR3_) begin
board.RP.tx_usrapp.TSK_TX_MEMORY_WRITE_32(board.Hdr_Array[1][15:8],
board.Hdr_Array[0][22:20],
board.Hdr_Array[0][9:0],
sys_addr[31:0],
board.Hdr_Array[0][7:4],
board.Hdr_Array[0][3:0],
0);
end
else if ((board.Hdr_Array[0] & 32'hFF000000) == `HEADER0_MRD4_) begin
board.RP.tx_usrapp.TSK_TX_MEMORY_READ_64(board.Hdr_Array[1][15:8],
board.Hdr_Array[0][22:20],
board.Hdr_Array[0][9:0],
sys_addr,
board.Hdr_Array[0][7:4],
board.Hdr_Array[0][3:0]);
end
else if ((board.Hdr_Array[0] & 32'hFF000000) == `HEADER0_MRD3_) begin
board.RP.tx_usrapp.TSK_TX_MEMORY_READ_32(board.Hdr_Array[1][15:8],
board.Hdr_Array[0][22:20],
board.Hdr_Array[0][9:0],
sys_addr[31:0],
board.Hdr_Array[0][7:4],
board.Hdr_Array[0][3:0]);
end
else if ((board.Hdr_Array[0] & 32'hFF000000) == `HEADER0_CPLD) begin
board.RP.tx_usrapp.TSK_TX_COMPLETION_DATA(board.Hdr_Array[2][15:8],
board.Hdr_Array[0][22:20],
board.Hdr_Array[0][9:0],
board.Hdr_Array[1][11:0],
board.Hdr_Array[2][6:0],
board.Hdr_Array[1][15:13],
0);
end
else if ((board.Hdr_Array[0] & 32'hFF000000) == `HEADER0_CPL) begin
board.RP.tx_usrapp.TSK_TX_COMPLETION(board.Hdr_Array[2][15:8],
board.Hdr_Array[0][22:20],
board.Hdr_Array[0][9:0],
board.Hdr_Array[1][15:13]);
end
else if ((board.Hdr_Array[0] & 32'hFF000000) == `HEADER0_MSG) begin
board.RP.tx_usrapp.TSK_TX_MESSAGE(board.Hdr_Array[1][15:8],
board.Hdr_Array[0][22:20],
board.Hdr_Array[0][9:0],
0, //board.RP.tx_usrapp.DATA_STORE[7:0],
board.Hdr_Array[0][26:24],
board.Hdr_Array[1][7:0]);
end
else begin
$display("%d ns: TLP_Feed_Rx: unknown header type!", $time);
#10 $finish;
end
end
endtask
/////////////////////////////////////////////
// //
// Function - Endian Inversion 64-bit //
// //
/////////////////////////////////////////////
function [31:00] Inv_Endian;
input [31:00] Data;
begin
Inv_Endian = {Data[ 7: 0], Data[15: 8], Data[23:16], Data[31:24]};
end
endfunction
This diff is collapsed.
//-----------------------------------------------------------------------------
//
// (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
// laws.
//
// DISCLAIMER
// This disclaimer is not a license and does not grant any
// rights to the materials distributed herewith. Except as
// otherwise provided in a valid license issued to you by
// Xilinx, and to the maximum extent permitted by applicable
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
// WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
// (2) Xilinx shall not be liable (whether in contract or tort,
// including negligence, or under any other theory of
// liability) for any loss or damage of any kind or nature
// related to, arising under or in connection with these
// materials, including for any direct, or any indirect,
// special, incidental, or consequential loss or damage
// (including loss of data, profits, goodwill, or any type of
// loss or damage suffered as a result of any action brought
// by a third party) even if such damage or loss was
// reasonably foreseeable or Xilinx had been advised of the
// possibility of the same.
//
// CRITICAL APPLICATIONS
// Xilinx products are not designed or intended to be fail-
// safe, or for use in any application requiring fail-safe
// performance, such as life-support or safety devices or
// systems, Class III medical devices, nuclear facilities,
// applications related to the deployment of airbags, or any
// other applications that could lead to death, personal
// injury, or severe property or environmental damage
// (individually and collectively, "Critical
// Applications"). Customer assumes the sole risk and
// liability of any use of Xilinx products in Critical
// Applications, subject only to applicable laws and
// regulations governing limitations on product liability.
//
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
// PART OF THIS FILE AT ALL TIMES.
//
//-----------------------------------------------------------------------------
// Project : Series-7 Integrated Block for PCI Express
// File : pci_exp_usrapp_cfg.v
// Version : 1.7
//--
//--------------------------------------------------------------------------------
`include "board_common.v"
module pci_exp_usrapp_cfg (
cfg_do,
cfg_di,
cfg_byte_en_n,
cfg_dwaddr,
cfg_wr_en_n,
cfg_rd_en_n,
cfg_rd_wr_done_n,
cfg_err_cor_n,
cfg_err_ur_n,
cfg_err_ecrc_n,
cfg_err_cpl_timeout_n,
cfg_err_cpl_abort_n,
cfg_err_cpl_unexpect_n,
cfg_err_posted_n,
cfg_err_tlp_cpl_header,
cfg_interrupt_n,
cfg_interrupt_rdy_n,
cfg_turnoff_ok_n,
cfg_to_turnoff_n,
cfg_bus_number,
cfg_device_number,
cfg_function_number,
cfg_status,
cfg_command,
cfg_dstatus,
cfg_dcommand,
cfg_lstatus,
cfg_lcommand,
cfg_pcie_link_state_n,
cfg_trn_pending_n,
cfg_pm_wake_n,
trn_clk,
trn_reset_n
);
input [(32 - 1):0] cfg_do;
output [(32 - 1):0] cfg_di;
output [(32/8 - 1):0] cfg_byte_en_n;
output [(10 - 1):0] cfg_dwaddr;
output cfg_wr_en_n;
output cfg_rd_en_n;
input cfg_rd_wr_done_n;
output cfg_err_cor_n;
output cfg_err_ur_n;
output cfg_err_ecrc_n;
output cfg_err_cpl_timeout_n;
output cfg_err_cpl_abort_n;
output cfg_err_cpl_unexpect_n;
output cfg_err_posted_n;
output [(48 - 1):0] cfg_err_tlp_cpl_header;
output cfg_interrupt_n;
input cfg_interrupt_rdy_n;
output cfg_turnoff_ok_n;
input cfg_to_turnoff_n;
output cfg_pm_wake_n;
input [(8 - 1):0] cfg_bus_number;
input [(5 - 1):0] cfg_device_number;
input [(3 - 1):0] cfg_function_number;
input [(16 - 1):0] cfg_status;
input [(16- 1):0] cfg_command;
input [(16- 1):0] cfg_dstatus;
input [(16 - 1):0] cfg_dcommand;
input [(16 - 1):0] cfg_lstatus;
input [(16 - 1):0] cfg_lcommand;
input [(3 - 1):0] cfg_pcie_link_state_n;
output cfg_trn_pending_n;
input trn_clk;
input trn_reset_n;
parameter Tcq = 1;
reg [(32 - 1):0] cfg_di;
reg [(32/8 - 1):0] cfg_byte_en_n;
reg [(10 - 1):0] cfg_dwaddr;
reg cfg_wr_en_n;
reg cfg_rd_en_n;
reg cfg_err_cor_n;
reg cfg_err_ecrc_n;
reg cfg_err_ur_n;
reg cfg_err_cpl_timeout_n;
reg cfg_err_cpl_abort_n;
reg cfg_err_cpl_unexpect_n;
reg cfg_err_posted_n;
reg [(48 - 1):0] cfg_err_tlp_cpl_header;
reg cfg_interrupt_n;
reg cfg_turnoff_ok_n;
reg cfg_pm_wake_n;
reg cfg_trn_pending_n;
initial begin
cfg_err_cor_n <= 1'b1;
cfg_err_ur_n <= 1'b1;
cfg_err_ecrc_n <= 1'b1;
cfg_err_cpl_timeout_n <= 1'b1;
cfg_err_cpl_abort_n <= 1'b1;
cfg_err_cpl_unexpect_n <= 1'b1;
cfg_err_posted_n <= 1'b0;
cfg_interrupt_n <= 1'b1;
cfg_turnoff_ok_n <= 1'b1;
cfg_dwaddr <= 0;
cfg_err_tlp_cpl_header <= 0;
cfg_di <= 0;
cfg_byte_en_n <= 4'hf;
cfg_wr_en_n <= 1;
cfg_rd_en_n <= 1;
cfg_pm_wake_n <= 1;
cfg_trn_pending_n <= 1'b0;
end
/************************************************************
Task : TSK_READ_CFG_DW
Description : Read Configuration Space DW
*************************************************************/
task TSK_READ_CFG_DW;
input [31:0] addr_;
begin
if (!trn_reset_n) begin
$display("[%t] : trn_reset_n is asserted", $realtime);
$finish(1);
end
wait ( cfg_rd_wr_done_n == 1'b1)
@(posedge trn_clk);
cfg_dwaddr <= #(Tcq) addr_;
cfg_wr_en_n <= #(Tcq) 1'b1;
cfg_rd_en_n <= #(Tcq) 1'b0;
$display("[%t] : Reading Cfg Addr [0x%h]", $realtime, addr_);
$fdisplay(board.RP.com_usrapp.tx_file_ptr,
"\n[%t] : Local Configuration Read Access :",
$realtime);
@(posedge trn_clk);
#(Tcq);
wait ( cfg_rd_wr_done_n == 1'b0)
#(Tcq);
$fdisplay(board.RP.com_usrapp.tx_file_ptr,
"\t\t\tCfg Addr [0x%h] -> Data [0x%h]\n",
{addr_,2'b00}, cfg_do);
cfg_rd_en_n <= #(Tcq) 1'b1;
end
endtask // TSK_READ_CFG_DW;
/************************************************************
Task : TSK_WRITE_CFG_DW
Description : Write Configuration Space DW
*************************************************************/
task TSK_WRITE_CFG_DW;
input [31:0] addr_;
input [31:0] data_;
input [3:0] ben_;
begin
if (!trn_reset_n) begin
$display("[%t] : trn_reset_n is asserted", $realtime);
$finish(1);
end
wait ( cfg_rd_wr_done_n == 1'b1)
@(posedge trn_clk);
cfg_dwaddr <= #(Tcq) addr_;
cfg_di <= #(Tcq) data_;
cfg_byte_en_n <= #(Tcq) ben_;
cfg_wr_en_n <= #(Tcq) 1'b0;
cfg_rd_en_n <= #(Tcq) 1'b1;
$display("[%t] : Writing Cfg Addr [0x%h]", $realtime, addr_);
$fdisplay(board.RP.com_usrapp.tx_file_ptr,
"\n[%t] : Local Configuration Write Access :",
$realtime);
@(posedge trn_clk);
#(Tcq);
wait ( cfg_rd_wr_done_n == 1'b0)
#(Tcq);
cfg_wr_en_n <= #(Tcq) 1'b1;
end
endtask // TSK_WRITE_CFG_DW;
endmodule // pci_exp_usrapp_cfg
This diff is collapsed.
//-----------------------------------------------------------------------------
//
// (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
// laws.
//
// DISCLAIMER
// This disclaimer is not a license and does not grant any
// rights to the materials distributed herewith. Except as
// otherwise provided in a valid license issued to you by
// Xilinx, and to the maximum extent permitted by applicable
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
// WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
// (2) Xilinx shall not be liable (whether in contract or tort,
// including negligence, or under any other theory of
// liability) for any loss or damage of any kind or nature
// related to, arising under or in connection with these
// materials, including for any direct, or any indirect,
// special, incidental, or consequential loss or damage
// (including loss of data, profits, goodwill, or any type of
// loss or damage suffered as a result of any action brought
// by a third party) even if such damage or loss was
// reasonably foreseeable or Xilinx had been advised of the
// possibility of the same.
//
// CRITICAL APPLICATIONS
// Xilinx products are not designed or intended to be fail-
// safe, or for use in any application requiring fail-safe
// performance, such as life-support or safety devices or
// systems, Class III medical devices, nuclear facilities,
// applications related to the deployment of airbags, or any
// other applications that could lead to death, personal
// injury, or severe property or environmental damage
// (individually and collectively, "Critical
// Applications"). Customer assumes the sole risk and
// liability of any use of Xilinx products in Critical
// Applications, subject only to applicable laws and
// regulations governing limitations on product liability.
//
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
// PART OF THIS FILE AT ALL TIMES.
//
//-----------------------------------------------------------------------------
// Project : Series-7 Integrated Block for PCI Express
// File : pci_exp_usrapp_pl.v
// Version : 1.7
//--
//--------------------------------------------------------------------------------
module pci_exp_usrapp_pl (
pl_initial_link_width,
pl_lane_reversal_mode,
pl_link_gen2_capable,
pl_link_partner_gen2_supported,
pl_link_upcfg_capable,
pl_ltssm_state,
pl_received_hot_rst,
pl_sel_link_rate,
pl_sel_link_width,
pl_directed_link_auton,
pl_directed_link_change,
pl_directed_link_speed,
pl_directed_link_width,
pl_upstream_prefer_deemph,
speed_change_done_n,
trn_lnk_up_n,
trn_clk,
trn_reset_n
);
input [2:0] pl_initial_link_width;
input [1:0] pl_lane_reversal_mode;
input pl_link_gen2_capable;
input pl_link_partner_gen2_supported;
input pl_link_upcfg_capable;
input [5:0] pl_ltssm_state;
input pl_received_hot_rst;
input pl_sel_link_rate;
input [1:0] pl_sel_link_width;
output pl_directed_link_auton;
output [1:0] pl_directed_link_change;
output pl_directed_link_speed;
output [1:0] pl_directed_link_width;
output pl_upstream_prefer_deemph;
output speed_change_done_n;
input trn_lnk_up_n;
input trn_clk;
input trn_reset_n;
parameter Tcq = 1;
parameter LINK_CAP_MAX_LINK_SPEED = 4'h1;
reg pl_directed_link_auton;
reg [1:0] pl_directed_link_change;
reg pl_directed_link_speed;
reg [1:0] pl_directed_link_width;
reg pl_upstream_prefer_deemph;
reg speed_change_done_n;
initial begin
pl_directed_link_auton <= 1'b0;
pl_directed_link_change <= 2'b0;
pl_directed_link_speed <= 1'b0;
pl_directed_link_width <= 2'b0;
pl_upstream_prefer_deemph <= 1'b0;
speed_change_done_n <= 1'b1;
if (LINK_CAP_MAX_LINK_SPEED == 4'h2) begin
wait (trn_lnk_up_n == 1'b0);
if (pl_link_gen2_capable && pl_link_partner_gen2_supported) begin
wait (pl_sel_link_rate == 1'h1);
wait (pl_ltssm_state == 6'h16);
speed_change_done_n <= 1'b0;
end
end
end
endmodule // pci_exp_usrapp_pl
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
//-----------------------------------------------------------------------------
//
// (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
// laws.
//
// DISCLAIMER
// This disclaimer is not a license and does not grant any
// rights to the materials distributed herewith. Except as
// otherwise provided in a valid license issued to you by
// Xilinx, and to the maximum extent permitted by applicable
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
// WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
// (2) Xilinx shall not be liable (whether in contract or tort,
// including negligence, or under any other theory of
// liability) for any loss or damage of any kind or nature
// related to, arising under or in connection with these
// materials, including for any direct, or any indirect,
// special, incidental, or consequential loss or damage
// (including loss of data, profits, goodwill, or any type of
// loss or damage suffered as a result of any action brought
// by a third party) even if such damage or loss was
// reasonably foreseeable or Xilinx had been advised of the
// possibility of the same.
//
// CRITICAL APPLICATIONS
// Xilinx products are not designed or intended to be fail-
// safe, or for use in any application requiring fail-safe
// performance, such as life-support or safety devices or
// systems, Class III medical devices, nuclear facilities,
// applications related to the deployment of airbags, or any
// other applications that could lead to death, personal
// injury, or severe property or environmental damage
// (individually and collectively, "Critical
// Applications"). Customer assumes the sole risk and
// liability of any use of Xilinx products in Critical
// Applications, subject only to applicable laws and
// regulations governing limitations on product liability.
//
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
// PART OF THIS FILE AT ALL TIMES.
//
//-----------------------------------------------------------------------------
// Project : Series-7 Integrated Block for PCI Express
// File : sys_clk_gen.v
// Version : 1.7
//--
//--------------------------------------------------------------------------------
`timescale 1ps/1ps
module sys_clk_gen (sys_clk);
output sys_clk;
reg sys_clk;
parameter offset = 0;
parameter halfcycle = 500;
initial begin
sys_clk = 0;
#(offset);
forever #(halfcycle) sys_clk = ~sys_clk;
end
endmodule // sys_clk_gen
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment