1 |
2 |
dsmv |
|
2 |
|
|
//-----------------------------------------------------------------------------
|
3 |
|
|
//
|
4 |
|
|
// (c) Copyright 2009-2010 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 : V5-Block Plus for PCI Express
|
52 |
|
|
// File : cmm_errman_nfl.v
|
53 |
|
|
//--------------------------------------------------------------------------------
|
54 |
|
|
//--------------------------------------------------------------------------------
|
55 |
|
|
/***********************************************************************
|
56 |
|
|
|
57 |
|
|
Description:
|
58 |
|
|
|
59 |
|
|
This module figures out what to do for non-fatal errors:
|
60 |
|
|
1) count up or count down,
|
61 |
|
|
2) how much to add or to subtract.
|
62 |
|
|
It returns the number and a add/subtract_b signals to the error
|
63 |
|
|
tracking counter. The outputs are based on how many errors are
|
64 |
|
|
asserted by the error reporting modules.
|
65 |
|
|
|
66 |
|
|
***********************************************************************/
|
67 |
|
|
|
68 |
|
|
|
69 |
|
|
module cmm_errman_nfl (
|
70 |
|
|
nfl_num, // Output
|
71 |
|
|
inc_dec_b,
|
72 |
|
|
cfg_err_cpl_timeout_n,
|
73 |
|
|
decr_nfl,
|
74 |
|
|
rst,
|
75 |
|
|
clk
|
76 |
|
|
);
|
77 |
|
|
|
78 |
|
|
|
79 |
|
|
output nfl_num;
|
80 |
|
|
output inc_dec_b; // 1 = increment, 0 = decrement
|
81 |
|
|
|
82 |
|
|
input cfg_err_cpl_timeout_n;
|
83 |
|
|
input decr_nfl;
|
84 |
|
|
input rst;
|
85 |
|
|
input clk;
|
86 |
|
|
|
87 |
|
|
|
88 |
|
|
//******************************************************************//
|
89 |
|
|
// Reality check. //
|
90 |
|
|
//******************************************************************//
|
91 |
|
|
|
92 |
|
|
parameter FFD = 1; // clock to out delay model
|
93 |
|
|
|
94 |
|
|
|
95 |
|
|
//******************************************************************//
|
96 |
|
|
// Figure out how many errors to increment. //
|
97 |
|
|
//******************************************************************//
|
98 |
|
|
|
99 |
|
|
reg to_incr;
|
100 |
|
|
reg add_sub_b;
|
101 |
|
|
|
102 |
|
|
always @(cfg_err_cpl_timeout_n or decr_nfl) begin
|
103 |
|
|
case ({cfg_err_cpl_timeout_n, decr_nfl}) // synthesis full_case parallel_case
|
104 |
|
|
2'b10: begin to_incr = 1'b0;
|
105 |
|
|
add_sub_b = 1'b1;
|
106 |
|
|
end
|
107 |
|
|
2'b11: begin to_incr = 1'b1;
|
108 |
|
|
add_sub_b = 1'b0;
|
109 |
|
|
end
|
110 |
|
|
2'b00: begin to_incr = 1'b1;
|
111 |
|
|
add_sub_b = 1'b1;
|
112 |
|
|
end
|
113 |
|
|
2'b01: begin to_incr = 1'b0;
|
114 |
|
|
add_sub_b = 1'b1;
|
115 |
|
|
end
|
116 |
|
|
default: begin to_incr = 1'b0;
|
117 |
|
|
add_sub_b = 1'b1;
|
118 |
|
|
end
|
119 |
|
|
endcase
|
120 |
|
|
end
|
121 |
|
|
|
122 |
|
|
|
123 |
|
|
//******************************************************************//
|
124 |
|
|
// Register the outputs. //
|
125 |
|
|
//******************************************************************//
|
126 |
|
|
|
127 |
|
|
|
128 |
|
|
reg reg_nfl_num;
|
129 |
|
|
reg reg_inc_dec_b;
|
130 |
|
|
|
131 |
|
|
always @(posedge clk or posedge rst)
|
132 |
|
|
begin
|
133 |
|
|
if (rst)
|
134 |
|
|
begin
|
135 |
|
|
reg_nfl_num <= #FFD 1'b0;
|
136 |
|
|
reg_inc_dec_b <= #FFD 1'b0;
|
137 |
|
|
end
|
138 |
|
|
else
|
139 |
|
|
begin
|
140 |
|
|
reg_nfl_num <= #FFD to_incr;
|
141 |
|
|
reg_inc_dec_b <= #FFD add_sub_b;
|
142 |
|
|
end
|
143 |
|
|
end
|
144 |
|
|
|
145 |
|
|
assign nfl_num = reg_nfl_num;
|
146 |
|
|
assign inc_dec_b = reg_inc_dec_b;
|
147 |
|
|
|
148 |
|
|
|
149 |
|
|
//******************************************************************//
|
150 |
|
|
// //
|
151 |
|
|
//******************************************************************//
|
152 |
|
|
|
153 |
|
|
endmodule
|