Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / dmu / rtl / dmu_cmu_dbg.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: dmu_cmu_dbg.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 ============================================
35module dmu_cmu_dbg (
36 clk,
37 rst_l,
38
39 // CMU
40 cr2cm_dbg_sel_a, // CMU debug select a
41 cr2cm_dbg_sel_b, // CMU debug select b
42 cm2cr_dbg_a, // CMU debug output a
43 cm2cr_dbg_b, // CMU debug output b
44
45 // RCM
46 dbg2rcm_dbg_sel_a, // RCM debug select a
47 dbg2rcm_dbg_sel_b, // RCM debug select b
48 rcm2dbg_dbg_a, // RCM debug output a
49 rcm2dbg_dbg_b, // RCM debug output b
50
51 // TCM
52 dbg2tcm_dbg_sel_a, // TCM debug select a
53 dbg2tcm_dbg_sel_b, // TCM debug select b
54 tcm2dbg_dbg_a, // TCM debug output a
55 tcm2dbg_dbg_b, // TCM debug output b
56
57 // CTX
58 dbg2ctx_dbg_sel_a, // CTX debug select a
59 dbg2ctx_dbg_sel_b, // CTX debug select b
60 ctx2dbg_dbg_a, // CTX debug output a
61 ctx2dbg_dbg_b // CTX debug output b
62 );
63
64//************************************************
65// PARAMETERS
66//************************************************
67
68
69
70//************************************************
71// PORTS
72//************************************************
73
74 input clk; // The input clock
75 input rst_l; // synopsys sync_set_reset "rst_l"
76
77// Debug
78 input [`FIRE_DLC_CMU_DS_BITS] cr2cm_dbg_sel_a; // CMU debug select a
79 input [`FIRE_DLC_CMU_DS_BITS] cr2cm_dbg_sel_b; // CMU debug select b
80 output [`FIRE_DBG_DATA_BITS] cm2cr_dbg_a; // CMU debug output a
81 output [`FIRE_DBG_DATA_BITS] cm2cr_dbg_b; // CMU debug output b
82
83// RCM debug
84 output [`FIRE_DLC_CMU_RCM_DS_BITS] dbg2rcm_dbg_sel_a;
85 output [`FIRE_DLC_CMU_RCM_DS_BITS] dbg2rcm_dbg_sel_b;
86 input [`FIRE_DBG_DATA_BITS] rcm2dbg_dbg_a;
87 input [`FIRE_DBG_DATA_BITS] rcm2dbg_dbg_b;
88
89// TCM debug
90 output [`FIRE_DLC_CMU_TCM_DS_BITS] dbg2tcm_dbg_sel_a;
91 output [`FIRE_DLC_CMU_TCM_DS_BITS] dbg2tcm_dbg_sel_b;
92 input [`FIRE_DBG_DATA_BITS] tcm2dbg_dbg_a;
93 input [`FIRE_DBG_DATA_BITS] tcm2dbg_dbg_b;
94
95// CTX debug
96 output [`FIRE_DLC_CMU_CTX_DS_BITS] dbg2ctx_dbg_sel_a;
97 output [`FIRE_DLC_CMU_CTX_DS_BITS] dbg2ctx_dbg_sel_b;
98 input [`FIRE_DBG_DATA_BITS] ctx2dbg_dbg_a;
99 input [`FIRE_DBG_DATA_BITS] ctx2dbg_dbg_b;
100
101//************************************************
102// SIGNALS
103//************************************************
104
105 wire clk;
106 wire rst_l;
107
108// Debug
109 wire [`FIRE_DLC_CMU_DS_BITS] cr2cm_dbg_sel_a; // CMU debug select a
110 wire [`FIRE_DLC_CMU_DS_BITS] cr2cm_dbg_sel_b; // CMU debug select b
111 wire [`FIRE_DBG_DATA_BITS] cm2cr_dbg_a; // CMU debug output a
112 wire [`FIRE_DBG_DATA_BITS] cm2cr_dbg_b; // CMU debug output b
113
114// RCM debug
115 wire [`FIRE_DLC_CMU_RCM_DS_BITS] dbg2rcm_dbg_sel_a;
116 wire [`FIRE_DLC_CMU_RCM_DS_BITS] dbg2rcm_dbg_sel_b;
117 wire [`FIRE_DBG_DATA_BITS] rcm2dbg_dbg_a;
118 wire [`FIRE_DBG_DATA_BITS] rcm2dbg_dbg_b;
119
120// TCM debug
121 wire [`FIRE_DLC_CMU_TCM_DS_BITS] dbg2tcm_dbg_sel_a;
122 wire [`FIRE_DLC_CMU_TCM_DS_BITS] dbg2tcm_dbg_sel_b;
123 wire [`FIRE_DBG_DATA_BITS] tcm2dbg_dbg_a;
124 wire [`FIRE_DBG_DATA_BITS] tcm2dbg_dbg_b;
125
126// CTX debug
127 wire [`FIRE_DLC_CMU_CTX_DS_BITS] dbg2ctx_dbg_sel_a;
128 wire [`FIRE_DLC_CMU_CTX_DS_BITS] dbg2ctx_dbg_sel_b;
129 wire [`FIRE_DBG_DATA_BITS] ctx2dbg_dbg_a;
130 wire [`FIRE_DBG_DATA_BITS] ctx2dbg_dbg_b;
131
132// *************** Local Declarations *************************************
133 reg [`FIRE_DBG_DATA_BITS] dbg_bus [0:1];
134 reg [`FIRE_DBG_DATA_BITS] nxt_dbg_bus [0:1];
135
136 integer i;
137
138//************************************************
139// Zero In checkers
140//************************************************
141
142
143// *************** Procedures *************************************
144
145
146// ********************** signal registers *************************/
147
148 always @ (cr2cm_dbg_sel_a or rcm2dbg_dbg_a
149 or tcm2dbg_dbg_a or ctx2dbg_dbg_a )
150 begin
151 case (cr2cm_dbg_sel_a[5:3]) // synopsys infer_mux
152 3'b000: nxt_dbg_bus[0] = rcm2dbg_dbg_a;
153 3'b001: nxt_dbg_bus[0] = tcm2dbg_dbg_a;
154 3'b010: nxt_dbg_bus[0] = ctx2dbg_dbg_a;
155 3'b011: nxt_dbg_bus[0] = 8'h00;
156 3'b100: nxt_dbg_bus[0] = 8'h00;
157 3'b101: nxt_dbg_bus[0] = 8'h00;
158 3'b110: nxt_dbg_bus[0] = 8'h00;
159 3'b111: nxt_dbg_bus[0] = 8'h00;
160 endcase // case(cr2cm_dbg_sel_a[5:3])
161 end // always @ (cr2cm_dbg_sel_a or dbg2rcm_dbg_a...
162
163 always @ (cr2cm_dbg_sel_b or rcm2dbg_dbg_b
164 or tcm2dbg_dbg_b or ctx2dbg_dbg_b )
165 begin
166 case (cr2cm_dbg_sel_b[5:3]) // synopsys infer_mux
167 3'b000: nxt_dbg_bus[1] = rcm2dbg_dbg_b;
168 3'b001: nxt_dbg_bus[1] = tcm2dbg_dbg_b;
169 3'b010: nxt_dbg_bus[1] = ctx2dbg_dbg_b;
170 3'b011: nxt_dbg_bus[1] = 8'h00;
171 3'b100: nxt_dbg_bus[1] = 8'h00;
172 3'b101: nxt_dbg_bus[1] = 8'h00;
173 3'b110: nxt_dbg_bus[1] = 8'h00;
174 3'b111: nxt_dbg_bus[1] = 8'h00;
175 endcase // case(cr2cm_dbg_sel_b[5:3])
176 end // always @ (cr2cm_dbg_sel_b or dbg2rcm_dbg_b...
177
178// ********************** Output Procedures ***********************/
179
180always @ (posedge clk) begin
181 if(rst_l == 1'b0) begin
182 for (i = 0; i < 2; i = i + 1) begin
183 dbg_bus[i] <= 8'h00;
184 end
185 end
186 else begin
187 for (i = 0; i < 2; i = i + 1) begin
188 dbg_bus[i] <= nxt_dbg_bus[i];
189 end
190 end
191end // always @ (posedge clk)
192
193
194// ***********************Assignments *****************************/
195
196// debug select abd data port distribution
197 assign dbg2rcm_dbg_sel_a = cr2cm_dbg_sel_a [`FIRE_DLC_CMU_RCM_DS_BITS];
198 assign dbg2rcm_dbg_sel_b = cr2cm_dbg_sel_b [`FIRE_DLC_CMU_RCM_DS_BITS];
199 assign dbg2tcm_dbg_sel_a = cr2cm_dbg_sel_a [`FIRE_DLC_CMU_TCM_DS_BITS];
200 assign dbg2tcm_dbg_sel_b = cr2cm_dbg_sel_b [`FIRE_DLC_CMU_TCM_DS_BITS];
201 assign dbg2ctx_dbg_sel_a = cr2cm_dbg_sel_a [`FIRE_DLC_CMU_CTX_DS_BITS];
202 assign dbg2ctx_dbg_sel_b = cr2cm_dbg_sel_b [`FIRE_DLC_CMU_CTX_DS_BITS];
203
204// Output
205 assign cm2cr_dbg_a = dbg_bus[0];
206 assign cm2cr_dbg_b = dbg_bus[1];
207
208endmodule