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

Subversion Repositories pcie_sg_dma

[/] [pcie_sg_dma/] [branches/] [Virtex6/] [ML605_ISE13.3/] [ipcore_dir_ISE13.3/] [v6_pcie_v1_7_x1/] [source/] [gtx_drp_chanalign_fix_3752_v6.v] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 barabba
 
2
//-----------------------------------------------------------------------------
3
//
4
// (c) Copyright 2009-2011 Xilinx, Inc. All rights reserved.
5
//
6
// This file contains confidential and proprietary information
7
// of Xilinx, Inc. and is protected under U.S. and
8
// international copyright and other intellectual property
9
// laws.
10
//
11
// DISCLAIMER
12
// This disclaimer is not a license and does not grant any
13
// rights to the materials distributed herewith. Except as
14
// otherwise provided in a valid license issued to you by
15
// Xilinx, and to the maximum extent permitted by applicable
16
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
17
// WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
18
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
19
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
20
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
21
// (2) Xilinx shall not be liable (whether in contract or tort,
22
// including negligence, or under any other theory of
23
// liability) for any loss or damage of any kind or nature
24
// related to, arising under or in connection with these
25
// materials, including for any direct, or any indirect,
26
// special, incidental, or consequential loss or damage
27
// (including loss of data, profits, goodwill, or any type of
28
// loss or damage suffered as a result of any action brought
29
// by a third party) even if such damage or loss was
30
// reasonably foreseeable or Xilinx had been advised of the
31
// possibility of the same.
32
//
33
// CRITICAL APPLICATIONS
34
// Xilinx products are not designed or intended to be fail-
35
// safe, or for use in any application requiring fail-safe
36
// performance, such as life-support or safety devices or
37
// systems, Class III medical devices, nuclear facilities,
38
// applications related to the deployment of airbags, or any
39
// other applications that could lead to death, personal
40
// injury, or severe property or environmental damage
41
// (individually and collectively, "Critical
42
// Applications"). Customer assumes the sole risk and
43
// liability of any use of Xilinx products in Critical
44
// Applications, subject only to applicable laws and
45
// regulations governing limitations on product liability.
46
//
47
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
48
// PART OF THIS FILE AT ALL TIMES.
49
//
50
//-----------------------------------------------------------------------------
51
// Project    : Virtex-6 Integrated Block for PCI Express
52
// File       : gtx_drp_chanalign_fix_3752_v6.v
53
// Version    : 1.7
54
//--
55
//-- Description: Virtex6 Workaround for deadlock due lane-lane skew Bug
56
//--
57
//--
58
//--
59
//--------------------------------------------------------------------------------
60
 
