Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / common / verilog / monitors / ncu_ucbmon.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: ncu_ucbmon.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`timescale 1ps/1ps
36
37module ncu_ucbmon();
38
39
40//****************** monitor for IOS to NCU ***********************************8
41wire [14:0] ack_sel = `NCU.ncu_scd_ctl.ncu_i2cscd_ctl.ncu_i2csd_ctl.ack_sel[14:0];
42wire [127:0] i2c_pkt = `NCU.ncu_scd_ctl.ncu_i2cscd_ctl.ncu_i2csd_ctl.ucb_ack_packet;
43
44//--------------------------------------------------------------------------------------
45// Enable/Disable support : MAQ
46//--------------------------------------------------------------------------------------
47
48wire flush_reset_complete = `TOP.flush_reset_complete;
49
50reg enabled;
51initial
52begin
53 enabled = 1'b1;
54 if ($test$plusargs("ncu_ucbmon_disable"))
55 enabled = 1'b0;
56end
57
58always @ (flush_reset_complete)
59begin
60 if (flush_reset_complete == 1'b0)
61 enabled = 1'b0;
62
63 if ((flush_reset_complete == 1'b1) && (!($test$plusargs("ncu_ucbmon_disable"))))
64 enabled = 1'b1;
65end
66//--------------------------------------------------------------------------------------
67
68
69always @(posedge (`NCU.iol2clk & enabled))
70begin
71 case ( ack_sel[14:0] )
72 15'b100_0000_0000_0000:
73 `PR_INFO("NCU_MON", `INFO," SII->NCU:: TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", i2c_pkt[3:0], i2c_pkt[9:4], i2c_pkt[54:15], i2c_pkt[127:64] );
74 15'b010_0000_0000_0000:
75 `PR_INFO("NCU_MON", `INFO," DMU->NCU:: TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", i2c_pkt[3:0], i2c_pkt[9:4], i2c_pkt[54:15], i2c_pkt[127:64] );
76 15'b001_0000_0000_0000:
77 `PR_INFO("NCU_MON", `INFO," CCU->NCU:: TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", i2c_pkt[3:0], i2c_pkt[9:4], i2c_pkt[54:15], i2c_pkt[127:64] );
78 15'b000_1000_0000_0000:
79 `PR_INFO("NCU_MON", `INFO," MCU0->NCU:: TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", i2c_pkt[3:0], i2c_pkt[9:4], i2c_pkt[54:15], i2c_pkt[127:64] );
80 15'b000_0100_0000_0000:
81 `PR_INFO("NCU_MON", `INFO," MCU1->NCU:: TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", i2c_pkt[3:0], i2c_pkt[9:4], i2c_pkt[54:15], i2c_pkt[127:64] );
82 15'b000_0010_0000_0000:
83 `PR_INFO("NCU_MON", `INFO," MCU2->NCU:: TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", i2c_pkt[3:0], i2c_pkt[9:4], i2c_pkt[54:15], i2c_pkt[127:64] );
84 15'b000_0001_0000_0000:
85 `PR_INFO("NCU_MON", `INFO," MCU3->NCU:: TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", i2c_pkt[3:0], i2c_pkt[9:4], i2c_pkt[54:15], i2c_pkt[127:64] );
86 15'b000_0000_1000_0000:
87 `PR_INFO("NCU_MON", `INFO," SSI->NCU:: TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", i2c_pkt[3:0], i2c_pkt[9:4], i2c_pkt[54:15], i2c_pkt[127:64] );
88 15'b000_0000_0100_0000:
89 `PR_INFO("NCU_MON", `INFO," RST->NCU:: TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", i2c_pkt[3:0], i2c_pkt[9:4], i2c_pkt[54:15], i2c_pkt[127:64] );
90 15'b000_0000_0010_0000:
91 `PR_INFO("NCU_MON", `INFO," DBG1->NCU:: TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", i2c_pkt[3:0], i2c_pkt[9:4], i2c_pkt[54:15], i2c_pkt[127:64] );
92 15'b000_0000_0001_0000:
93 `PR_INFO("NCU_MON", `INFO," NIU->NCU:: TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", i2c_pkt[3:0], i2c_pkt[9:4], i2c_pkt[54:15], i2c_pkt[127:64] );
94 15'b000_0000_0000_1000:
95 `PR_INFO("NCU_MON", `INFO," NCU->REG; TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", i2c_pkt[3:0], i2c_pkt[9:4], i2c_pkt[54:15], i2c_pkt[127:64] );
96 15'b000_0000_0000_0100:
97 `PR_INFO("NCU_MON", `INFO," INT->NCU:: TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", i2c_pkt[3:0], i2c_pkt[9:4], i2c_pkt[54:15], i2c_pkt[127:64] );
98 15'b000_0000_0000_0010:
99 `PR_INFO("NCU_MON", `INFO," UCB_BOUNCE; TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", i2c_pkt[3:0], i2c_pkt[9:4], i2c_pkt[54:15], i2c_pkt[127:64] );
100 15'b000_0000_0000_0001:
101 `PR_INFO("NCU_MON", `INFO," UCB_RD_NACK; TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", i2c_pkt[3:0], i2c_pkt[9:4], i2c_pkt[54:15], i2c_pkt[127:64] );
102 endcase
103end // always
104
105
106//********************** monitor for NCU to IOS ******************************
107wire [13:0] ucb_sel;
108wire [127:0] c2i_pkt = `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.c2i_packet;
109
110assign ucb_sel[13] = `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.dmupio_ucb_sel
111 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.dmupio_ucb_buf_acpt
112 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.c2i_packet_vld;
113
114assign ucb_sel[12] = `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.dmucsr_ucb_sel
115 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.dmucsr_ucb_buf_acpt
116 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.c2i_packet_vld;
117assign ucb_sel[11] = `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.ccu_ucb_sel
118 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.ccu_ucb_buf_acpt
119 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.c2i_packet_vld;
120assign ucb_sel[10] = `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.mcu0_ucb_sel
121 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.mcu0_ucb_buf_acpt
122 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.c2i_packet_vld;
123assign ucb_sel[9] = `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.mcu1_ucb_sel
124 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.mcu1_ucb_buf_acpt
125 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.c2i_packet_vld;
126assign ucb_sel[8] = `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.mcu2_ucb_sel
127 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.mcu2_ucb_buf_acpt
128 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.c2i_packet_vld;
129assign ucb_sel[7] = `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.mcu3_ucb_sel
130 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.mcu3_ucb_buf_acpt
131 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.c2i_packet_vld;
132assign ucb_sel[6] = `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.ssi_ucb_sel
133 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.ssi_ucb_buf_acpt
134 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.c2i_packet_vld;
135assign ucb_sel[5] = `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.rcu_ucb_sel
136 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.rcu_ucb_buf_acpt
137 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.c2i_packet_vld;
138assign ucb_sel[4] = `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.dbg1_ucb_sel
139 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.dbg1_ucb_buf_acpt
140 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.c2i_packet_vld;
141assign ucb_sel[3] = `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.niu_ucb_sel
142 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.niu_ucb_buf_acpt
143 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.c2i_packet_vld;
144assign ucb_sel[2] = `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.ncu_man_ucb_sel
145 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.ncu_man_ucb_buf_acpt
146 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.c2i_packet_vld;
147assign ucb_sel[1] = `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.bounce_ucb_sel
148 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.bounce_ucb_buf_acpt
149 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.c2i_packet_vld;
150assign ucb_sel[0] = `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.rd_nack_ucb_sel
151 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.rd_nack_ucb_buf_acpt
152 && `NCU.ncu_scd_ctl.ncu_c2iscd_ctl.c2i_packet_vld;
153
154
155
156always @( posedge (`NCU.iol2clk & enabled))
157begin
158 case ( ucb_sel)
159 14'b100_0000_0000_00:
160 `PR_INFO("NCU_MON", `INFO," NCU->PIO: TYPE %0h; THR_ID %0h; PA = %0h; DATA = %0h;", c2i_pkt[3:0], c2i_pkt[9:4], c2i_pkt[54:15], c2i_pkt[127:64] );
161 14'b10_0000_0000_000:
162 `PR_INFO("NCU_MON", `INFO," NCU->DMU: TYPE %0h; THR_ID %0h; PA = %0h DATA = %0h", c2i_pkt[3:0], c2i_pkt[9:4], c2i_pkt[54:15], c2i_pkt[127:64] );
163 14'b01_0000_0000_000:
164 `PR_INFO("NCU_MON", `INFO," NCU->CCU: TYPE %0h; THR_ID %0h; PA = %0h DATA = %0h", c2i_pkt[3:0], c2i_pkt[9:4], c2i_pkt[54:15], c2i_pkt[127:64] );
165 14'b00_1000_0000_000:
166 `PR_INFO("NCU_MON", `INFO," NCU->MCU0: TYPE %0h; THR_ID %0h; PA = %0h DATA = %0h", c2i_pkt[3:0], c2i_pkt[9:4], c2i_pkt[54:15], c2i_pkt[127:64] );
167 14'b00_0100_0000_000:
168 `PR_INFO("NCU_MON", `INFO," NCU->MCU1: TYPE %0h; THR_ID %0h; PA = %0h DATA = %0h", c2i_pkt[3:0], c2i_pkt[9:4], c2i_pkt[54:15], c2i_pkt[127:64] );
169 14'b00_0010_0000_000:
170 `PR_INFO("NCU_MON", `INFO," NCU->MCU2: TYPE %0h; THR_ID %0h; PA = %0h DATA = %0h", c2i_pkt[3:0], c2i_pkt[9:4], c2i_pkt[54:15], c2i_pkt[127:64] );
171 14'b00_0001_0000_000:
172 `PR_INFO("NCU_MON", `INFO," NCU->MCU3: TYPE %0h; THR_ID %0h; PA = %0h DATA = %0h", c2i_pkt[3:0], c2i_pkt[9:4], c2i_pkt[54:15], c2i_pkt[127:64] );
173 14'b00_0000_1000_000:
174 `PR_INFO("NCU_MON", `INFO," NCU->SSI: TYPE %0h; THR_ID %0h; PA = %0h DATA = %0h", c2i_pkt[3:0], c2i_pkt[9:4], c2i_pkt[54:15], c2i_pkt[127:64] );
175 14'b00_0000_0100_000:
176 `PR_INFO("NCU_MON", `INFO," NCU->RST: TYPE %0h; THR_ID %0h; PA = %0h DATA = %0h", c2i_pkt[3:0], c2i_pkt[9:4], c2i_pkt[54:15], c2i_pkt[127:64] );
177 14'b00_0000_0010_000:
178 `PR_INFO("NCU_MON", `INFO," NCU->DBG1: TYPE %0h; THR_ID %0h; PA = %0h DATA = %0h", c2i_pkt[3:0], c2i_pkt[9:4], c2i_pkt[54:15], c2i_pkt[127:64] );
179 14'b00_0000_0001_000:
180 `PR_INFO("NCU_MON", `INFO," NCU->NIU: TYPE %0h; THR_ID %0h; PA = %0h DATA = %0h", c2i_pkt[3:0], c2i_pkt[9:4], c2i_pkt[54:15], c2i_pkt[127:64] );
181 14'b00_0000_0000_100:
182 `PR_INFO("NCU_MON", `INFO," NCU REG: TYPE %0h; THR_ID %0h; PA = %0h DATA = %0h", c2i_pkt[3:0], c2i_pkt[9:4], c2i_pkt[54:15], c2i_pkt[127:64] );
183 14'b00_0000_0000_010:
184 `PR_INFO("NCU_MON", `INFO," NCU->ucb_bounce: TYPE %0h; THR_ID %0h; PA = %0h DATA = %0h", c2i_pkt[3:0], c2i_pkt[9:4], c2i_pkt[54:15], c2i_pkt[127:64] );
185 14'b00_0000_0000_001:
186 `PR_INFO("NCU_MON", `INFO," NCU->UCB_RD_NACK: TYPE %0h; THR_ID %0h; PA = %0h DATA = %0h", c2i_pkt[3:0], c2i_pkt[9:4], c2i_pkt[54:15], c2i_pkt[127:64] );
187 endcase
188end // always
189
190
191endmodule