Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: ncu_tcu_chkr.v | |
4 | // Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
5 | // 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
6 | // | |
7 | // * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
8 | // | |
9 | // This program is free software; you can redistribute it and/or modify | |
10 | // it under the terms of the GNU General Public License as published by | |
11 | // the Free Software Foundation; version 2 of the License. | |
12 | // | |
13 | // This program is distributed in the hope that it will be useful, | |
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | // GNU General Public License for more details. | |
17 | // | |
18 | // You should have received a copy of the GNU General Public License | |
19 | // along with this program; if not, write to the Free Software | |
20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 | // | |
22 | // For the avoidance of doubt, and except that if any non-GPL license | |
23 | // choice is available it will apply instead, Sun elects to use only | |
24 | // the General Public License version 2 (GPLv2) at this time for any | |
25 | // software where a choice of GPL license versions is made | |
26 | // available with the language indicating that GPLv2 or any later version | |
27 | // may be used, or where a choice of which version of the GPL is applied is | |
28 | // otherwise unspecified. | |
29 | // | |
30 | // Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
31 | // CA 95054 USA or visit www.sun.com if you need additional information or | |
32 | // have any questions. | |
33 | // | |
34 | // ========== Copyright Header End ============================================ | |
35 | module ncu_tcu_chkr(); | |
36 | ||
37 | wire por_reset_l = !`NCU.tcu_aclk; | |
38 | ||
39 | // 0in set_clock -default iol2clk -module ncu | |
40 | ||
41 | // 0in default_reset `NCU.tcu_aclk -module ncu_tcu_chkr | |
42 | ||
43 | `ifdef X_GUARD | |
44 | // 0in known_driven -var ncu_tcu_stall -name ncu_tcu_stall_x_guard -active por_reset_l -module ncu | |
45 | // 0in known_driven -var tcu_ncu_vld -name tcu_ncu_vld_x_guard -active por_reset_l -module ncu | |
46 | // 0in known_driven -var tcu_ncu_stall -name tcu_ncu_stall_x_guard -active por_reset_l -module ncu | |
47 | // 0in known_driven -var ncu_tcu_vld -name ncu_tcu_vld_x_guard -active por_reset_l -module ncu | |
48 | `endif | |
49 | ||
50 | ||
51 | //********************************* | |
52 | // make sure vald and stall do not active to long | |
53 | //********************************* | |
54 | ||
55 | reg [9:0] tcu_ncu_vld_cnt; | |
56 | reg [9:0] tcu_ncu_stall_cnt; | |
57 | reg [9:0] ncu_tcu_vld_cnt; | |
58 | reg [9:0] ncu_tcu_stall_cnt; | |
59 | ||
60 | /* 0in range | |
61 | -var tcu_ncu_vld_cnt | |
62 | -min 0 | |
63 | -max 16 | |
64 | -clock `NCU.iol2clk | |
65 | */ | |
66 | ||
67 | /* 0in range | |
68 | -var tcu_ncu_stall_cnt | |
69 | -min 0 | |
70 | -max 1000 | |
71 | -clock `NCU.iol2clk | |
72 | */ | |
73 | ||
74 | /* 0in range | |
75 | -var ncu_tcu_vld_cnt | |
76 | -min 0 | |
77 | -max 16 | |
78 | -clock `NCU.iol2clk | |
79 | */ | |
80 | ||
81 | /* 0in range | |
82 | -var ncu_tcu_stall_cnt | |
83 | -min 0 | |
84 | -max 1000 | |
85 | -clock `NCU.iol2clk | |
86 | ||
87 | */ | |
88 | ||
89 | ||
90 | reg tcu_ncu_stall_del ; | |
91 | reg ncu_tcu_stall_del ; | |
92 | ||
93 | always @(posedge `NCU.iol2clk) begin | |
94 | if (`NCU.tcu_ncu_vld && !ncu_tcu_stall_del) begin | |
95 | tcu_ncu_vld_cnt = tcu_ncu_vld_cnt + 1; | |
96 | end | |
97 | else if (!`NCU.tcu_ncu_vld) begin | |
98 | tcu_ncu_vld_cnt = 0; | |
99 | end | |
100 | ||
101 | if (tcu_ncu_stall_del) begin | |
102 | tcu_ncu_stall_cnt = tcu_ncu_stall_cnt + 1; | |
103 | end | |
104 | else begin | |
105 | tcu_ncu_stall_cnt = 0; | |
106 | end | |
107 | ||
108 | ||
109 | if (`NCU.ncu_tcu_vld && !tcu_ncu_stall_del) begin | |
110 | ncu_tcu_vld_cnt = ncu_tcu_vld_cnt + 1; | |
111 | end | |
112 | else if (!`NCU.ncu_tcu_vld) begin | |
113 | ncu_tcu_vld_cnt = 0; | |
114 | end | |
115 | ||
116 | if (ncu_tcu_stall_del) begin | |
117 | ncu_tcu_stall_cnt = ncu_tcu_stall_cnt + 1; | |
118 | end | |
119 | else begin | |
120 | ncu_tcu_stall_cnt = 0; | |
121 | end | |
122 | ||
123 | tcu_ncu_stall_del = `NCU.tcu_ncu_stall; | |
124 | ncu_tcu_stall_del = `NCU.ncu_tcu_stall; | |
125 | ||
126 | end | |
127 | ||
128 | ||
129 | ||
130 | ||
131 | endmodule |