OpenCores
URL https://opencores.org/ocsvn/pcie_sg_dma/pcie_sg_dma/trunk

Subversion Repositories pcie_sg_dma

[/] [pcie_sg_dma/] [branches/] [Virtex6/] [ML605_ISE12.3/] [ipcore_dir_ISE12.1/] [v6_pcie_v1_3/] [source/] [pcie_upconfig_fix_3451_v6.v] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
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_upconfig_fix_3451_v6.v
45
//--
46
//-- Description: Virtex6 Workaround for Root Port Upconfigurability Bug
47
//--
48
//--
49
//--------------------------------------------------------------------------------
50
 
51
`timescale 1ns/1ns
52
 
53
module pcie_upconfig_fix_3451_v6 # (
54
 
55
  parameter                                     UPSTREAM_FACING = "TRUE",
56
  parameter                                     PL_FAST_TRAIN = "FALSE",
57
  parameter                                     LINK_CAP_MAX_LINK_WIDTH = 6'h08
58
 
59
)
60
(
61
 
62
  input                                         pipe_clk,
63
  input                                         pl_phy_lnkup_n,
64
 
65
  input  [5:0]                                  pl_ltssm_state,
66
  input                                         pl_sel_lnk_rate,
67
  input  [1:0]                                  pl_directed_link_change,
68
 
69
  input  [3:0]                                  cfg_link_status_negotiated_width,
70
 
71
  output                                        filter_pipe
72
 
73
);
74
 
75
  parameter TCQ = 1;
76
 
77
  reg                                           reg_filter_pipe;
78
 
79
  reg  [5:0]                                    reg_prev_pl_ltssm_state;
80
  wire [5:0]                                    prev_pl_ltssm_state;
81
 
82
  reg  [15:0]                                   reg_tsx_counter;
83
  wire [15:0]                                   tsx_counter;
84
 
85
  wire [5:0]                                    cap_link_width;
86
 
87
  // Corrupting all Tsx on all lanes as soon as we do R.RC->R.RI transition to allow time for
88
  // the core to see the TS1s on all the lanes being configured at the same time
89
  // R.RI has a 2ms timeout.Corrupting tsxs for ~1/4 of that time
90
  // 225 pipe_clk cycles-sim_fast_train
91
  // 60000 pipe_clk cycles-without sim_fast_train
92
  // Not taking any action  when PLDIRECTEDLINKCHANGE is set
93
 
94
  always @ (posedge pipe_clk) begin
95
 
96
    if (pl_phy_lnkup_n) begin
97
 
98
      reg_tsx_counter <= #TCQ 16'h0;
99
      reg_filter_pipe <= #TCQ 1'b0;
100
 
101
    end else if ((pl_ltssm_state == 6'h20) &&
102
                 (prev_pl_ltssm_state == 6'h1d) &&
103
                 (cfg_link_status_negotiated_width != cap_link_width) &&
104
                 (pl_directed_link_change[1:0] == 2'b00)) begin
105
 
106
      reg_tsx_counter <= #TCQ 16'h0;
107
      reg_filter_pipe <= #TCQ 1'b1;
108
 
109
    end else if (filter_pipe == 1'b1) begin
110
 
111
      if (tsx_counter < ((PL_FAST_TRAIN == "TRUE") ? 16'd225: pl_sel_lnk_rate ? 16'd30000 : 16'd60000)) begin
112
 
113
        reg_tsx_counter <= #TCQ tsx_counter + 1'b1;
114
        reg_filter_pipe <= #TCQ 1'b1;
115
 
116
      end else begin
117
 
118
        reg_tsx_counter <= #TCQ 16'h0;
119
        reg_filter_pipe <= #TCQ 1'b0;
120
 
121
      end
122
 
123
    end
124
 
125
  end
126
 
127
  assign filter_pipe = (UPSTREAM_FACING == "TRUE") ? 1'b0 : reg_filter_pipe;
128
  assign tsx_counter = reg_tsx_counter;
129
 
130
  always @(posedge pipe_clk) begin
131
 
132
    if (pl_phy_lnkup_n)
133
      reg_prev_pl_ltssm_state <= #TCQ 6'h0;
134
    else
135
      reg_prev_pl_ltssm_state <= #TCQ pl_ltssm_state;
136
 
137
  end
138
  assign prev_pl_ltssm_state = reg_prev_pl_ltssm_state;
139
 
140
  assign cap_link_width = LINK_CAP_MAX_LINK_WIDTH;
141
 
142
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.