Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / dmu / rtl / dmu_clu_ctm.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: dmu_clu_ctm.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_clu_ctm
36 (
37 // clock/reset
38 clk,
39 rst_l,
40
41 // jbc : dmc req/resp port
42 d2j_cmd,
43 d2j_addr,
44 d2j_ctag,
45 d2j_cmd_vld,
46 d2j_data,
47 d2j_bmsk,
48 d2j_data_par,
49 d2j_data_vld,
50
51 // jbc : dma wrack port
52 j2d_d_wrack_tag,
53 j2d_d_wrack_vld,
54
55 // pmu : icr port
56 cl2pm_rcd_full,
57 pm2cl_rcd,
58 pm2cl_rcd_enq,
59
60 // mmu : tcr port
61 cl2mm_tcr_ack,
62 mm2cl_tcr_rcd,
63 mm2cl_tcr_req,
64
65 // rmu : dou dma buffer rel port
66 rm2cl_bufrel,
67 rm2cl_bufrel_enq,
68
69 // tmu: diu buffer mgr port
70 cl2tm_dma_rptr,
71 cl2tm_int_rptr,
72 tm2cl_dma_wptr,
73 tm2cl_pio_wptr,
74
75 // diu : data read port
76 cl2di_addr,
77 cl2di_rd_en,
78 di2cl_data,
79 di2cl_bmask,
80 di2cl_dpar,
81
82 // crm : urr port
83 ctm2crm_rcd,
84 ctm2crm_rcd_enq,
85 crm2ctm_rcd_deq,
86
87 // crm: dma tag return port
88 crm2ctm_tag,
89 crm2ctm_tag_enq,
90
91 // cru : debug ports
92 ctm_dbg0_bus_a,
93 ctm_dbg0_bus_b,
94 ctm_dbg1_bus_a,
95 ctm_dbg1_bus_b,
96 cr2cl_dbg_sel_a,
97 cr2cl_dbg_sel_b,
98 ds2cl_stall
99 );
100
101 // >>>>>>>>>>>>>>>>>>>>>>>>> Parameter Declarations <<<<<<<<<<<<<<<<<<<<<<<<<
102
103 // --------------------------------------------------------
104 // Ingress Command Record (ICR) FIFO Configuration
105 // --------------------------------------------------------
106
107 parameter ICR_FDEPTH = 5'd10;
108 parameter ICR_FDEPTH_MINONE = 4'd9;
109 parameter ICR_FPTR_WDTH = 4;
110
111 // --------------------------------------------------------
112 // TAGMGR Configuration
113 // --------------------------------------------------------
114
115 parameter TAG_WDTH = 4;
116
117 // >>>>>>>>>>>>>>>>>>>>>>>>> Port Declarations <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
118
119 // --------------------------------------------------------
120 // Clock/Reset Signals
121 // --------------------------------------------------------
122
123 input clk;
124 input rst_l;
125
126 // --------------------------------------------------------
127 // JBC Interface
128 // --------------------------------------------------------
129
130 // Cmd Port -> DMC Req/Resp
131 output [(`FIRE_D2J_CMD_WDTH - 1):0] d2j_cmd;
132 output [(`FIRE_D2J_ADDR_WDTH - 1):0] d2j_addr;
133 output [(`FIRE_D2J_CTAG_WDTH - 1):0] d2j_ctag;
134 output d2j_cmd_vld;
135
136 // Data Port -> DMC Req/Resp
137 output [(`FIRE_D2J_DATA_WDTH - 1):0] d2j_data;
138 output [(`FIRE_D2J_BMSK_WDTH - 1):0] d2j_bmsk;
139 output [(`FIRE_D2J_DPAR_WDTH - 1):0] d2j_data_par;
140 output d2j_data_vld;
141
142 // DMA Wrack Port
143 input [(`FIRE_J2D_D_WRACK_WDTH - 1):0] j2d_d_wrack_tag;
144 input j2d_d_wrack_vld;
145
146 // --------------------------------------------------------
147 // PMU Interface
148 // --------------------------------------------------------
149
150 // Ingress Command Record (ICR) Port
151 output cl2pm_rcd_full;
152 input [(`FIRE_DLC_ICR_REC_WDTH - 1):0] pm2cl_rcd;
153 input pm2cl_rcd_enq;
154
155 // --------------------------------------------------------
156 // MMU Interface
157 // --------------------------------------------------------
158
159 // Tablewalk Command Record (TCR) Port
160 output cl2mm_tcr_ack;
161 input [(`FIRE_DLC_TCR_WDTH - 1):0] mm2cl_tcr_rcd;
162 input mm2cl_tcr_req;
163
164 // --------------------------------------------------------
165 // RMU Interface
166 // --------------------------------------------------------
167
168 // DOU DMA Buffer Release Port
169 input [(`FIRE_DLC_DOU_REL_WDTH - 1):0] rm2cl_bufrel;
170 input rm2cl_bufrel_enq;
171
172 // --------------------------------------------------------
173 // TMU Interface
174 // --------------------------------------------------------
175
176 // DIU Buffer Manager Port
177 output [(`FIRE_DLC_DMA_RPTR_WDTH - 1):0] cl2tm_dma_rptr;
178 output [(`FIRE_DLC_INT_RPTR_WDTH - 1):0] cl2tm_int_rptr;
179 input [(`FIRE_DLC_DMA_WPTR_WDTH - 1):0] tm2cl_dma_wptr;
180 input [(`FIRE_DLC_PIO_WPTR_WDTH - 1):0] tm2cl_pio_wptr;
181
182 // --------------------------------------------------------
183 // DIU Interface
184 // --------------------------------------------------------
185
186 // Data Buffer Read Port
187 output [(`FIRE_DLC_CRD_ADDR_WDTH - 1):0] cl2di_addr;
188 output cl2di_rd_en;
189 input [(`FIRE_DLC_CRD_DATA_WDTH - 1):0] di2cl_data;
190 input [(`FIRE_DLC_CRD_BMASK_WDTH - 1):0] di2cl_bmask;
191 input [(`FIRE_DLC_CRD_DPAR_WDTH - 1):0] di2cl_dpar;
192
193 // --------------------------------------------------------
194 // CRM Interface
195 // --------------------------------------------------------
196
197 // Unsupported Request Record (URR) Port
198 output [(`FIRE_DLC_CLU_URR_WDTH - 1):0] ctm2crm_rcd;
199 output ctm2crm_rcd_enq;
200 input crm2ctm_rcd_deq;
201
202 // DMA/INT Tag-Credit Return Port
203 input [3:0] crm2ctm_tag;
204 input crm2ctm_tag_enq;
205
206 // --------------------------------------------------------
207 // CRU Interface
208 // --------------------------------------------------------
209
210 // ----- Debug Ports -----
211 output [`FIRE_DBG_DATA_BITS] ctm_dbg0_bus_a;
212 output [`FIRE_DBG_DATA_BITS] ctm_dbg0_bus_b;
213 output [`FIRE_DBG_DATA_BITS] ctm_dbg1_bus_a;
214 output [`FIRE_DBG_DATA_BITS] ctm_dbg1_bus_b;
215 input [2:0] cr2cl_dbg_sel_a;
216 input [2:0] cr2cl_dbg_sel_b;
217
218 input ds2cl_stall;
219
220 // >>>>>>>>>>>>>>>>>>>>>>>>> Data Type Declarations <<<<<<<<<<<<<<<<<<<<<<<<<
221
222 // ~~~~~~~~~~~~~~~~~~~~~~~~~ REGISTERS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
223
224 // ********** Flops **********
225
226 // debug ports
227 reg [`FIRE_DBG_DATA_BITS] dbg0_bus [0:1];
228 reg [`FIRE_DBG_DATA_BITS] dbg1_bus [0:1];
229
230 // ********** Non-Flops ******
231
232 // debug ports
233 reg [2:0] dbg0_sel [0:1];
234 reg [`FIRE_DBG_DATA_BITS] nxt_dbg0_bus [0:1];
235 reg [2:0] dbg1_sel [0:1];
236 reg [`FIRE_DBG_DATA_BITS] nxt_dbg1_bus [0:1];
237
238 // ~~~~~~~~~~~~~~~~~~~~~~~~~ NETS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
239
240 // --------------------------------------------------------
241 // ICR FIFO Interface
242 // --------------------------------------------------------
243
244 wire [(`FIRE_DLC_ICR_REC_WDTH - 1):0] icr_fifo_dout;
245 wire icr_fifo_rd;
246 wire icr_fifo_empty;
247
248 // --------------------------------------------------------
249 // ICR Field Declarations
250 // --------------------------------------------------------
251
252 wire [(`FIRE_DLC_ICR_TYP_WDTH - 1):0] icr_typ;
253 wire [(`FIRE_DLC_ICR_CLSTS_WDTH - 1):0] icr_clsts;
254 wire [(`FIRE_DLC_ICR_ADDR_WDTH - 1):0] icr_addr;
255 wire [(`FIRE_DLC_ICR_STAT_WDTH - 1):0] icr_cmdsts;
256 wire [(`FIRE_DLC_ICR_DPTR_WDTH - 1):0] icr_dptr;
257 wire [(`FIRE_DLC_ICR_SBDTAG_WDTH - 1):0] icr_sbdtag;
258
259 // --------------------------------------------------------
260 // TCR Field Declarations
261 // --------------------------------------------------------
262
263 wire [(`FIRE_DLC_TCR_ADDR_WDTH - 1):0] tcr_addr;
264 wire [(`FIRE_DLC_TCR_MTAG_WDTH - 1):0] tcr_mtag;
265
266 // --------------------------------------------------------
267 // TAGMGR Outputs
268 // --------------------------------------------------------
269
270 wire [(TAG_WDTH - 1):0] nxt_tag;
271 wire nxt_tag_avail;
272 wire nxt_tag_req;
273
274 // --------------------------------------------------------
275 // MISC
276 // --------------------------------------------------------
277
278 wire cmd_req_sel;
279 wire diu_dma_bufmgmt_bsy;
280 wire diu_eqw_bufmgmt_bsy;
281 wire diu_dma_empty;
282 wire diu_pio_empty;
283 wire [1:0] diu_typ_sel;
284 wire inc_dma_blk_addr;
285 wire inc_pio_blk_addr;
286 wire inc_eqw_blk_addr;
287 wire inc_mdo_blk_addr;
288 wire ld_diu_addr;
289 wire inc_diu_row_ptr;
290 wire dpath_sel;
291 wire ld_diu_data;
292 wire [4:0] dma_dptr;
293 wire dou_space_avail;
294 wire dma_dptr_req;
295 wire mrd_vld;
296 wire mwr_vld;
297 wire mwr_err;
298 wire eqwr_vld;
299 wire eqwr_err;
300 wire mdo_vld;
301 wire uns_vld;
302 wire null_vld;
303 wire pio16_vld;
304 wire pio64_vld;
305 wire pio_err;
306 wire proc_uns;
307 wire uns_req_crdt_avail;
308 wire icr_grnt;
309 wire proc_pio_err;
310
311 // idle checks
312 wire ctm_idle;
313 wire cmdctlfsm_idle;
314 wire datactlfsm_idle;
315 wire tag_pool_full;
316 wire dou_dptr_pool_full;
317
318 // --------------------------------------------------------
319 // Debug Ports
320 // --------------------------------------------------------
321
322 wire [3:0] cmdctlfsm_state;
323 wire [4:0] datactlfsm_state;
324 wire [7:0] inmod_dbg0_0;
325 wire [7:0] inmod_dbg0_1;
326 wire [7:0] inmod_dbg0_2;
327 wire [7:0] inmod_dbg0_3;
328 wire [7:0] inmod_dbg0_4;
329 wire [7:0] inmod_dbg0_5;
330 wire [7:0] inmod_dbg0_6;
331 wire [7:0] inmod_dbg0_7;
332 wire [7:0] inmod_dbg1_0;
333 wire [7:0] inmod_dbg1_1;
334 wire [7:0] inmod_dbg1_2;
335 wire [7:0] inmod_dbg1_3;
336 wire [7:0] inmod_dbg1_4;
337 wire [7:0] inmod_dbg1_5;
338 wire [7:0] inmod_dbg1_6;
339 wire [7:0] inmod_dbg1_7;
340
341 // >>>>>>>>>>>>>>>>>>>>>>>>> 0-in Checkers <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
342
343 /* 0in kndr
344 -var {tcr_addr, tcr_mtag}
345 -active (mm2cl_tcr_req ^ cl2mm_tcr_ack)
346 */
347
348 /* 0in kndr
349 -var icr_typ
350 -active ~icr_fifo_empty
351 */
352
353 /* 0in bits_on
354 -var {mrd_vld, mwr_vld, mwr_err, eqwr_vld, eqwr_err, mdo_vld,
355 uns_vld, null_vld, pio16_vld, pio64_vld, pio_err}
356 -active ~icr_fifo_empty
357 */
358//BP n2 10-26-04 since DSN adds 1 cycle, ctm cannot send back to back data txn's
359// these 2 checker look to see if this is violated
360/* 0in assert_follower -leader (d2j_cmd_vld & d2j_data_vld & ((d2j_cmd[3:0] == 4'b0000) ||
361 (d2j_cmd[3:0] == 4'b0001)) )
362 -follower ( ~d2j_cmd_vld )
363 -max 4
364 -min 1
365*/
366// second for pio 16 byte read return, interrupts, pio rd return errors
367/* 0in assert_follower -leader (d2j_cmd_vld & d2j_data_vld & ((d2j_cmd[3:0] == 4'b0100) ||
368 (d2j_cmd[3:0] == 4'b1000) ))
369 -follower ( ~d2j_cmd_vld )
370 -max 1
371 -min 1
372*/
373
374 // >>>>>>>>>>>>>>>>>>>>>>>>> RTL Model <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
375
376 // --------------------------------------------------------
377 // IDLE Checker
378 // --------------------------------------------------------
379
380 assign ctm_idle = (icr_fifo_empty & cmdctlfsm_idle & datactlfsm_idle &
381 tag_pool_full & dou_dptr_pool_full);
382
383 // --------------------------------------------------------
384 // Debug Port 0
385 // --------------------------------------------------------
386
387 // ----- debug0 bus assignments ----------------
388
389 assign inmod_dbg0_0 = {pm2cl_rcd_enq, d2j_cmd_vld, d2j_data_vld,
390 j2d_d_wrack_vld, j2d_d_wrack_tag};
391 assign inmod_dbg0_1 = {cl2pm_rcd_full, mm2cl_tcr_req, cl2mm_tcr_ack,
392 rm2cl_bufrel};
393 assign inmod_dbg0_2 = {rm2cl_bufrel_enq, ctm2crm_rcd_enq, crm2ctm_rcd_deq,
394 crm2ctm_tag_enq, crm2ctm_tag};
395 assign inmod_dbg0_3 = {uns_req_crdt_avail, icr_fifo_empty, icr_fifo_rd,
396 mrd_vld, mwr_vld, mwr_err, eqwr_vld, eqwr_err};
397 assign inmod_dbg0_4 = {mdo_vld, uns_vld, null_vld, pio16_vld, pio64_vld,
398 pio_err, proc_uns, cmd_req_sel};
399 assign inmod_dbg0_5 = {cl2tm_dma_rptr, diu_dma_empty, diu_pio_empty};
400 assign inmod_dbg0_6 = {tm2cl_dma_wptr, inc_dma_blk_addr, inc_pio_blk_addr};
401 assign inmod_dbg0_7 = {cl2tm_int_rptr, inc_eqw_blk_addr, inc_mdo_blk_addr,
402 ld_diu_addr};
403
404 // ----- debug0 port logic ---------------------
405
406 // debug0 select assignments
407 always @(cr2cl_dbg_sel_a or cr2cl_dbg_sel_b)
408 begin
409 dbg0_sel[0] = cr2cl_dbg_sel_a;
410 dbg0_sel[1] = cr2cl_dbg_sel_b;
411 end
412
413 // debug0_bus select
414 always @(dbg0_sel[0] or dbg0_sel[1] or inmod_dbg0_0 or inmod_dbg0_1 or
415 inmod_dbg0_2 or inmod_dbg0_3 or inmod_dbg0_4 or inmod_dbg0_5 or
416 inmod_dbg0_6 or inmod_dbg0_7)
417 begin : dbg0_bus_sel
418 integer i;
419 for (i=0; i<2; i=i+1)
420 begin
421 case (dbg0_sel[i]) // synopsys infer_mux
422 3'b000: nxt_dbg0_bus[i] = inmod_dbg0_0;
423 3'b001: nxt_dbg0_bus[i] = inmod_dbg0_1;
424 3'b010: nxt_dbg0_bus[i] = inmod_dbg0_2;
425 3'b011: nxt_dbg0_bus[i] = inmod_dbg0_3;
426 3'b100: nxt_dbg0_bus[i] = inmod_dbg0_4;
427 3'b101: nxt_dbg0_bus[i] = inmod_dbg0_5;
428 3'b110: nxt_dbg0_bus[i] = inmod_dbg0_6;
429 3'b111: nxt_dbg0_bus[i] = inmod_dbg0_7;
430 endcase
431 end
432 end
433
434 // register debug0 busses
435 always @(posedge clk)
436 if (~rst_l) begin : dbg0_bus_reg_reset
437 integer i;
438 for (i=0; i<2; i=i+1)
439 begin
440 dbg0_bus[i] <= nxt_dbg0_bus[i];
441 end
442 end
443 else begin : dbg0_bus_reg
444 integer i;
445 for (i=0; i<2; i=i+1)
446 begin
447 dbg0_bus[i] <= nxt_dbg0_bus[i];
448 end
449 end
450
451 // output debug0 busses
452 assign ctm_dbg0_bus_a = dbg0_bus[0];
453 assign ctm_dbg0_bus_b = dbg0_bus[1];
454
455 // --------------------------------------------------------
456 // Debug Port 1
457 // --------------------------------------------------------
458
459 // ----- debug1 bus assignments ----------------
460
461 assign inmod_dbg1_0 = {4'b0, cmdctlfsm_state};
462 assign inmod_dbg1_1 = {tm2cl_pio_wptr, diu_typ_sel, inc_diu_row_ptr};
463 assign inmod_dbg1_2 = {1'b0, dou_space_avail, dma_dptr_req, dma_dptr};
464 assign inmod_dbg1_3 = {dpath_sel, nxt_tag, nxt_tag_avail, nxt_tag_req,
465 icr_grnt};
466 assign inmod_dbg1_4 = {2'b0, icr_sbdtag, cl2di_addr[8]};
467 assign inmod_dbg1_5 = {cl2di_addr[7:0]};
468 assign inmod_dbg1_6 = {3'b0, datactlfsm_state};
469 assign inmod_dbg1_7 = {icr_dptr, ctm_idle};
470
471 // ----- debug1 port logic ---------------------
472
473 // debug1 select assignments
474 always @(cr2cl_dbg_sel_a or cr2cl_dbg_sel_b)
475 begin
476 dbg1_sel[0] = cr2cl_dbg_sel_a;
477 dbg1_sel[1] = cr2cl_dbg_sel_b;
478 end
479
480 // debug1_bus select
481 always @(dbg1_sel[0] or dbg1_sel[1] or inmod_dbg1_0 or inmod_dbg1_1 or
482 inmod_dbg1_2 or inmod_dbg1_3 or inmod_dbg1_4 or inmod_dbg1_5 or
483 inmod_dbg1_6 or inmod_dbg1_7)
484 begin : dbg1_bus_sel
485 integer i;
486 for (i=0; i<2; i=i+1)
487 begin
488 case (dbg1_sel[i]) // synopsys infer_mux
489 3'b000: nxt_dbg1_bus[i] = inmod_dbg1_0;
490 3'b001: nxt_dbg1_bus[i] = inmod_dbg1_1;
491 3'b010: nxt_dbg1_bus[i] = inmod_dbg1_2;
492 3'b011: nxt_dbg1_bus[i] = inmod_dbg1_3;
493 3'b100: nxt_dbg1_bus[i] = inmod_dbg1_4;
494 3'b101: nxt_dbg1_bus[i] = inmod_dbg1_5;
495 3'b110: nxt_dbg1_bus[i] = inmod_dbg1_6;
496 3'b111: nxt_dbg1_bus[i] = inmod_dbg1_7;
497 endcase
498 end
499 end
500
501 // register debug1 busses
502 always @(posedge clk)
503 if (~rst_l) begin : dbg1_bus_reg_reset
504 integer i;
505 for (i=0; i<2; i=i+1)
506 begin
507 dbg1_bus[i] <= nxt_dbg1_bus[i];
508 end
509 end
510 else begin : dbg1_bus_reg
511 integer i;
512 for (i=0; i<2; i=i+1)
513 begin
514 dbg1_bus[i] <= nxt_dbg1_bus[i];
515 end
516 end
517
518 // output debug1 busses
519 assign ctm_dbg1_bus_a = dbg1_bus[0];
520 assign ctm_dbg1_bus_b = dbg1_bus[1];
521
522 // --------------------------------------------------------
523 // ICR Field Assignments
524 // --------------------------------------------------------
525
526 assign icr_typ = icr_fifo_dout[`FIRE_DLC_ICR_TYP];
527 assign icr_clsts = icr_fifo_dout[`FIRE_DLC_ICR_CLSTS];
528 assign icr_addr = icr_fifo_dout[`FIRE_DLC_ICR_ADDR];
529 assign icr_cmdsts = icr_fifo_dout[`FIRE_DLC_ICR_STAT];
530 assign icr_dptr = icr_fifo_dout[`FIRE_DLC_ICR_DPTR];
531 assign icr_sbdtag = icr_fifo_dout[`FIRE_DLC_ICR_SBDTAG];
532
533 // --------------------------------------------------------
534 // TCR Field Assignments
535 // --------------------------------------------------------
536
537 assign tcr_addr = mm2cl_tcr_rcd[`FIRE_DLC_TCR_ADDR];
538 assign tcr_mtag = mm2cl_tcr_rcd[`FIRE_DLC_TCR_MTAG];
539
540 // >>>>>>>>>>>>>>>>>>>>>>>>> Instantiations <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
541
542 // TAGMGR
543 dmu_clu_ctm_tagmgr tagmgr
544 (
545 // clock/reset
546 .clk (clk),
547 .rst_l (rst_l),
548
549 // tag retire port 0
550 .tag_ret_0 (j2d_d_wrack_tag),
551 .tag_ret_0_vld (j2d_d_wrack_vld),
552
553 // tag retire port 1
554 .tag_ret_1 (crm2ctm_tag),
555 .tag_ret_1_vld (crm2ctm_tag_enq),
556
557 // tag issue port
558 .nxt_tag (nxt_tag),
559
560 // tag ctl/status port
561 .tag_pool_full (tag_pool_full),
562 .nxt_tag_avail (nxt_tag_avail),
563 .nxt_tag_req (nxt_tag_req)
564 );
565
566 // CMDCTLFSM
567 dmu_clu_ctm_cmdctlfsm cmdctlfsm
568 (
569 // clock/reset
570 .clk (clk),
571 .rst_l (rst_l),
572
573 // fsm inputs
574 .mm2cl_tcr_req (mm2cl_tcr_req),
575 .icr_fifo_empty (icr_fifo_empty),
576 .nxt_tag_avail (nxt_tag_avail),
577 .mrd_vld (mrd_vld),
578 .mwr_vld (mwr_vld),
579 .eqwr_vld (eqwr_vld),
580 .mdo_vld (mdo_vld),
581 .pio16_vld (pio16_vld),
582 .pio64_vld (pio64_vld),
583 .uns_vld (uns_vld),
584 .null_vld (null_vld),
585 .mwr_err (mwr_err),
586 .eqwr_err (eqwr_err),
587 .pio_err (pio_err),
588 .diu_dma_bufmgmt_bsy (diu_dma_bufmgmt_bsy),
589 .diu_eqw_bufmgmt_bsy (diu_eqw_bufmgmt_bsy),
590 .diu_dma_empty (diu_dma_empty),
591 .diu_pio_empty (diu_pio_empty),
592 .icr_clsts (icr_clsts),
593 .dou_space_avail (dou_space_avail),
594 .uns_req_crdt_avail (uns_req_crdt_avail),
595 .ds2cl_stall (ds2cl_stall),
596
597 // fsm outputs
598 .d2j_cmd_vld (d2j_cmd_vld),
599 .d2j_data_vld (d2j_data_vld),
600 .cl2mm_tcr_ack (cl2mm_tcr_ack),
601 .ctm2crm_rcd_enq (ctm2crm_rcd_enq),
602 .cmd_req_sel (cmd_req_sel),
603 .icr_fifo_rd (icr_fifo_rd),
604 .nxt_tag_req (nxt_tag_req),
605 .dma_dptr_req (dma_dptr_req),
606 .proc_uns (proc_uns),
607 .icr_grnt (icr_grnt),
608 .proc_pio_err (proc_pio_err),
609 .cl2di_rd_en (cl2di_rd_en),
610
611 // debug port
612 .cmdctlfsm_state (cmdctlfsm_state),
613
614 // idle checker port
615 .cmdctlfsm_idle (cmdctlfsm_idle)
616 );
617
618 // DATACTLFSM
619 dmu_clu_ctm_datactlfsm datactlfsm
620 (
621 // clock/reset
622 .clk (clk),
623 .rst_l (rst_l),
624
625 // fsm inputs
626 .icr_fifo_empty (icr_fifo_empty),
627 .icr_grnt (icr_grnt),
628 .nxt_tag_avail (nxt_tag_avail),
629 .mwr_vld (mwr_vld),
630 .eqwr_vld (eqwr_vld),
631 .mdo_vld (mdo_vld),
632 .pio16_vld (pio16_vld),
633 .pio64_vld (pio64_vld),
634 .null_vld (null_vld),
635 .mwr_err (mwr_err),
636 .eqwr_err (eqwr_err),
637 .diu_dma_empty (diu_dma_empty),
638 .diu_pio_empty (diu_pio_empty),
639
640 // fsm outputs
641 .diu_dma_bufmgmt_bsy (diu_dma_bufmgmt_bsy),
642 .diu_eqw_bufmgmt_bsy (diu_eqw_bufmgmt_bsy),
643 .diu_typ_sel (diu_typ_sel),
644 .inc_dma_blk_addr (inc_dma_blk_addr),
645 .inc_pio_blk_addr (inc_pio_blk_addr),
646 .inc_eqw_blk_addr (inc_eqw_blk_addr),
647 .inc_mdo_blk_addr (inc_mdo_blk_addr),
648 .ld_diu_addr (ld_diu_addr),
649 .inc_diu_row_ptr (inc_diu_row_ptr),
650 .dpath_sel (dpath_sel),
651 .ld_diu_data (ld_diu_data),
652
653 // debug port
654 .datactlfsm_state (datactlfsm_state),
655
656 // idle checker port
657 .datactlfsm_idle (datactlfsm_idle)
658 );
659
660 // CMDGEN
661 dmu_clu_ctm_cmdgen cmdgen
662 (
663 // clock/reset
664 .clk (clk),
665 .rst_l (rst_l),
666
667 // jbc : cmd port
668 .d2j_cmd (d2j_cmd),
669 .d2j_addr (d2j_addr),
670 .d2j_ctag (d2j_ctag),
671
672 // crm : urr port
673 .ctm2crm_rcd (ctm2crm_rcd),
674 .crm2ctm_rcd_deq (crm2ctm_rcd_deq),
675 .proc_uns (proc_uns),
676
677 // icr port
678 .icr_typ (icr_typ),
679 .icr_clsts (icr_clsts),
680 .icr_addr (icr_addr),
681 .icr_cmdsts (icr_cmdsts),
682 .icr_sbdtag (icr_sbdtag),
683
684 // tcr port
685 .tcr_addr (tcr_addr),
686 .tcr_mtag (tcr_mtag),
687
688 // tagmgr port
689 .nxt_tag (nxt_tag),
690
691 // bufmgr port
692 .dma_dptr (dma_dptr),
693
694 // cmd sel port
695 .cmd_req_sel (cmd_req_sel),
696
697 // uns req fifo credit port
698 .uns_req_crdt_avail (uns_req_crdt_avail),
699
700 // cmd type control signals
701 .mrd_vld (mrd_vld),
702 .mwr_vld (mwr_vld),
703 .mwr_err (mwr_err),
704 .eqwr_vld (eqwr_vld),
705 .eqwr_err (eqwr_err),
706 .mdo_vld (mdo_vld),
707 .uns_vld (uns_vld),
708 .null_vld (null_vld),
709 .pio16_vld (pio16_vld),
710 .pio64_vld (pio64_vld),
711 .pio_err (pio_err)
712 );
713
714 // BUFMGR
715 dmu_clu_ctm_bufmgr bufmgr
716 (
717 // clock/reset
718 .clk (clk),
719 .rst_l (rst_l),
720
721 // tmu: diu buffer mgr port
722 .cl2tm_dma_rptr (cl2tm_dma_rptr),
723 .cl2tm_int_rptr (cl2tm_int_rptr),
724 .tm2cl_dma_wptr (tm2cl_dma_wptr),
725 .tm2cl_pio_wptr (tm2cl_pio_wptr),
726
727 // rmu : dou dma buffer rel port
728 .rm2cl_bufrel (rm2cl_bufrel),
729 .rm2cl_bufrel_enq (rm2cl_bufrel_enq),
730
731 // diu : data read port
732 .cl2di_addr (cl2di_addr),
733
734 // dou buffer ctl/sts port
735 .dma_dptr (dma_dptr),
736 .dou_space_avail (dou_space_avail),
737 .dma_dptr_req (dma_dptr_req),
738 .dma_cltot (icr_dptr[3:0]),
739
740 // diu buffer ctl/sts port
741 .diu_dma_empty (diu_dma_empty),
742 .diu_pio_empty (diu_pio_empty),
743 .diu_typ_sel (diu_typ_sel),
744 .inc_dma_blk_addr (inc_dma_blk_addr),
745 .inc_pio_blk_addr (inc_pio_blk_addr),
746 .inc_eqw_blk_addr (inc_eqw_blk_addr),
747 .inc_mdo_blk_addr (inc_mdo_blk_addr),
748 .ld_diu_addr (ld_diu_addr),
749 .inc_diu_row_ptr (inc_diu_row_ptr),
750
751 // idle checker port
752 .dou_dptr_pool_full (dou_dptr_pool_full)
753 );
754
755 // DATAPIPE
756 dmu_clu_ctm_datapipe datapipe
757 (
758 // clock
759 .clk (clk),
760 .rst_l (rst_l),
761
762 // jbc : dmc req/resp data port
763 .d2j_data (d2j_data),
764 .d2j_bmsk (d2j_bmsk),
765 .d2j_data_par (d2j_data_par),
766
767 // diu : data read port
768 .di2cl_data (di2cl_data),
769 .di2cl_bmask (di2cl_bmask),
770 .di2cl_dpar (di2cl_dpar),
771
772 // datapath select
773 .dpath_sel (dpath_sel),
774 .ld_diu_data (ld_diu_data),
775 .proc_pio_err (proc_pio_err) // BP 4-28-05 n2
776 );
777
778 // ICR_FIFO
779 dmu_common_simple_fifo
780 #(`FIRE_DLC_ICR_REC_WDTH, ICR_FDEPTH, ICR_FPTR_WDTH, ICR_FDEPTH_MINONE) icr_fifo
781 (
782 // clock/reset
783 .clk (clk),
784 .rst_l (rst_l),
785
786 // icr enqueue port
787 .data_in (pm2cl_rcd),
788 .write (pm2cl_rcd_enq),
789
790 // icr dequeue port
791 .data_out (icr_fifo_dout),
792 .read (icr_fifo_rd),
793
794 // icr fifo status port
795 .fifo_full (),
796 .fifo_almost_full (cl2pm_rcd_full),
797 .fifo_empty (icr_fifo_empty)
798 );
799
800endmodule // dmu_clu_ctm