61
`timescale 1ns / 1ps
62
module GTX_DRP_CHANALIGN_FIX_3752_V6
63
#(
64
  parameter       C_SIMULATION    = 0 // Set to 1 for simulation
65
)
66
(
67
  output  reg          dwe,
68
  output  reg  [15:0]  din,    //THIS IS THE INPUT TO THE DRP
69
  output  reg          den,
70
  output  reg  [7:0]   daddr,
71
  output  reg  [3:0]   drpstate,
72
  input                write_ts1,
73
  input                write_fts,
74
  input       [15:0]   dout,  //THIS IS THE OUTPUT OF THE DRP
75
  input                drdy,
76
  input                Reset_n,
77
  input                drp_clk
78
 
79
);
80
 
81
 
82
  reg  [7:0]     next_daddr;
83
  reg  [3:0]     next_drpstate;
84
 
85
 
86
 
87
  reg            write_ts1_gated;
88
  reg            write_fts_gated;
89
 
90
  parameter      TCQ                    =  1;
91
  parameter      DRP_IDLE_FTS           =  1;
92
  parameter      DRP_IDLE_TS1           =  2;
93
  parameter      DRP_RESET              =  3;
94
  parameter      DRP_WRITE_FTS          =  6;
95
  parameter      DRP_WRITE_DONE_FTS     =  7;
96
  parameter      DRP_WRITE_TS1          =  8;
97
  parameter      DRP_WRITE_DONE_TS1     =  9;
98
  parameter      DRP_COM                = 10'b0110111100;
99
  parameter      DRP_FTS                = 10'b0100111100;
100
  parameter      DRP_TS1                = 10'b0001001010;
101
 
102
 
103
  always @(posedge drp_clk) begin
104
 
105
    if ( ~Reset_n ) begin
106
 
107
      daddr     <= #(TCQ) 8'h8;
108
      drpstate  <= #(TCQ) DRP_RESET;
109
 
110
 
111
      write_ts1_gated <= #(TCQ) 0;
112
      write_fts_gated <= #(TCQ) 0;
113
 
114
    end else begin
115
 
116
      daddr     <= #(TCQ) next_daddr;
117
      drpstate  <= #(TCQ) next_drpstate;
118
 
119
 
120
 
121
      write_ts1_gated <= #(TCQ) write_ts1;
122
      write_fts_gated <= #(TCQ) write_fts;
123
 
124
    end
125
 
126
  end
127
 
128
 
129
  always @(*) begin
130
 
131
    // DEFAULT CONDITIONS
132
    next_drpstate=drpstate;
133
    next_daddr=daddr;
134
    den=0;
135
    din=0;
136
    dwe=0;
137
 
138
    case(drpstate)
139
 
140
      // RESET CONDITION, WE NEED TO READ THE TOP 6 BITS OF THE DRP REGISTER WHEN WE GET THE WRITE FTS TRIGGER
141
      DRP_RESET : begin
142
 
143
        next_drpstate= DRP_WRITE_TS1;
144
        next_daddr=8'h8;
145
 
146
      end
147
 
148
 
149
 
150
      // WRITE FTS SEQUENCE
151
      DRP_WRITE_FTS : begin
152
 
153
        den=1;
154
        dwe=1;
155
        if(daddr==8'h8)
156
          din=16'hFD3C;
157
        else if(daddr==8'h9)
158
          din=16'hC53C;
159
        else if(daddr==8'hA)
160
          din=16'hFDBC;
161
        else if(daddr==8'hB)
162
          din=16'h853C;
163
        next_drpstate=DRP_WRITE_DONE_FTS;
164
 
165
      end
166
 
167
      // WAIT FOR FTS SEQUENCE WRITE TO FINISH, ONCE WE FINISH ALL WRITES GO TO FTS IDLE
168
      DRP_WRITE_DONE_FTS : begin
169
 
170
        if(drdy) begin
171
 
172
          if(daddr==8'hB) begin
173
 
174
            next_drpstate=DRP_IDLE_FTS;
175
            next_daddr=8'h8;
176
 
177
          end else begin
178
 
179
            next_drpstate=DRP_WRITE_FTS;
180
            next_daddr=daddr+1;
181
 
182
          end
183
 
184
        end
185
 
186
      end
187
 
188
      // FTS IDLE: WAIT HERE UNTIL WE NEED TO WRITE TS1
189
      DRP_IDLE_FTS : begin
190
 
191
        if(write_ts1_gated) begin
192
 
193
          next_drpstate=DRP_WRITE_TS1;
194
          next_daddr=8'h8;
195
 
196
        end
197
 
198
      end
199
 
200
      // WRITE TS1 SEQUENCE
201
      DRP_WRITE_TS1 : begin
202
        den=1;
203
        dwe=1;
204
        if(daddr==8'h8)
205
          din=16'hFC4A;
206
        else if(daddr==8'h9)
207
          din=16'hDC4A;   //CHANGE
208
        else if(daddr==8'hA)
209
          din=16'hC04A;  //CHANGE
210
        else if(daddr==8'hB)
211
          din=16'h85BC;
212
        next_drpstate=DRP_WRITE_DONE_TS1;
213
 
214
      end
215
 
216
      // WAIT FOR TS1 SEQUENCE WRITE TO FINISH, ONCE WE FINISH ALL WRITES GO TO TS1 IDLE
217
      DRP_WRITE_DONE_TS1 : begin
218
 
219
        if(drdy) begin
220
 
221
          if(daddr==8'hB) begin
222
 
223
            next_drpstate=DRP_IDLE_TS1;
224
            next_daddr=8'h8;
225
 
226
          end else begin
227
 
228
            next_drpstate=DRP_WRITE_TS1;
229
            next_daddr=daddr+1;
230
 
231
          end
232
 
233
        end
234
 
235
      end
236
 
237
      // TS1 IDLE: WAIT HERE UNTIL WE NEED TO WRITE FTS
238
      DRP_IDLE_TS1 : begin
239
 
240
        if(write_fts_gated) begin
241
 
242
          next_drpstate=DRP_WRITE_FTS;
243
          next_daddr=8'h8;
244
 
245
        end
246
 
247
      end
248
 
249
    endcase
250
 
251
  end
252
 
253
endmodule

powered by: WebSVN 2.1.0

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