Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / spc / lsu / rtl / lsu_pid_dp.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: lsu_pid_dp.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 lsu_pid_dp (
36 l2clk,
37 scan_in,
38 tcu_pce_ov,
39 tcu_scan_en,
40 spc_aclk,
41 spc_bclk,
42 scan_out,
43 const_cpuid,
44 lmd_bypass_data_m,
45 lmc_ld_tid,
46 lmc_ld_sz,
47 lmd_pcx_rqtyp,
48 lmd_pcx_nc,
49 lmd_pcx_pref,
50 lmd_pcx_rway,
51 lmd_pcx_addr,
52 lmd_asi_rngf,
53 lmd_asi_type,
54 lmd_asi_asi,
55 lmc_ld_vld_p4,
56 lmc_ld_inv_p4,
57 sbc_st_sel_tid_p4,
58 sbc_st_pcx_nc,
59 sbc_st_asi_fs,
60 sbc_pcx_bmask,
61 sbc_pcx_addr,
62 sbc_pcx_rmo_st,
63 sbc_pcx_blk_st,
64 sbc_pid_kill_store_p4_,
65 sbc_force_inv,
66 sbc_st_type_p4,
67 stb_cam_data,
68 stb_ram_data,
69 pic_ld_pcx_sel_p4,
70 pic_st_pcx_sel_p4,
71 pic_st_asi_p4,
72 pic_ld_asi_p4,
73 pic_asi_sel_p4,
74 pic_asi_req,
75 spc_pcx_data_pa,
76 pid_asi_pkt);
77wire stop;
78wire se;
79wire pce_ov;
80wire siclk;
81wire soclk;
82wire [63:0] lmd_cas_pkt2_data;
83wire [129:0] load_pcx_pkt;
84wire [129:0] store_pcx_pkt;
85wire [129:0] pcx_data_pa;
86wire [126:0] store_asi_pkt;
87wire [126:0] load_asi_pkt;
88wire [126:0] asi_pkt_hold;
89wire dff_asi_pkt_hi_scanin;
90wire dff_asi_pkt_hi_scanout;
91wire dff_asi_pkt_lo_scanin;
92wire dff_asi_pkt_lo_scanout;
93
94
95input l2clk;
96input scan_in;
97input tcu_pce_ov; // scan signals
98input tcu_scan_en;
99input spc_aclk;
100input spc_bclk;
101output scan_out;
102
103input [2:0] const_cpuid; // hardwired CPU ID
104
105input [63:0] lmd_bypass_data_m;
106input [2:0] lmc_ld_tid; // thread id of load packet
107input [4:0] lmc_ld_sz;
108input [2:0] lmd_pcx_rqtyp;
109input lmd_pcx_nc;
110input lmd_pcx_pref;
111input [1:0] lmd_pcx_rway;
112input [39:0] lmd_pcx_addr;
113input lmd_asi_rngf;
114input [1:0] lmd_asi_type;
115input [7:0] lmd_asi_asi;
116input lmc_ld_vld_p4;
117input lmc_ld_inv_p4;
118
119
120input [2:0] sbc_st_sel_tid_p4;
121input sbc_st_pcx_nc;
122input sbc_st_asi_fs;
123input [7:0] sbc_pcx_bmask;
124input [2:0] sbc_pcx_addr;
125input sbc_pcx_rmo_st;
126input sbc_pcx_blk_st;
127input sbc_pid_kill_store_p4_;
128input sbc_force_inv;
129input [2:0] sbc_st_type_p4;
130
131input [44:0] stb_cam_data;
132input [63:0] stb_ram_data;
133
134input pic_ld_pcx_sel_p4; // load port has access
135input pic_st_pcx_sel_p4; // store port has access
136input pic_st_asi_p4;
137input pic_ld_asi_p4;
138input pic_asi_sel_p4;
139input pic_asi_req;
140
141output [129:0] spc_pcx_data_pa; // PCX Packet
142output [127:0] pid_asi_pkt;
143
144// scan renames
145assign stop = 1'b0;
146// end scan
147
148lsu_pid_dp_buff_macro__dbuff_32x__rep_1__stack_none__width_4 test_rep0 (
149 .din ({tcu_scan_en,tcu_pce_ov,spc_aclk,spc_bclk}),
150 .dout({se,pce_ov,siclk,soclk})
151);
152
153assign lmd_cas_pkt2_data[63:0] = lmd_bypass_data_m[63:0];
154
155assign load_pcx_pkt[129:0] = {
156 lmc_ld_vld_p4,
157 2'b00, lmd_pcx_rqtyp[2:0], // rqtyp
158 lmd_pcx_nc,
159 const_cpuid[2:0],
160 lmc_ld_tid[2:0],
161 lmc_ld_inv_p4, lmd_pcx_pref, // inval and prefetch
162 1'b0, lmd_pcx_rway[1:0], // replacement way
163 {4{lmc_ld_sz[4]}}, lmc_ld_sz[3:0], // size
164 lmd_pcx_addr[39:0],
165 lmd_cas_pkt2_data[63:0]
166};
167
168assign store_pcx_pkt[129:0] = {
169 sbc_pid_kill_store_p4_,
170 2'b00,sbc_st_type_p4[2:0],
171 sbc_st_pcx_nc,
172 const_cpuid[2:0],
173 sbc_st_sel_tid_p4[2:0],
174 sbc_force_inv, // inv
175 sbc_pcx_blk_st, // BST
176 sbc_pcx_rmo_st, // BIS
177 2'b00, // way
178 sbc_pcx_bmask[7:0], // byte mask
179 stb_cam_data[44:8], sbc_pcx_addr[2:0], // address
180 stb_ram_data[63:0]
181};
182
183// Select the pcx source
184lsu_pid_dp_mux_macro__dmux_2x__mux_aonpe__ports_2__stack_66c__width_65 mx_pcx_data_hi (
185 .din0 (load_pcx_pkt[129:65]),
186 .din1 (store_pcx_pkt[129:65]),
187 .sel0 (pic_ld_pcx_sel_p4),
188 .sel1 (pic_st_pcx_sel_p4),
189 .dout (pcx_data_pa[129:65])
190);
191lsu_pid_dp_mux_macro__dmux_2x__mux_aonpe__ports_2__stack_66c__width_65 mx_pcx_data_lo (
192 .din0 (load_pcx_pkt[64:0]),
193 .din1 (store_pcx_pkt[64:0]),
194 .sel0 (pic_ld_pcx_sel_p4),
195 .sel1 (pic_st_pcx_sel_p4),
196 .dout (pcx_data_pa[64:0])
197);
198
199lsu_pid_dp_buff_macro__stack_66c__width_65 buf_pcx_data_hi (
200 .din (pcx_data_pa[129:65]),
201 .dout (spc_pcx_data_pa[129:65])
202);
203lsu_pid_dp_buff_macro__stack_66c__width_65 buf_pcx_data_lo (
204 .din (pcx_data_pa[64:0]),
205 .dout (spc_pcx_data_pa[64:0])
206);
207////////////////////////////////////////////////////////////////////////////////
208// Interface to the ASI block
209// Unlike the pcx interface, the asi interface includes the "request" as the
210// packet valid bit. Because the asi interface will reply with an ack on the
211// next cycle best case, all packets will be driven for at least two cycles.
212////////////////////////////////////////////////////////////////////////////////
213
214assign store_asi_pkt[126:0] = {
215 sbc_st_asi_fs,
216 sbc_st_type_p4[1:0],
217 1'b0, // write
218 sbc_st_sel_tid_p4[2:0],
219 stb_cam_data[7:0], // ASI ID
220 8'h00,stb_cam_data[44:8], 3'b0, // virt. addr
221 stb_ram_data[63:0] // data
222};
223
224assign load_asi_pkt[126:0] = {
225 lmd_asi_rngf,
226 lmd_asi_type[1:0],
227 1'b1,
228 lmc_ld_tid[2:0],
229 lmd_asi_asi[7:0],
230 8'h00,lmd_pcx_addr[39:0],
231 64'd0
232};
233
234lsu_pid_dp_mux_macro__mux_aope__ports_3__stack_66c__width_62 mx_asi_pkt_hi (
235 .din0 (store_asi_pkt[126:65]),
236 .din1 (load_asi_pkt[126:65]),
237 .din2 (asi_pkt_hold[126:65]),
238 .sel0 (pic_st_asi_p4),
239 .sel1 (pic_ld_asi_p4),
240 .dout (pid_asi_pkt[126:65])
241);
242lsu_pid_dp_mux_macro__mux_aope__ports_3__stack_66c__width_65 mx_asi_pkt_lo (
243 .din0 (store_asi_pkt[64:0]),
244 .din1 (load_asi_pkt[64:0]),
245 .din2 (asi_pkt_hold[64:0]),
246 .sel0 (pic_st_asi_p4),
247 .sel1 (pic_ld_asi_p4),
248 .dout (pid_asi_pkt[64:0])
249);
250
251lsu_pid_dp_msff_macro__stack_66c__width_62 dff_asi_pkt_hi (
252 .scan_in(dff_asi_pkt_hi_scanin),
253 .scan_out(dff_asi_pkt_hi_scanout),
254 .din (pid_asi_pkt[126:65]),
255 .dout (asi_pkt_hold[126:65]),
256 .clk (l2clk),
257 .en (pic_asi_sel_p4),
258 .se(se),
259 .siclk(siclk),
260 .soclk(soclk),
261 .pce_ov(pce_ov),
262 .stop(stop)
263);
264lsu_pid_dp_msff_macro__stack_66c__width_65 dff_asi_pkt_lo (
265 .scan_in(dff_asi_pkt_lo_scanin),
266 .scan_out(dff_asi_pkt_lo_scanout),
267 .din (pid_asi_pkt[64:0]),
268 .dout (asi_pkt_hold[64:0]),
269 .clk (l2clk),
270 .en (pic_asi_sel_p4),
271 .se(se),
272 .siclk(siclk),
273 .soclk(soclk),
274 .pce_ov(pce_ov),
275 .stop(stop)
276);
277
278assign pid_asi_pkt[127] = pic_asi_req;
279
280////////////////////////////////
281// Assertions
282
283// Check that CAS packets are always back to back
284// 0in assert_sequence -var (spc_pcx_data_pa[129:124] == 6'b100010) (spc_pcx_data_pa[129:124] == 6'b100011) -max 1 -message "CAS packets not back-to-back"
285
286// fixscan start:
287assign dff_asi_pkt_hi_scanin = scan_in ;
288assign dff_asi_pkt_lo_scanin = dff_asi_pkt_hi_scanout ;
289assign scan_out = dff_asi_pkt_lo_scanout ;
290// fixscan end:
291endmodule
292
293
294//
295// buff macro
296//
297//
298
299
300
301
302
303module lsu_pid_dp_buff_macro__dbuff_32x__rep_1__stack_none__width_4 (
304 din,
305 dout);
306 input [3:0] din;
307 output [3:0] dout;
308
309
310
311
312
313
314buff #(4) d0_0 (
315.in(din[3:0]),
316.out(dout[3:0])
317);
318
319
320
321
322
323
324
325
326endmodule
327
328
329
330
331
332// general mux macro for pass-gate and and-or muxes with/wout priority encoders
333// also for pass-gate with decoder
334
335
336
337
338
339// any PARAMS parms go into naming of macro
340
341module lsu_pid_dp_mux_macro__dmux_2x__mux_aonpe__ports_2__stack_66c__width_65 (
342 din0,
343 sel0,
344 din1,
345 sel1,
346 dout);
347wire buffout0;
348wire buffout1;
349
350 input [64:0] din0;
351 input sel0;
352 input [64:0] din1;
353 input sel1;
354 output [64:0] dout;
355
356
357
358
359
360cl_dp1_muxbuff2_8x c0_0 (
361 .in0(sel0),
362 .in1(sel1),
363 .out0(buffout0),
364 .out1(buffout1)
365);
366mux2s #(65) d0_0 (
367 .sel0(buffout0),
368 .sel1(buffout1),
369 .in0(din0[64:0]),
370 .in1(din1[64:0]),
371.dout(dout[64:0])
372);
373
374
375
376
377
378
379
380
381
382
383
384
385
386endmodule
387
388
389//
390// buff macro
391//
392//
393
394
395
396
397
398module lsu_pid_dp_buff_macro__stack_66c__width_65 (
399 din,
400 dout);
401 input [64:0] din;
402 output [64:0] dout;
403
404
405
406
407
408
409buff #(65) d0_0 (
410.in(din[64:0]),
411.out(dout[64:0])
412);
413
414
415
416
417
418
419
420
421endmodule
422
423
424
425
426
427// general mux macro for pass-gate and and-or muxes with/wout priority encoders
428// also for pass-gate with decoder
429
430
431
432
433
434// any PARAMS parms go into naming of macro
435
436module lsu_pid_dp_mux_macro__mux_aope__ports_3__stack_66c__width_62 (
437 din0,
438 din1,
439 din2,
440 sel0,
441 sel1,
442 dout);
443wire psel0;
444wire psel1;
445wire psel2;
446
447 input [61:0] din0;
448 input [61:0] din1;
449 input [61:0] din2;
450 input sel0;
451 input sel1;
452 output [61:0] dout;
453
454
455
456
457
458cl_dp1_penc3_8x c0_0 (
459 .test(1'b1),
460 .sel0(sel0),
461 .sel1(sel1),
462 .psel0(psel0),
463 .psel1(psel1),
464 .psel2(psel2)
465);
466
467mux3s #(62) d0_0 (
468 .sel0(psel0),
469 .sel1(psel1),
470 .sel2(psel2),
471 .in0(din0[61:0]),
472 .in1(din1[61:0]),
473 .in2(din2[61:0]),
474.dout(dout[61:0])
475);
476
477
478
479
480
481
482
483
484
485
486
487
488
489endmodule
490
491
492// general mux macro for pass-gate and and-or muxes with/wout priority encoders
493// also for pass-gate with decoder
494
495
496
497
498
499// any PARAMS parms go into naming of macro
500
501module lsu_pid_dp_mux_macro__mux_aope__ports_3__stack_66c__width_65 (
502 din0,
503 din1,
504 din2,
505 sel0,
506 sel1,
507 dout);
508wire psel0;
509wire psel1;
510wire psel2;
511
512 input [64:0] din0;
513 input [64:0] din1;
514 input [64:0] din2;
515 input sel0;
516 input sel1;
517 output [64:0] dout;
518
519
520
521
522
523cl_dp1_penc3_8x c0_0 (
524 .test(1'b1),
525 .sel0(sel0),
526 .sel1(sel1),
527 .psel0(psel0),
528 .psel1(psel1),
529 .psel2(psel2)
530);
531
532mux3s #(65) d0_0 (
533 .sel0(psel0),
534 .sel1(psel1),
535 .sel2(psel2),
536 .in0(din0[64:0]),
537 .in1(din1[64:0]),
538 .in2(din2[64:0]),
539.dout(dout[64:0])
540);
541
542
543
544
545
546
547
548
549
550
551
552
553
554endmodule
555
556
557
558
559
560
561// any PARAMS parms go into naming of macro
562
563module lsu_pid_dp_msff_macro__stack_66c__width_62 (
564 din,
565 clk,
566 en,
567 se,
568 scan_in,
569 siclk,
570 soclk,
571 pce_ov,
572 stop,
573 dout,
574 scan_out);
575wire l1clk;
576wire siclk_out;
577wire soclk_out;
578wire [60:0] so;
579
580 input [61:0] din;
581
582
583 input clk;
584 input en;
585 input se;
586 input scan_in;
587 input siclk;
588 input soclk;
589 input pce_ov;
590 input stop;
591
592
593
594 output [61:0] dout;
595
596
597 output scan_out;
598
599
600
601
602cl_dp1_l1hdr_8x c0_0 (
603.l2clk(clk),
604.pce(en),
605.aclk(siclk),
606.bclk(soclk),
607.l1clk(l1clk),
608 .se(se),
609 .pce_ov(pce_ov),
610 .stop(stop),
611 .siclk_out(siclk_out),
612 .soclk_out(soclk_out)
613);
614dff #(62) d0_0 (
615.l1clk(l1clk),
616.siclk(siclk_out),
617.soclk(soclk_out),
618.d(din[61:0]),
619.si({scan_in,so[60:0]}),
620.so({so[60:0],scan_out}),
621.q(dout[61:0])
622);
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643endmodule
644
645
646
647
648
649
650
651
652
653
654
655
656
657// any PARAMS parms go into naming of macro
658
659module lsu_pid_dp_msff_macro__stack_66c__width_65 (
660 din,
661 clk,
662 en,
663 se,
664 scan_in,
665 siclk,
666 soclk,
667 pce_ov,
668 stop,
669 dout,
670 scan_out);
671wire l1clk;
672wire siclk_out;
673wire soclk_out;
674wire [63:0] so;
675
676 input [64:0] din;
677
678
679 input clk;
680 input en;
681 input se;
682 input scan_in;
683 input siclk;
684 input soclk;
685 input pce_ov;
686 input stop;
687
688
689
690 output [64:0] dout;
691
692
693 output scan_out;
694
695
696
697
698cl_dp1_l1hdr_8x c0_0 (
699.l2clk(clk),
700.pce(en),
701.aclk(siclk),
702.bclk(soclk),
703.l1clk(l1clk),
704 .se(se),
705 .pce_ov(pce_ov),
706 .stop(stop),
707 .siclk_out(siclk_out),
708 .soclk_out(soclk_out)
709);
710dff #(65) d0_0 (
711.l1clk(l1clk),
712.siclk(siclk_out),
713.soclk(soclk_out),
714.d(din[64:0]),
715.si({scan_in,so[63:0]}),
716.so({so[63:0],scan_out}),
717.q(dout[64:0])
718);
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739endmodule
740
741
742
743
744
745
746
747