Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: dmu_imu_irs.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 dmu_imu_irs ( | |
36 | ||
37 | // Clock and Reset | |
38 | ||
39 | clk, | |
40 | rst_l, | |
41 | ||
42 | // Inputs to Record Header Queue from LRM | |
43 | ||
44 | rm2im_rcd, | |
45 | rm2im_rcd_enq, | |
46 | ||
47 | ||
48 | //Record Header Queue Interface to RDS | |
49 | ||
50 | irs2rds_rcd, | |
51 | rds2irs_rcd_deq, | |
52 | irs2rds_rcd_empty, | |
53 | ||
54 | ||
55 | // Inputs to Record Data Queue from LRM | |
56 | ||
57 | tm2im_data, | |
58 | tm2im_data_enq, | |
59 | ||
60 | ||
61 | //Data Queue Interface to RDS | |
62 | ||
63 | irs2rds_data, | |
64 | rds2irs_data_deq, | |
65 | irs2rds_data_empty, | |
66 | ||
67 | ||
68 | // Debug Ports | |
69 | ||
70 | dbg2irs_dbg_sel_a, | |
71 | dbg2irs_dbg_sel_b, | |
72 | irs2dbg_dbg_a, | |
73 | irs2dbg_dbg_b | |
74 | ||
75 | ||
76 | ||
77 | ); | |
78 | ||
79 | ||
80 | //############################################################################ | |
81 | // PORT DECLARATIONS | |
82 | //############################################################################ | |
83 | ||
84 | //------------------------------------------------------------------------ | |
85 | // Clock and Reset Signals | |
86 | //------------------------------------------------------------------------ | |
87 | input clk; | |
88 | input rst_l; | |
89 | ||
90 | //------------------------------------------------------------------------ | |
91 | // Inputs to Record Header Queue from LRM | |
92 | //------------------------------------------------------------------------ | |
93 | ||
94 | input [`FIRE_DLC_IIN_REC_WDTH-1:0] rm2im_rcd; | |
95 | input rm2im_rcd_enq; | |
96 | ||
97 | //------------------------------------------------------------------------ | |
98 | // Record Header Queue Interface to RDS | |
99 | //------------------------------------------------------------------------ | |
100 | ||
101 | output [`FIRE_DLC_IIN_REC_WDTH-1:0] irs2rds_rcd; | |
102 | input rds2irs_rcd_deq; | |
103 | output irs2rds_rcd_empty; | |
104 | ||
105 | //------------------------------------------------------------------------ | |
106 | // Inputs to Record Data Queue from LRM | |
107 | //------------------------------------------------------------------------ | |
108 | ||
109 | input [`FIRE_DLC_MDF_REC_WDTH-1:0] tm2im_data; | |
110 | input tm2im_data_enq; | |
111 | ||
112 | //------------------------------------------------------------------------ | |
113 | // Data Queue Interface to RDS | |
114 | //------------------------------------------------------------------------ | |
115 | ||
116 | output [`FIRE_DLC_MDF_REC_WDTH-1:0] irs2rds_data; | |
117 | input rds2irs_data_deq; | |
118 | output irs2rds_data_empty; | |
119 | ||
120 | ||
121 | //------------------------------------------------------------------------ | |
122 | // Debug Ports | |
123 | //------------------------------------------------------------------------ | |
124 | ||
125 | input [2:0] dbg2irs_dbg_sel_a; | |
126 | input [2:0] dbg2irs_dbg_sel_b; | |
127 | output [`FIRE_DEBUG_WDTH-1:0] irs2dbg_dbg_a; | |
128 | output [`FIRE_DEBUG_WDTH-1:0] irs2dbg_dbg_b; | |
129 | ||
130 | ||
131 | //######################## END PORT DECLARATIONS ############################# | |
132 | ||
133 | //************************************************** | |
134 | // Registers that Are Not Flops | |
135 | //************************************************** | |
136 | ||
137 | reg [`FIRE_DEBUG_WDTH-1:0] n_dbg_a; | |
138 | reg [`FIRE_DEBUG_WDTH-1:0] n_dbg_b; | |
139 | ||
140 | ||
141 | //************************************************** | |
142 | // Registers that Are Flops | |
143 | //************************************************** | |
144 | ||
145 | reg [`FIRE_DEBUG_WDTH-1:0] dbg_a; | |
146 | reg [`FIRE_DEBUG_WDTH-1:0] dbg_b; | |
147 | ||
148 | //----------------------------------------------------- | |
149 | // Debug Ports | |
150 | //----------------------------------------------------- | |
151 | ||
152 | always @ (dbg2irs_dbg_sel_a or rm2im_rcd_enq or rm2im_rcd or tm2im_data or tm2im_data_enq or | |
153 | rds2irs_rcd_deq or irs2rds_rcd_empty or rds2irs_data_deq or irs2rds_data_empty) | |
154 | begin | |
155 | case (dbg2irs_dbg_sel_a) // synopsys infer_mux | |
156 | 3'b000: n_dbg_a = {rm2im_rcd_enq, rm2im_rcd[`FIRE_DLC_IIN_TYPE_MSB:`FIRE_DLC_IIN_TYPE_LSB]}; | |
157 | 3'b001: n_dbg_a = {rm2im_rcd[`FIRE_DLC_IIN_LRMTAG_MSB:`FIRE_DLC_IIN_LRMTAG_LSB]}; | |
158 | 3'b010: n_dbg_a = {tm2im_data[7:0]}; | |
159 | 3'b011: n_dbg_a = {tm2im_data[15:8]}; | |
160 | 3'b100: n_dbg_a = {2'h0, tm2im_data_enq, tm2im_data[16], rds2irs_rcd_deq, | |
161 | irs2rds_rcd_empty, rds2irs_data_deq, irs2rds_data_empty}; | |
162 | 3'b101: n_dbg_a = 8'h00; | |
163 | 3'b110: n_dbg_a = 8'h00; | |
164 | 3'b111: n_dbg_a = 8'h00; | |
165 | endcase | |
166 | end | |
167 | ||
168 | always @ (dbg2irs_dbg_sel_b or rm2im_rcd_enq or rm2im_rcd or tm2im_data or tm2im_data_enq or | |
169 | rds2irs_rcd_deq or irs2rds_rcd_empty or rds2irs_data_deq or irs2rds_data_empty ) | |
170 | begin | |
171 | case (dbg2irs_dbg_sel_b) // synopsys infer_mux | |
172 | 3'b000: n_dbg_b = {rm2im_rcd_enq, rm2im_rcd[`FIRE_DLC_IIN_TYPE_MSB:`FIRE_DLC_IIN_TYPE_LSB]}; | |
173 | 3'b001: n_dbg_b = {rm2im_rcd[`FIRE_DLC_IIN_LRMTAG_MSB:`FIRE_DLC_IIN_LRMTAG_LSB]}; | |
174 | 3'b010: n_dbg_b = {tm2im_data[7:0]}; | |
175 | 3'b011: n_dbg_b = {tm2im_data[15:8]}; | |
176 | 3'b100: n_dbg_b = {2'h0, tm2im_data_enq, tm2im_data[16], rds2irs_rcd_deq, | |
177 | irs2rds_rcd_empty, rds2irs_data_deq, irs2rds_data_empty}; | |
178 | 3'b101: n_dbg_b = 8'h00; | |
179 | 3'b110: n_dbg_b = 8'h00; | |
180 | 3'b111: n_dbg_b = 8'h00; | |
181 | endcase | |
182 | end | |
183 | ||
184 | ||
185 | always @ (posedge clk) | |
186 | begin | |
187 | if (!rst_l) begin | |
188 | dbg_a <= 8'b0; | |
189 | dbg_b <= 8'b0; | |
190 | end | |
191 | else begin | |
192 | dbg_a <= n_dbg_a; | |
193 | dbg_b <= n_dbg_b; | |
194 | end | |
195 | end | |
196 | ||
197 | ||
198 | assign irs2dbg_dbg_a = dbg_a; | |
199 | assign irs2dbg_dbg_b = dbg_b; | |
200 | ||
201 | ||
202 | ||
203 | //############################################################################ | |
204 | // MODULE INSTANCIATION | |
205 | //############################################################################ | |
206 | ||
207 | ||
208 | //------------------------------------------------------------------------ | |
209 | // Header Fifo for All Commands Comming from LRM | |
210 | // | |
211 | // WIDTH - 131 bits | |
212 | // DEPTH - 2 entries | |
213 | // PTR SIZE - 1 bits | |
214 | // | |
215 | // Total Data storage = 131 * 2 = 262 Flops | |
216 | //------------------------------------------------------------------------ | |
217 | ||
218 | dmu_common_simple_fifo #(`FIRE_DLC_IIN_REC_WDTH,2'd2,1,1'd1) simple_fifo_header ( | |
219 | ||
220 | .clk (clk), | |
221 | .rst_l (rst_l), | |
222 | ||
223 | .data_in (rm2im_rcd), | |
224 | .write (rm2im_rcd_enq), | |
225 | ||
226 | .data_out (irs2rds_rcd), | |
227 | .read (rds2irs_rcd_deq), | |
228 | ||
229 | .fifo_full (), | |
230 | .fifo_almost_full (), | |
231 | ||
232 | .fifo_empty (irs2rds_rcd_empty) | |
233 | ||
234 | ); | |
235 | ||
236 | //------------------------------------------------------------------------ | |
237 | // Data Fifo for MSI Commands Comming from LRM | |
238 | // | |
239 | // WIDTH - 17 bits | |
240 | // DEPTH - 8 entries | |
241 | // PTR SIZE - 3 bits | |
242 | // | |
243 | // Total Data storage = 17 * 8 = 136 Flops | |
244 | //------------------------------------------------------------------------ | |
245 | ||
246 | dmu_common_simple_fifo #(`FIRE_DLC_MDF_REC_WDTH,4'd8,3, 3'd7) simple_fifo_data ( | |
247 | ||
248 | .clk (clk), | |
249 | .rst_l (rst_l), | |
250 | ||
251 | .data_in (tm2im_data), | |
252 | .write (tm2im_data_enq), | |
253 | ||
254 | .data_out (irs2rds_data), | |
255 | .read (rds2irs_data_deq), | |
256 | ||
257 | .fifo_full (), | |
258 | .fifo_almost_full (), | |
259 | ||
260 | .fifo_empty (irs2rds_data_empty) | |
261 | ||
262 | ); | |
263 | ||
264 | ||
265 | endmodule |