Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / libs / n2sram / compiler / physical / n2_com_dp_128x42s_cust_l / n2_com_dp_128x42s_cust / rtl / n2_com_dp_128x42s_cust.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: n2_com_dp_128x42s_cust.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 n2_com_dp_128x42s_cust (
36 wr_adr,
37 wr_en,
38 rd_adr,
39 rd_en,
40 din,
41 dout,
42 rdclk,
43 wrclk,
44 scan_in,
45 tcu_pce_ov,
46 tcu_aclk,
47 tcu_bclk,
48 tcu_array_wr_inhibit,
49 tcu_se_scancollar_in,
50 bist_clk_mux_sel,
51 rd_pce,
52 wr_pce,
53 scan_out);
54wire rd_lce;
55wire wr_lce;
56wire rdclk_in;
57wire wrclk_in;
58wire rdclk_free;
59wire wrclk_free;
60wire dff_wr_addr_scanin;
61wire dff_wr_addr_scanout;
62wire [6:0] wr_adr_d1;
63wire [6:1] dff_rd_addr_scan;
64wire dff_rd_addr_scanin;
65wire dff_rd_addr_scanout;
66wire [6:0] rd_adr_d1;
67wire [6:0] rd_adr_mq_l_unused;
68wire [6:0] rd_adr_q_unused;
69wire [6:0] rd_adr_q_l_unused;
70wire dff_rd_en_scanin;
71wire dff_rd_en_scanout;
72wire rd_en_d1;
73wire rd_en_mq_l_unused;
74wire rd_en_q_unused;
75wire rd_en_q_l_unused;
76wire dff_wr_en_scanin;
77wire dff_wr_en_scanout;
78wire wr_en_d1;
79wire [20:1] dff_din_hi_scan;
80wire dff_din_hi_scanin;
81wire dff_din_hi_scanout;
82wire [41:0] din_d1;
83wire [20:1] dff_din_lo_scan;
84wire dff_din_lo_scanin;
85wire dff_din_lo_scanout;
86wire wr_inh_;
87wire rd_en_d1_qual;
88wire wr_en_d1_qual;
89wire [41:0] local_dout;
90wire dff_dout_scanout;
91wire dff_dout_scanin;
92
93input [6:0] wr_adr;
94input wr_en;
95input [6:0] rd_adr;
96input rd_en;
97input [41:0] din;
98output [41:0] dout;
99input rdclk;
100input wrclk;
101input scan_in;
102input tcu_pce_ov;
103input tcu_aclk;
104input tcu_bclk;
105input tcu_array_wr_inhibit;
106input tcu_se_scancollar_in;
107
108
109input bist_clk_mux_sel;
110input rd_pce;
111input wr_pce;
112output scan_out;
113wire pce_ov = tcu_pce_ov;
114wire siclk = tcu_aclk;
115wire soclk = tcu_bclk;
116//================================================
117// Clock headers
118//================================================
119cl_mc1_bistlatch_4x rd_pce_lat (
120 .l2clk (rdclk),
121 .pce (rd_pce),
122 .pce_ov (pce_ov),
123 .lce (rd_lce)
124);
125cl_mc1_bistlatch_4x wr_pce_lat (
126 .l2clk (wrclk),
127 .pce (wr_pce),
128 .pce_ov (pce_ov),
129 .lce (wr_lce)
130);
131cl_mc1_bistl1hdr_8x rch_in (
132 .l2clk (rdclk),
133 .se (tcu_se_scancollar_in),
134 .clksel (bist_clk_mux_sel),
135 .bistclk(rdclk),
136 .lce (rd_lce),
137 .l1clk (rdclk_in)
138);
139cl_mc1_bistl1hdr_8x wch_in (
140 .l2clk (wrclk),
141 .se (tcu_se_scancollar_in),
142 .clksel (bist_clk_mux_sel),
143 .bistclk(rdclk),
144 .lce (wr_lce),
145 .l1clk (wrclk_in)
146);
147cl_mc1_bistl1hdr_8x rch_free (
148 .l2clk (rdclk),
149 .se (1'b0),
150 .clksel (bist_clk_mux_sel),
151 .bistclk(rdclk),
152 .lce (rd_lce),
153 .l1clk (rdclk_free)
154);
155cl_mc1_bistl1hdr_8x wch_free (
156 .l2clk (wrclk),
157 .se (1'b0),
158 .clksel (bist_clk_mux_sel),
159 .bistclk(rdclk),
160 .lce (wr_lce),
161 .l1clk (wrclk_free)
162);
163
164
165///////////////////////////////////////////////////////////////
166// Flop the inputs //
167///////////////////////////////////////////////////////////////
168n2_com_dp_128x42s_cust_msff_ctl_macro__width_7 dff_wr_addr (
169 .scan_in (dff_wr_addr_scanin),
170 .scan_out (dff_wr_addr_scanout),
171 .l1clk (wrclk_in),
172 .din (wr_adr[6:0]),
173 .dout (wr_adr_d1[6:0]),
174 .siclk(siclk),
175 .soclk(soclk)
176);
177n2_com_dp_128x42s_cust_sram_msff_mo_macro__fs_1__width_7 dff_rd_addr (
178 .scan_in ({dff_rd_addr_scan[6:1],dff_rd_addr_scanin}),
179 .scan_out ({dff_rd_addr_scanout,dff_rd_addr_scan[6:1]}),
180 .l1clk (rdclk_in),
181 .and_clk (rdclk_in),
182 .d (rd_adr[6:0]),
183 .mq (rd_adr_d1[6:0]),
184 .mq_l (rd_adr_mq_l_unused[6:0]),
185 .q (rd_adr_q_unused[6:0]),
186 .q_l (rd_adr_q_l_unused[6:0]),
187 .siclk(siclk),
188 .soclk(soclk)
189);
190n2_com_dp_128x42s_cust_sram_msff_mo_macro__width_1 dff_rd_en (
191 .scan_in (dff_rd_en_scanin),
192 .scan_out (dff_rd_en_scanout),
193 .l1clk (rdclk_in),
194 .and_clk (rdclk_in),
195 .d (rd_en),
196 .mq (rd_en_d1),
197 .mq_l (rd_en_mq_l_unused),
198 .q (rd_en_q_unused),
199 .q_l (rd_en_q_l_unused),
200 .siclk(siclk),
201 .soclk(soclk)
202);
203n2_com_dp_128x42s_cust_msff_ctl_macro__width_1 dff_wr_en (
204 .scan_in (dff_wr_en_scanin),
205 .scan_out (dff_wr_en_scanout),
206 .l1clk (wrclk_in),
207 .din (wr_en),
208 .dout (wr_en_d1),
209 .siclk(siclk),
210 .soclk(soclk)
211);
212n2_com_dp_128x42s_cust_msff_ctl_macro__fs_1__width_21 dff_din_hi (
213 .scan_in ({dff_din_hi_scan[20:1],dff_din_hi_scanin}),
214 .scan_out ({dff_din_hi_scanout,dff_din_hi_scan[20:1]}),
215 .l1clk (wrclk_in),
216 .din (din[41:21]),
217 .dout (din_d1[41:21]),
218 .siclk(siclk),
219 .soclk(soclk)
220);
221n2_com_dp_128x42s_cust_msff_ctl_macro__fs_1__width_21 dff_din_lo (
222 .scan_in ({dff_din_lo_scan[20:1],dff_din_lo_scanin}),
223 .scan_out ({dff_din_lo_scanout,dff_din_lo_scan[20:1]}),
224 .l1clk (wrclk_in),
225 .din (din[20:0]),
226 .dout (din_d1[20:0]),
227 .siclk(siclk),
228 .soclk(soclk)
229);
230n2_com_dp_128x42s_cust_inv_macro__width_1 wr_inh_inv (
231 .din (tcu_array_wr_inhibit),
232 .dout (wr_inh_)
233);
234n2_com_dp_128x42s_cust_and_macro__width_2 enable_qual (
235 .din0 ({2{wr_inh_}}),
236 .din1 ({rd_en_d1,wr_en_d1}),
237 .dout ({rd_en_d1_qual,wr_en_d1_qual})
238);
239n2_com_dp_128x42s_cust_n2_com_array_macro__rows_128__width_42__z_array array (
240 .rclk (rdclk_free),
241 .wclk (wrclk_free),
242 .wr_adr (wr_adr_d1[6:0]),
243 .wr_en (wr_en_d1_qual),
244 .rd_adr (rd_adr_d1[6:0]),
245 .rd_en (rd_en_d1_qual),
246 .din (din_d1[41:0]),
247 .dout (local_dout[41:0])
248);
249
250
251assign dout[41:0] = local_dout[41:0];
252assign dff_dout_scanout = dff_dout_scanin;
253
254supply0 vss;
255supply1 vdd;
256
257// fixscan start:
258assign dff_wr_addr_scanin = scan_in ;
259assign dff_rd_addr_scanin = dff_wr_addr_scanout ;
260assign dff_wr_en_scanin = dff_rd_addr_scanout ;
261assign dff_rd_en_scanin = dff_wr_en_scanout ;
262assign dff_din_lo_scanin = dff_rd_en_scanout ;
263assign dff_din_hi_scanin = dff_din_lo_scanout ;
264assign dff_dout_scanin = dff_din_hi_scanout ;
265assign scan_out = dff_dout_scanout ;
266// fixscan end:
267
268
269endmodule
270
271
272
273
274
275
276
277// any PARAMS parms go into naming of macro
278
279module n2_com_dp_128x42s_cust_msff_ctl_macro__width_7 (
280 din,
281 l1clk,
282 scan_in,
283 siclk,
284 soclk,
285 dout,
286 scan_out);
287wire [6:0] fdin;
288wire [5:0] so;
289
290 input [6:0] din;
291 input l1clk;
292 input scan_in;
293
294
295 input siclk;
296 input soclk;
297
298 output [6:0] dout;
299 output scan_out;
300assign fdin[6:0] = din[6:0];
301
302
303
304
305
306
307dff #(7) d0_0 (
308.l1clk(l1clk),
309.siclk(siclk),
310.soclk(soclk),
311.d(fdin[6:0]),
312.si({scan_in,so[5:0]}),
313.so({so[5:0],scan_out}),
314.q(dout[6:0])
315);
316
317
318
319
320
321
322
323
324
325
326
327
328endmodule
329
330
331
332
333
334
335
336
337
338//
339// macro for cl_mc1_sram_msff_mo_{16,8,4}x flops
340//
341//
342
343
344
345
346
347module n2_com_dp_128x42s_cust_sram_msff_mo_macro__fs_1__width_7 (
348 d,
349 scan_in,
350 l1clk,
351 and_clk,
352 siclk,
353 soclk,
354 mq,
355 mq_l,
356 scan_out,
357 q,
358 q_l);
359input [6:0] d;
360 input [6:0] scan_in;
361input l1clk;
362input and_clk;
363input siclk;
364input soclk;
365output [6:0] mq;
366output [6:0] mq_l;
367 output [6:0] scan_out;
368output [6:0] q;
369output [6:0] q_l;
370
371
372
373
374
375
376new_dlata #(7) d0_0 (
377.d(d[6:0]),
378.si(scan_in[6:0]),
379.so(scan_out[6:0]),
380.l1clk(l1clk),
381.and_clk(and_clk),
382.siclk(siclk),
383.soclk(soclk),
384.q(q[6:0]),
385.q_l(q_l[6:0]),
386.mq(mq[6:0]),
387.mq_l(mq_l[6:0])
388);
389
390
391
392
393
394
395
396
397
398
399//place::generic_place($width,$stack,$left);
400
401endmodule
402
403
404
405
406
407//
408// macro for cl_mc1_sram_msff_mo_{16,8,4}x flops
409//
410//
411
412
413
414
415
416module n2_com_dp_128x42s_cust_sram_msff_mo_macro__width_1 (
417 d,
418 scan_in,
419 l1clk,
420 and_clk,
421 siclk,
422 soclk,
423 mq,
424 mq_l,
425 scan_out,
426 q,
427 q_l);
428input [0:0] d;
429 input scan_in;
430input l1clk;
431input and_clk;
432input siclk;
433input soclk;
434output [0:0] mq;
435output [0:0] mq_l;
436 output scan_out;
437output [0:0] q;
438output [0:0] q_l;
439
440
441
442
443
444
445new_dlata #(1) d0_0 (
446.d(d[0:0]),
447.si(scan_in),
448.so(scan_out),
449.l1clk(l1clk),
450.and_clk(and_clk),
451.siclk(siclk),
452.soclk(soclk),
453.q(q[0:0]),
454.q_l(q_l[0:0]),
455.mq(mq[0:0]),
456.mq_l(mq_l[0:0])
457);
458
459
460
461
462
463
464
465
466
467
468//place::generic_place($width,$stack,$left);
469
470endmodule
471
472
473
474
475
476
477
478
479
480// any PARAMS parms go into naming of macro
481
482module n2_com_dp_128x42s_cust_msff_ctl_macro__width_1 (
483 din,
484 l1clk,
485 scan_in,
486 siclk,
487 soclk,
488 dout,
489 scan_out);
490wire [0:0] fdin;
491
492 input [0:0] din;
493 input l1clk;
494 input scan_in;
495
496
497 input siclk;
498 input soclk;
499
500 output [0:0] dout;
501 output scan_out;
502assign fdin[0:0] = din[0:0];
503
504
505
506
507
508
509dff #(1) d0_0 (
510.l1clk(l1clk),
511.siclk(siclk),
512.soclk(soclk),
513.d(fdin[0:0]),
514.si(scan_in),
515.so(scan_out),
516.q(dout[0:0])
517);
518
519
520
521
522
523
524
525
526
527
528
529
530endmodule
531
532
533
534
535
536
537
538
539
540
541
542
543
544// any PARAMS parms go into naming of macro
545
546module n2_com_dp_128x42s_cust_msff_ctl_macro__fs_1__width_21 (
547 din,
548 l1clk,
549 scan_in,
550 siclk,
551 soclk,
552 dout,
553 scan_out);
554wire [20:0] fdin;
555
556 input [20:0] din;
557 input l1clk;
558 input [20:0] scan_in;
559
560
561 input siclk;
562 input soclk;
563
564 output [20:0] dout;
565 output [20:0] scan_out;
566assign fdin[20:0] = din[20:0];
567
568
569
570
571
572
573dff #(21) d0_0 (
574.l1clk(l1clk),
575.siclk(siclk),
576.soclk(soclk),
577.d(fdin[20:0]),
578.si(scan_in[20:0]),
579.so(scan_out[20:0]),
580.q(dout[20:0])
581);
582
583
584
585
586
587
588
589
590
591
592
593
594endmodule
595
596
597
598
599
600
601
602
603
604//
605// invert macro
606//
607//
608
609
610
611
612
613module n2_com_dp_128x42s_cust_inv_macro__width_1 (
614 din,
615 dout);
616 input [0:0] din;
617 output [0:0] dout;
618
619
620
621
622
623
624inv #(1) d0_0 (
625.in(din[0:0]),
626.out(dout[0:0])
627);
628
629
630
631
632
633
634
635
636
637endmodule
638
639
640
641
642
643//
644// and macro for ports = 2,3,4
645//
646//
647
648
649
650
651
652module n2_com_dp_128x42s_cust_and_macro__width_2 (
653 din0,
654 din1,
655 dout);
656 input [1:0] din0;
657 input [1:0] din1;
658 output [1:0] dout;
659
660
661
662
663
664
665and2 #(2) d0_0 (
666.in0(din0[1:0]),
667.in1(din1[1:0]),
668.out(dout[1:0])
669);
670
671
672
673
674
675
676
677
678
679endmodule
680
681
682
683
684
685
686
687
688
689
690module n2_com_dp_128x42s_cust_n2_com_array_macro__rows_128__width_42__z_array (
691 rclk,
692 wclk,
693 rd_adr,
694 rd_en,
695 wr_en,
696 wr_adr,
697 din,
698 dout);
699
700input rclk;
701input wclk;
702input [6:0] rd_adr;
703input rd_en;
704input wr_en;
705input [6:0] wr_adr;
706input [42-1:0] din;
707output [42-1:0] dout;
708
709
710
711reg [42-1:0] mem[128-1:0];
712reg [42-1:0] local_dout;
713
714`ifndef NOINITMEM
715// Emulate reset
716integer i;
717initial begin
718 for (i=0; i<128; i=i+1) begin
719 mem[i] = 42'b0;
720 end
721 local_dout = 42'b0;
722end
723`endif
724//////////////////////
725// Read/write array
726//////////////////////
727always @(negedge wclk) begin
728 if (wr_en) begin
729 mem[wr_adr] <= din;
730
731
732 end
733end
734always @(rclk or rd_en or wr_en or rd_adr or wr_adr) begin
735 if (rclk) begin
736 if (rd_en) begin
737 if (wr_en & (wr_adr[6:0] == rd_adr[6:0]))
738 local_dout[42-1:0] <= 42'hx;
739 else
740 local_dout[42-1:0] <= mem[rd_adr] ;
741 end
742 else
743 local_dout[42-1:0] <= ~(42'h0);
744 end
745end
746assign dout[42-1:0] = local_dout[42-1:0];
747supply0 vss;
748supply1 vdd;
749
750
751
752
753endmodule
754