OpenCores
URL https://opencores.org/ocsvn/s1_core/s1_core/trunk

Subversion Repositories s1_core

[/] [s1_core/] [trunk/] [hdl/] [rtl/] [sparc_core/] [sparc_ifu_ifqdp.v] - Blame information for rev 95

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 95 fafa1971
// ========== Copyright Header Begin ==========================================
2
// 
3
// OpenSPARC T1 Processor File: sparc_ifu_ifqdp.v
4
// Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
5
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
6
// 
7
// The above named program is free software; you can redistribute it and/or
8
// modify it under the terms of the GNU General Public
9
// License version 2 as published by the Free Software Foundation.
10
// 
11
// The above named program is distributed in the hope that it will be 
12
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
// General Public License for more details.
15
// 
16
// You should have received a copy of the GNU General Public
17
// License along with this work; if not, write to the Free Software
18
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19
// 
20
// ========== Copyright Header End ============================================
21
///////////////////////////////////////////////////////////////////////
22
/*
23
//  Module Name: sparc_ifu_ifqdp
24
//  Description:
25
//  The IFQ is the icache fill queue.  This communicates between the
26
//  IFU and the outside world.  It handles icache misses and
27
//  invalidate requests from the crossbar.
28
//
29
*/
30
 
31
//FPGA_SYN enables all FPGA related modifications
32
 
33
 
34
 
35
 
36
 
37
////////////////////////////////////////////////////////////////////////
38
// Global header file includes
39
////////////////////////////////////////////////////////////////////////
40
 
41
/*
42
/* ========== Copyright Header Begin ==========================================
43
*
44
* OpenSPARC T1 Processor File: iop.h
45
* Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
46
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
47
*
48
* The above named program is free software; you can redistribute it and/or
49
* modify it under the terms of the GNU General Public
50
* License version 2 as published by the Free Software Foundation.
51
*
52
* The above named program is distributed in the hope that it will be
53
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
54
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
55
* General Public License for more details.
56
*
57
* You should have received a copy of the GNU General Public
58
* License along with this work; if not, write to the Free Software
59
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
60
*
61
* ========== Copyright Header End ============================================
62
*/
63
//-*- verilog -*-
64
////////////////////////////////////////////////////////////////////////
65
/*
66
//
67
//  Description:        Global header file that contain definitions that
68
//                      are common/shared at the IOP chip level
69
*/
70
////////////////////////////////////////////////////////////////////////
71
 
72
 
73
// Address Map Defines
74
// ===================
75
 
76
 
77
 
78
 
79
// CMP space
80
 
81
 
82
 
83
// IOP space
84
 
85
 
86
 
87
 
88
                               //`define ENET_ING_CSR     8'h84
89
                               //`define ENET_EGR_CMD_CSR 8'h85
90
 
91
 
92
 
93
 
94
 
95
 
96
 
97
 
98
 
99
 
100
 
101
 
102
 
103
 
104
 
105
// L2 space
106
 
107
 
108
 
109
// More IOP space
110
 
111
 
112
 
113
 
114
 
115
//Cache Crossbar Width and Field Defines
116
//======================================
117
 
118
 
119
 
120
 
121
 
122
 
123
 
124
 
125
 
126
 
127
 
128
 
129
 
130
 
131
 
132
 
133
 
134
 
135
 
136
 
137
 
138
 
139
 
140
 
141
 
142
 
143
 
144
 
145
 
146
 
147
 
148
 
149
 
150
 
151
 
152
 
153
 
154
 
155
 
156
 
157
 
158
 
159
 
160
 
161
 
162
//bits 133:128 are shared by different fields
163
//for different packet types.
164
 
165
 
166
 
167
 
168
 
169
 
170
 
171
 
172
 
173
 
174
 
175
 
176
 
177
 
178
 
179
 
180
 
181
 
182
 
183
 
184
 
185
 
186
 
187
 
188
 
189
 
190
 
191
 
192
 
193
 
194
 
195
 
196
 
197
 
198
 
199
 
200
 
201
 
202
 
203
 
204
 
205
 
206
 
207
 
208
 
209
 
210
 
211
 
212
 
213
 
214
 
215
 
216
 
217
 
218
 
219
 
220
 
221
 
222
 
223
 
224
 
225
 
226
//End cache crossbar defines
227
 
228
 
229
// Number of COS supported by EECU 
230
 
231
 
232
 
233
// 
234
// BSC bus sizes
235
// =============
236
//
237
 
238
// General
239
 
240
 
241
 
242
 
243
// CTags
244
 
245
 
246
 
247
 
248
 
249
 
250
 
251
 
252
 
253
 
254
 
255
 
256
 
257
// reinstated temporarily
258
 
259
 
260
 
261
 
262
// CoS
263
 
264
 
265
 
266
 
267
 
268
 
269
// L2$ Bank
270
 
271
 
272
 
273
// L2$ Req
274
 
275
 
276
 
277
 
278
 
279
 
280
 
281
 
282
 
283
 
284
 
285
 
286
 
287
// L2$ Ack
288
 
289
 
290
 
291
 
292
 
293
 
294
 
295
 
296
// Enet Egress Command Unit
297
 
298
 
299
 
300
 
301
 
302
 
303
 
304
 
305
 
306
 
307
 
308
 
309
 
310
 
311
// Enet Egress Packet Unit
312
 
313
 
314
 
315
 
316
 
317
 
318
 
319
 
320
 
321
 
322
 
323
 
324
 
325
// This is cleaved in between Egress Datapath Ack's
326
 
327
 
328
 
329
 
330
 
331
 
332
 
333
 
334
// Enet Egress Datapath
335
 
336
 
337
 
338
 
339
 
340
 
341
 
342
 
343
 
344
 
345
 
346
 
347
 
348
 
349
 
350
 
351
// In-Order / Ordered Queue: EEPU
352
// Tag is: TLEN, SOF, EOF, QID = 15
353
 
354
 
355
 
356
 
357
 
358
 
359
// Nack + Tag Info + CTag
360
 
361
 
362
 
363
 
364
// ENET Ingress Queue Management Req
365
 
366
 
367
 
368
 
369
 
370
 
371
 
372
 
373
 
374
 
375
 
376
 
377
// ENET Ingress Queue Management Ack
378
 
379
 
380
 
381
 
382
 
383
 
384
 
385
 
386
// Enet Ingress Packet Unit
387
 
388
 
389
 
390
 
391
 
392
 
393
 
394
 
395
 
396
 
397
 
398
 
399
// ENET Ingress Packet Unit Ack
400
 
401
 
402
 
403
 
404
 
405
 
406
 
407
// In-Order / Ordered Queue: PCI
408
// Tag is: CTAG
409
 
410
 
411
 
412
 
413
 
414
// PCI-X Request
415
 
416
 
417
 
418
 
419
 
420
 
421
 
422
 
423
 
424
 
425
 
426
// PCI_X Acknowledge
427
 
428
 
429
 
430
 
431
 
432
 
433
 
434
 
435
 
436
 
437
 
438
//
439
// BSC array sizes
440
//================
441
//
442
 
443
 
444
 
445
 
446
 
447
 
448
 
449
 
450
 
451
 
452
 
453
 
454
// ECC syndrome bits per memory element
455
 
456
 
457
 
458
 
459
//
460
// BSC Port Definitions
461
// ====================
462
//
463
// Bits 7 to 4 of curr_port_id
464
 
465
 
466
 
467
 
468
 
469
 
470
 
471
 
472
// Number of ports of each type
473
 
474
 
475
// Bits needed to represent above
476
 
477
 
478
// How wide the linked list pointers are
479
// 60b for no payload (2CoS)
480
// 80b for payload (2CoS)
481
 
482
//`define BSC_OBJ_PTR   80
483
//`define BSC_HD1_HI    69
484
//`define BSC_HD1_LO    60
485
//`define BSC_TL1_HI    59
486
//`define BSC_TL1_LO    50
487
//`define BSC_CT1_HI    49
488
//`define BSC_CT1_LO    40
489
//`define BSC_HD0_HI    29
490
//`define BSC_HD0_LO    20
491
//`define BSC_TL0_HI    19
492
//`define BSC_TL0_LO    10
493
//`define BSC_CT0_HI     9
494
//`define BSC_CT0_LO     0
495
 
496
 
497
 
498
 
499
 
500
 
501
 
502
 
503
 
504
 
505
 
506
 
507
 
508
 
509
 
510
 
511
 
512
 
513
 
514
 
515
 
516
 
517
 
518
 
519
 
520
 
521
 
522
 
523
 
524
 
525
 
526
 
527
 
528
 
529
// I2C STATES in DRAMctl
530
 
531
 
532
 
533
 
534
 
535
 
536
 
537
//
538
// IOB defines
539
// ===========
540
//
541
 
542
 
543
 
544
 
545
 
546
 
547
 
548
 
549
 
550
 
551
 
552
 
553
 
554
 
555
 
556
 
557
 
558
 
559
 
560
//`define IOB_INT_STAT_WIDTH   32
561
//`define IOB_INT_STAT_HI      31
562
//`define IOB_INT_STAT_LO       0
563
 
564
 
565
 
566
 
567
 
568
 
569
 
570
 
571
 
572
 
573
 
574
 
575
 
576
 
577
 
578
 
579
 
580
 
581
 
582
 
583
 
584
 
585
 
586
 
587
 
588
 
589
 
590
 
591
 
592
 
593
 
594
 
595
 
596
 
597
 
598
 
599
 
600
 
601
 
602
 
603
 
604
 
605
 
606
 
607
 
608
 
609
 
610
 
611
 
612
// fixme - double check address mapping
613
// CREG in `IOB_INT_CSR space
614
 
615
 
616
 
617
 
618
 
619
 
620
 
621
 
622
 
623
 
624
// CREG in `IOB_MAN_CSR space
625
 
626
 
627
 
628
 
629
 
630
 
631
 
632
 
633
 
634
 
635
 
636
 
637
 
638
 
639
 
640
 
641
 
642
 
643
 
644
 
645
 
646
 
647
 
648
 
649
 
650
 
651
 
652
 
653
 
654
 
655
 
656
 
657
 
658
 
659
 
660
 
661
 
662
// Address map for TAP access of SPARC ASI
663
 
664
 
665
 
666
 
667
 
668
 
669
 
670
 
671
 
672
 
673
 
674
 
675
 
676
//
677
// CIOP UCB Bus Width
678
// ==================
679
//
680
//`define IOB_EECU_WIDTH       16  // ethernet egress command
681
//`define EECU_IOB_WIDTH       16
682
 
683
//`define IOB_NRAM_WIDTH       16  // NRAM (RLDRAM previously)
684
//`define NRAM_IOB_WIDTH        4
685
 
686
 
687
 
688
 
689
//`define IOB_ENET_ING_WIDTH   32  // ethernet ingress
690
//`define ENET_ING_IOB_WIDTH    8
691
 
692
//`define IOB_ENET_EGR_WIDTH    4  // ethernet egress
693
//`define ENET_EGR_IOB_WIDTH    4
694
 
695
//`define IOB_ENET_MAC_WIDTH    4  // ethernet MAC
696
//`define ENET_MAC_IOB_WIDTH    4
697
 
698
 
699
 
700
 
701
//`define IOB_BSC_WIDTH         4  // BSC
702
//`define BSC_IOB_WIDTH         4
703
 
704
 
705
 
706
 
707
 
708
 
709
 
710
//`define IOB_CLSP_WIDTH        4  // clk spine unit
711
//`define CLSP_IOB_WIDTH        4
712
 
713
 
714
 
715
 
716
 
717
//
718
// CIOP UCB Buf ID Type
719
// ====================
720
//
721
 
722
 
723
 
724
//
725
// Interrupt Device ID
726
// ===================
727
//
728
// Caution: DUMMY_DEV_ID has to be 9 bit wide
729
//          for fields to line up properly in the IOB.
730
 
731
 
732
 
733
//
734
// Soft Error related definitions 
735
// ==============================
736
//
737
 
738
 
739
 
740
//
741
// CMP clock
742
// =========
743
//
744
 
745
 
746
 
747
 
748
//
749
// NRAM/IO Interface
750
// =================
751
//
752
 
753
 
754
 
755
 
756
 
757
 
758
 
759
 
760
 
761
 
762
//
763
// NRAM/ENET Interface
764
// ===================
765
//
766
 
767
 
768
 
769
 
770
 
771
 
772
 
773
//
774
// IO/FCRAM Interface
775
// ==================
776
//
777
 
778
 
779
 
780
 
781
 
782
 
783
//
784
// PCI Interface
785
// ==================
786
// Load/store size encodings
787
// -------------------------
788
// Size encoding
789
// 000 - byte
790
// 001 - half-word
791
// 010 - word
792
// 011 - double-word
793
// 100 - quad
794
 
795
 
796
 
797
 
798
 
799
 
800
//
801
// JBI<->SCTAG Interface
802
// =======================
803
// Outbound Header Format
804
 
805
 
806
 
807
 
808
 
809
 
810
 
811
 
812
 
813
 
814
 
815
 
816
 
817
 
818
 
819
 
820
 
821
 
822
 
823
 
824
 
825
 
826
 
827
 
828
 
829
 
830
 
831
// Inbound Header Format
832
 
833
 
834
 
835
 
836
 
837
 
838
 
839
 
840
 
841
 
842
 
843
 
844
 
845
 
846
 
847
 
848
 
849
 
850
 
851
 
852
//
853
// JBI->IOB Mondo Header Format
854
// ============================
855
//
856
 
857
 
858
 
859
 
860
 
861
 
862
 
863
 
864
 
865
 
866
 
867
 
868
 
869
 
870
// JBI->IOB Mondo Bus Width/Cycle
871
// ==============================
872
// Cycle  1 Header[15:8]
873
// Cycle  2 Header[ 7:0]
874
// Cycle  3 J_AD[127:120]
875
// Cycle  4 J_AD[119:112]
876
// .....
877
// Cycle 18 J_AD[  7:  0]
878
 
879
 
880
/*
881
/* ========== Copyright Header Begin ==========================================
882
*
883
* OpenSPARC T1 Processor File: ifu.h
884
* Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
885
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
886
*
887
* The above named program is free software; you can redistribute it and/or
888
* modify it under the terms of the GNU General Public
889
* License version 2 as published by the Free Software Foundation.
890
*
891
* The above named program is distributed in the hope that it will be
892
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
893
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
894
* General Public License for more details.
895
*
896
* You should have received a copy of the GNU General Public
897
* License along with this work; if not, write to the Free Software
898
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
899
*
900
* ========== Copyright Header End ============================================
901
*/
902
////////////////////////////////////////////////////////////////////////
903
/*
904
//
905
//  Module Name: ifu.h
906
//  Description:
907
//  All ifu defines
908
*/
909
 
910
//--------------------------------------------
911
// Icache Values in IFU::ICD/ICV/ICT/FDP/IFQDP
912
//--------------------------------------------
913
// Set Values
914
 
915
// IC_IDX_HI = log(icache_size/4ways) - 1
916
 
917
 
918
// !!IMPORTANT!! a change to IC_LINE_SZ will mean a change to the code as
919
//   well.  Unfortunately this has not been properly parametrized.
920
//   Changing the IC_LINE_SZ param alone is *not* enough.
921
 
922
 
923
// !!IMPORTANT!! a change to IC_TAG_HI will mean a change to the code as
924
//   well.  Changing the IC_TAG_HI param alone is *not* enough to
925
//   change the PA range. 
926
// highest bit of PA
927
 
928
 
929
 
930
// Derived Values
931
// 4095
932
 
933
 
934
// number of entries - 1 = 511
935
 
936
 
937
// 12
938
 
939
 
940
// 28
941
 
942
 
943
// 7
944
 
945
 
946
// tags for all 4 ways + parity
947
// 116
948
 
949
 
950
// 115
951
 
952
 
953
 
954
//----------------------------------------------------------------------
955
// For thread scheduler in IFU::DTU::SWL
956
//----------------------------------------------------------------------
957
// thread states:  (thr_state[4:0])
958
 
959
 
960
 
961
 
962
 
963
 
964
 
965
 
966
 
967
// thread configuration register bit fields
968
 
969
 
970
 
971
 
972
 
973
 
974
 
975
//----------------------------------------------------------------------
976
// For MIL fsm in IFU::IFQ
977
//----------------------------------------------------------------------
978
 
979
 
980
 
981
 
982
 
983
 
984
 
985
 
986
 
987
 
988
 
989
//---------------------------------------------------
990
// Interrupt Block
991
//---------------------------------------------------
992
 
993
 
994
 
995
 
996
 
997
 
998
 
999
//-------------------------------------
1000
// IFQ
1001
//-------------------------------------
1002
// valid bit plus ifill
1003
 
1004
 
1005
 
1006
 
1007
 
1008
 
1009
 
1010
 
1011
 
1012
 
1013
 
1014
 
1015
 
1016
//`ifdef SPARC_L2_64B
1017
 
1018
 
1019
//`else
1020
//`define BANK_ID_HI 8
1021
//`define BANK_ID_LO 7
1022
//`endif
1023
 
1024
//`define CPX_INV_PA_HI  116
1025
//`define CPX_INV_PA_LO  112
1026
 
1027
 
1028
 
1029
 
1030
 
1031
 
1032
 
1033
//----------------------------------------
1034
// IFU Traps
1035
//----------------------------------------
1036
// precise
1037
 
1038
 
1039
 
1040
 
1041
 
1042
 
1043
 
1044
 
1045
 
1046
 
1047
 
1048
 
1049
 
1050
 
1051
 
1052
// disrupting
1053
 
1054
 
1055
 
1056
 
1057
 
1058
 
1059
 
1060
 
1061
////////////////////////////////////////////////////////////////////////
1062
// Local header file includes / local defines
1063
////////////////////////////////////////////////////////////////////////
1064
 
1065
module sparc_ifu_ifqdp(/*AUTOARG*/
1066
   // Outputs
1067
   so, ifu_lsu_pcxpkt_e, ifq_fdp_fill_inst, ifq_erb_asidata_i2,
1068
   ifd_inv_ifqop_i2, ifq_icd_index_bf, ifq_icd_wrdata_i2,
1069
   ifq_ict_wrtag_f, ifq_erb_wrindex_f, ifq_icd_wrway_bf,
1070
   ifd_ifc_milhit_s, ifd_ifc_instoffset0, ifd_ifc_instoffset1,
1071
   ifd_ifc_instoffset2, ifd_ifc_instoffset3, ifd_ifc_cpxthr_nxt,
1072
   ifd_ifc_cpxreq_nxt, ifd_ifc_cpxreq_i1, ifd_ifc_destid0,
1073
   ifd_ifc_destid1, ifd_ifc_destid2, ifd_ifc_destid3,
1074
   ifd_ifc_newdestid_s, ifd_ifc_pcxline_d, ifd_ifc_asi_vachklo_i2,
1075
   ifd_ifc_cpxvld_i2, ifd_ifc_asiaddr_i2, ifd_ifc_iobpkt_i2,
1076
   ifd_ifc_fwd2ic_i2, ifd_ifc_4bpkt_i2, ifd_ifc_cpxnc_i2,
1077
   ifd_ifc_cpxce_i2, ifd_ifc_cpxue_i2, ifd_ifc_cpxms_i2,
1078
   ifd_ifc_miladdr4_i2, ifd_inv_wrway_i2,
1079
   // Inputs
1080
   rclk, se, si, lsu_ifu_cpxpkt_i1, lsu_ifu_asi_addr,
1081
   lsu_ifu_stxa_data, itlb_ifq_paddr_s, fdp_ifq_paddr_f,
1082
   ifc_ifd_reqvalid_e, ifc_ifd_filladdr4_i2, ifc_ifd_repway_s,
1083
   ifc_ifd_uncached_e, ifc_ifd_thrid_e, ifc_ifd_pcxline_adj_d,
1084
   ifc_ifd_errinv_e, ifc_ifd_ldmil_sel_new, ifc_ifd_ld_inq_i1,
1085
   ifc_ifd_idx_sel_fwd_i2, ifc_ifd_milreq_sel_d_l,
1086
   ifc_ifd_milfill_sel_i2_l, ifc_ifd_finst_sel_l,
1087
   ifc_ifd_ifqbyp_sel_fwd_l, ifc_ifd_ifqbyp_sel_inq_l,
1088
   ifc_ifd_ifqbyp_sel_asi_l, ifc_ifd_ifqbyp_sel_lsu_l,
1089
   ifc_ifd_ifqbyp_en_l, ifc_ifd_addr_sel_bist_i2_l,
1090
   ifc_ifd_addr_sel_asi_i2_l, ifc_ifd_addr_sel_old_i2_l,
1091
   ifc_ifd_addr_sel_fill_i2_l, mbist_icache_way, mbist_icache_word,
1092
   mbist_icache_index
1093
   );
1094
 
1095
   input         rclk,
1096
           se,
1097
           si;
1098
 
1099
   input [145-1:0] lsu_ifu_cpxpkt_i1;
1100
   input [17:0]   lsu_ifu_asi_addr;
1101
   input [47:0]   lsu_ifu_stxa_data;
1102
 
1103
   input [39:10]  itlb_ifq_paddr_s;
1104
   input [9:2]    fdp_ifq_paddr_f;
1105
 
1106
   // from ifqctl
1107
   input         ifc_ifd_reqvalid_e;
1108
   input         ifc_ifd_filladdr4_i2;
1109
   input [1:0]   ifc_ifd_repway_s;
1110
   input         ifc_ifd_uncached_e;
1111
   input [1:0]   ifc_ifd_thrid_e;
1112
   input [4:2]   ifc_ifd_pcxline_adj_d;
1113
 
1114
   input         ifc_ifd_errinv_e;
1115
 
1116
   // 2:1 mux selects
1117
   input [3:0]   ifc_ifd_ldmil_sel_new;  // mil load enable
1118
 
1119
   input        ifc_ifd_ld_inq_i1;        // ld new cpxreq to in buffer
1120
   input        ifc_ifd_idx_sel_fwd_i2;
1121
 
1122
   // other mux selects
1123
   input [3:0]  ifc_ifd_milreq_sel_d_l,   // selects outgoing mil_req
1124
                            ifc_ifd_milfill_sel_i2_l; // selects the mil entry just
1125
         // returned from the fill
1126
         // port
1127
   input [3:0]  ifc_ifd_finst_sel_l;    // address to load to thr IR
1128
 
1129
   input        ifc_ifd_ifqbyp_sel_fwd_l, // select next input to process
1130
                            ifc_ifd_ifqbyp_sel_inq_l,
1131
                            ifc_ifd_ifqbyp_sel_asi_l,
1132
                            ifc_ifd_ifqbyp_sel_lsu_l;
1133
         input        ifc_ifd_ifqbyp_en_l;
1134
 
1135
   input        ifc_ifd_addr_sel_bist_i2_l,
1136
                            ifc_ifd_addr_sel_asi_i2_l,
1137
                ifc_ifd_addr_sel_old_i2_l,
1138
                            ifc_ifd_addr_sel_fill_i2_l;
1139
 
1140
   input [1:0]  mbist_icache_way;
1141
   input        mbist_icache_word;
1142
   input [7:0]  mbist_icache_index;
1143
 
1144
   output       so;
1145
 
1146
   output [51:0] ifu_lsu_pcxpkt_e;
1147
 
1148
   output [32:0] ifq_fdp_fill_inst;
1149
   output [47:0] ifq_erb_asidata_i2;
1150
 
1151
   output [145-1:0] ifd_inv_ifqop_i2;
1152
 
1153
   output [11:2]  ifq_icd_index_bf;   // index for wr and bist
1154
 
1155
   output [135:0]         ifq_icd_wrdata_i2;
1156
   output [(39 - 11):0]  ifq_ict_wrtag_f;      // fill tag
1157
//   output [`IC_TAG_SZ-1:0] ifq_erb_wrtag_f;      // tag w/o parity
1158
   output [11:4]   ifq_erb_wrindex_f;
1159
   output [1:0]            ifq_icd_wrway_bf;     // fill data way
1160
 
1161
   output [3:0]           ifd_ifc_milhit_s;     // if an Imiss hits in MIL
1162
//   output [7:0]           ifd_ifc_mil_repway_s;
1163
 
1164
   output [1:0]           ifd_ifc_instoffset0;   // to select inst to TIR
1165
   output [1:0]           ifd_ifc_instoffset1;   // to select inst to TIR
1166
   output [1:0]           ifd_ifc_instoffset2;   // to select inst to TIR
1167
   output [1:0]           ifd_ifc_instoffset3;   // to select inst to TIR
1168
 
1169
   output [1:0]            ifd_ifc_cpxthr_nxt;
1170
   output [3:0]            ifd_ifc_cpxreq_nxt;    // cpx reqtype + vbit
1171
   output [(143 - 140 + 1):0] ifd_ifc_cpxreq_i1;    // cpx reqtype + vbit
1172
 
1173
 
1174
   output [2:0]            ifd_ifc_destid0,
1175
                                       ifd_ifc_destid1,
1176
                                       ifd_ifc_destid2,
1177
                                       ifd_ifc_destid3,
1178
                                       ifd_ifc_newdestid_s;
1179
 
1180
   output [4:2]            ifd_ifc_pcxline_d;
1181
 
1182
   output                  ifd_ifc_asi_vachklo_i2;
1183
 
1184
   output                  ifd_ifc_cpxvld_i2;
1185
   output [3:2]            ifd_ifc_asiaddr_i2;
1186
   output                  ifd_ifc_iobpkt_i2;
1187
   output                  ifd_ifc_fwd2ic_i2;
1188
   output                  ifd_ifc_4bpkt_i2;
1189
   output                  ifd_ifc_cpxnc_i2;
1190
   output                  ifd_ifc_cpxce_i2,
1191
                                       ifd_ifc_cpxue_i2,
1192
                           ifd_ifc_cpxms_i2;
1193
 
1194
   output [3:0]            ifd_ifc_miladdr4_i2;
1195
 
1196
   output [1:0]            ifd_inv_wrway_i2;
1197
 
1198
 
1199
 
1200
   //----------------------------------------------------------------------
1201
   // Declarations
1202
   //----------------------------------------------------------------------   
1203
 
1204
   // local signals
1205
   wire [39:0]             imiss_paddr_s;
1206
   wire [9:2]              lcl_paddr_s;
1207
 
1208
   wire [42:2]             mil_entry0,         // mil entries
1209
                                       mil_entry1,
1210
                                       mil_entry2,
1211
                                       mil_entry3;
1212
 
1213
//   wire [42:2]             mil0_in_s,          // inputs to mil
1214
//                                     mil1_in_s,
1215
//                                     mil2_in_s,
1216
//                                     mil3_in_s;
1217
 
1218
   wire                    tag_par_s,
1219
                                       tag_par_i2;
1220
 
1221
   wire [42:2]             newmil_entry_s;
1222
 
1223
   wire [42:2]             mil_pcxreq_d,        // outgoing request from mil
1224
                                       pcxreq_d,            // mil or direct ic or prev req
1225
                                       pcxreq_e;          // outgoing request to lsu
1226
 
1227
   wire [42:2]             fill_addr_i2,
1228
                                       fill_addr_adj,
1229
                                       icaddr_i2,
1230
                                       asi_addr_i2,
1231
                                       bist_addr_i2;
1232
 
1233
   wire [42:4]             wraddr_f;
1234
 
1235
 
1236
   wire [145-1:0]   inq_cpxpkt_i1,   // output from inq
1237
//                                           inq_cpxpkt_nxt,
1238
                                             stxa_data_pkt,
1239
                           fwd_data_pkt,
1240
                                             ifqop_i1,
1241
                                             ifqop_i2;        // ifq op currently being processed
1242
 
1243
   wire [3:0]              swc_i2;
1244
 
1245
   wire [135:0]            icdata_i2;
1246
 
1247
   wire [3:0]              parity_i2,
1248
                                       par_i2;
1249
 
1250
   wire [17:0]             asi_va_i2,
1251
                           asi_va_i1;
1252
   wire [13:2]             asi_fwd_index;
1253
   wire                    clk;
1254
 
1255
 
1256
//   wire [`IC_IDX_HI:6]     inv_addr_i2;
1257
 
1258
   //
1259
   // Code start here 
1260
   //
1261
 
1262
   assign                  clk = rclk;
1263
 
1264
   //----------------------------------------------------------------------
1265
   // Instruction Miss - Fill Request Datapath
1266
   //----------------------------------------------------------------------
1267
 
1268
   // new set of flops
1269
   dff #(8) pcs_reg(.din (fdp_ifq_paddr_f[9:2]),
1270
                    .q   (lcl_paddr_s[9:2]),
1271
                    .clk (clk), .se(se), .si(), .so());
1272
 
1273
 
1274
   // bits 1:0 are floating
1275
   assign  imiss_paddr_s = {itlb_ifq_paddr_s[39:10],
1276
                            lcl_paddr_s[9:2],
1277
                            2'b0};
1278
 
1279
   // Check for hit in MIL
1280
   // Should we enable the comps to save power? -- timing problem
1281
 
1282
   // compare only top 35 bits (bot 5 bits are line offset of 32B line)
1283
   sparc_ifu_cmp35 milcmp0 (.hit (ifd_ifc_milhit_s[0]),
1284
                                              .a (imiss_paddr_s[39:5]),
1285
                                              .b (mil_entry0[39:5]),
1286
                                              .valid (1'b1)
1287
                                              );
1288
 
1289
   sparc_ifu_cmp35 milcmp1 (.hit (ifd_ifc_milhit_s[1]),
1290
                                              .a (imiss_paddr_s[39:5]),
1291
                                              .b (mil_entry1[39:5]),
1292
                                              .valid (1'b1)
1293
                                              );
1294
 
1295
   sparc_ifu_cmp35 milcmp2 (.hit (ifd_ifc_milhit_s[2]),
1296
                                              .a (imiss_paddr_s[39:5]),
1297
                                              .b (mil_entry2[39:5]),
1298
                                              .valid (1'b1)
1299
                                              );
1300
   sparc_ifu_cmp35 milcmp3 (.hit (ifd_ifc_milhit_s[3]),
1301
                                              .a (imiss_paddr_s[39:5]),
1302
                                              .b (mil_entry3[39:5]),
1303
                                              .valid (1'b1)
1304
                                              );
1305
 
1306
   // Send replacement way to ctl logic
1307
//   assign  ifd_ifc_mil_repway_s =  {mil_entry3[41:40],
1308
//                                        mil_entry2[41:40],
1309
//                                        mil_entry1[41:40],
1310
//                                        mil_entry0[41:40]};
1311
 
1312
 
1313
   // calculate tag parity
1314
   sparc_ifu_par32 tag_par(.in  ({{(32 - (39 - 11)){1'b0}},
1315
                                  imiss_paddr_s[39:(11 + 1)]}),
1316
                                             .out (tag_par_s));
1317
 
1318
 
1319
   // Missed Instruction List
1320
   // 43    - NOT cacheable
1321
   // 42    - tag parity
1322
   // 41:40 - repl way
1323
   // 39:0  - paddr
1324
 
1325
   // Prepare Missed Instruction List entry
1326
   assign  newmil_entry_s = {tag_par_s,
1327
                                               ifc_ifd_repway_s,
1328
                                               imiss_paddr_s[39:2]};
1329
 
1330
   // ldmil_sel is thr_s[3:0] & imiss_s
1331
//   dp_mux2es  #(41)    milin_mux0(.dout (mil0_in_s),
1332
//                                                        .in0  (mil_entry0), 
1333
//                                                        .in1  (newmil_entry_s),
1334
//                                                        .sel  (ifc_ifd_ldmil_sel_new[0]));
1335
//   dp_mux2es  #(41)    milin_mux1(.dout (mil1_in_s),
1336
//                                                      .in0  (mil_entry1), 
1337
//                                                      .in1  (newmil_entry_s),
1338
//                                                      .sel  (ifc_ifd_ldmil_sel_new[1]));
1339
//   dp_mux2es  #(41)    milin_mux2(.dout (mil2_in_s),
1340
//                                                      .in0  (mil_entry2), 
1341
//                                                      .in1  (newmil_entry_s),
1342
//                                                      .sel  (ifc_ifd_ldmil_sel_new[2]));
1343
//   dp_mux2es  #(41)    milin_mux3(.dout (mil3_in_s),
1344
//                                                      .in0  (mil_entry3), 
1345
//                                                      .in1  (newmil_entry_s),
1346
//                                                      .sel  (ifc_ifd_ldmil_sel_new[3]));
1347
 
1348
   wire    clk_mil0;
1349
 
1350
 
1351
 
1352
 
1353
 
1354
 
1355
 
1356
   wire    clk_mil1;
1357
 
1358
 
1359
 
1360
 
1361
 
1362
 
1363
 
1364
   wire    clk_mil2;
1365
 
1366
 
1367
 
1368
 
1369
 
1370
 
1371
 
1372
   wire    clk_mil3;
1373
 
1374
 
1375
 
1376
 
1377
 
1378
 
1379
 
1380
 
1381
 
1382
 
1383
   dffe #(41)   mil0(.din  (newmil_entry_s),
1384
                                .en (~(~ifc_ifd_ldmil_sel_new[0])), .clk(rclk),
1385
                                .q    (mil_entry0),
1386
                                .se   (se), .si(), .so());
1387
 
1388
 
1389
 
1390
 
1391
 
1392
 
1393
 
1394
 
1395
   dffe #(41)   mil1(.din (newmil_entry_s),
1396
                                .en (~(~ifc_ifd_ldmil_sel_new[1])), .clk(rclk),
1397
                                .q   (mil_entry1),
1398
                                .se  (se), .si(), .so());
1399
 
1400
 
1401
 
1402
 
1403
 
1404
 
1405
 
1406
 
1407
   dffe #(41)   mil2(.din (newmil_entry_s),
1408
                                .en (~(~ifc_ifd_ldmil_sel_new[2])), .clk(rclk),
1409
                                .q   (mil_entry2),
1410
                                .se  (se), .si(), .so());
1411
 
1412
 
1413
 
1414
 
1415
 
1416
 
1417
 
1418
 
1419
   dffe #(41)   mil3(.din (newmil_entry_s),
1420
                                .en (~(~ifc_ifd_ldmil_sel_new[3])), .clk(rclk),
1421
                                .q   (mil_entry3),
1422
                                .se  (se), .si(), .so());
1423
 
1424
 
1425
 
1426
 
1427
 
1428
 
1429
 
1430
   assign  ifd_ifc_newdestid_s = {imiss_paddr_s[39],
1431
                                                          imiss_paddr_s[7:6]};
1432
   assign  ifd_ifc_destid0 = {mil_entry0[39],
1433
                                                mil_entry0[7:6]};
1434
   assign  ifd_ifc_destid1 = {mil_entry1[39],
1435
                                                mil_entry1[7:6]};
1436
   assign  ifd_ifc_destid2 = {mil_entry2[39],
1437
                                                mil_entry2[7:6]};
1438
   assign  ifd_ifc_destid3 = {mil_entry3[39],
1439
                                                mil_entry3[7:6]};
1440
 
1441
   assign  ifd_ifc_instoffset0 = mil_entry0[3:2];
1442
   assign  ifd_ifc_instoffset1 = mil_entry1[3:2];
1443
   assign  ifd_ifc_instoffset2 = mil_entry2[3:2];
1444
   assign  ifd_ifc_instoffset3 = mil_entry3[3:2];
1445
 
1446
 
1447
   // MIL Request Out mux
1448
   dp_mux4ds  #(41)  milreq_mux (.dout (mil_pcxreq_d),
1449
                                                 .in0  ({mil_entry0[42:2]}),
1450
                                                 .in1  ({mil_entry1[42:2]}),
1451
                                                 .in2  ({mil_entry2[42:2]}),
1452
                                                 .in3  ({mil_entry3[42:2]}),
1453
                                                 .sel0_l  (ifc_ifd_milreq_sel_d_l[0]),
1454
                                                 .sel1_l  (ifc_ifd_milreq_sel_d_l[1]),
1455
                                                 .sel2_l  (ifc_ifd_milreq_sel_d_l[2]),
1456
                                                 .sel3_l  (ifc_ifd_milreq_sel_d_l[3]));
1457
 
1458
   // Next PCX Request Mux
1459
//   dp_mux3ds  #(44)  nxtpcx_mux (.dout  (pcxreq_d),
1460
//                                               .in0   (mil_pcxreq_d), 
1461
//                                               .in1   (44'bx),
1462
//                                               .in2   (pcxreq_e),
1463
//                                               .sel0_l  (ifc_ifd_nxtpcx_sel_new_d_l),
1464
//                                               .sel1_l  (ifc_ifd_nxtpcx_sel_err_d_l),
1465
//                                               .sel2_l  (ifc_ifd_nxtpcx_sel_prev_d_l));
1466
 
1467
 
1468
   // TBD: If destid == any L2 bank, need to zero out bit 4 for Rams
1469
   //    -- done
1470
   assign  ifd_ifc_pcxline_d[4:2] = mil_pcxreq_d[4:2];
1471
 
1472
   assign  pcxreq_d[42:5] = mil_pcxreq_d[42:5];
1473
   assign  pcxreq_d[4:2] = ifc_ifd_pcxline_adj_d[4:2];
1474
//   assign  pcxreq_d[1:0] = mil_pcxreq_d[1:0];  // dont need this
1475
 
1476
   dff #(41) pcxreq_reg (.din  (pcxreq_d),
1477
                                            .clk  (clk),
1478
                                            .q    (pcxreq_e),
1479
                                            .se   (se), .si(), .so());
1480
 
1481
// CHANGE to regular dff   
1482
//   dffe #(44) pcxreq_reg (.din  (pcxreq_d),
1483
//                                          .clk  (clk),
1484
//                                          .q    (pcxreq_e),
1485
//                          .en   (ifc_ifd_nxtpcx_sel_new_d),
1486
//                                          .se   (se), .si(), .so());
1487
 
1488
   // PCX Req Reg -- req type is 5 bits
1489
   assign   ifu_lsu_pcxpkt_e = {ifc_ifd_reqvalid_e,   // 51    - valid
1490
                                                  ifc_ifd_errinv_e,     // 50 - inv all ways
1491
                                ifc_ifd_uncached_e,   // 49 - not cacheable
1492
                                                  {5'b10000},          // 48:44 - req type
1493
                                                  pcxreq_e[41:40],      // 43:42 - rep way
1494
                                                  ifc_ifd_thrid_e[1:0], // 41:40 - thrid
1495
                                                  pcxreq_e[39:2],       // 39:2  - word address
1496
                                                  2'b0};                // force to zero
1497
 
1498
 
1499
   //----------------------------------------------------------------------
1500
   // Fill Return Address
1501
   //----------------------------------------------------------------------
1502
 
1503
   // MIL Fill Return Mux
1504
   dp_mux4ds  #(41)  milfill_mux(.dout (fill_addr_i2),
1505
                                                 .in0 ( mil_entry0),
1506
                                                 .in1 ( mil_entry1),
1507
                                                 .in2 ( mil_entry2),
1508
                                                 .in3 ( mil_entry3),
1509
                                                 .sel0_l (ifc_ifd_milfill_sel_i2_l[0]),
1510
                                                 .sel1_l (ifc_ifd_milfill_sel_i2_l[1]),
1511
                                                 .sel2_l (ifc_ifd_milfill_sel_i2_l[2]),
1512
                                                 .sel3_l (ifc_ifd_milfill_sel_i2_l[3]));
1513
 
1514
   assign   ifd_ifc_miladdr4_i2[3:0]  = {mil_entry3[4],
1515
                                         mil_entry2[4],
1516
                                         mil_entry1[4],
1517
                                         mil_entry0[4]};
1518
 
1519
   assign   ifd_ifc_iobpkt_i2 = fill_addr_i2[39];
1520
   assign   fill_addr_adj = {fill_addr_i2[42:5],
1521
                                               ifc_ifd_filladdr4_i2,
1522
                                               fill_addr_i2[3:2]};
1523
   // determine if this is cacheable in I$
1524
   // moved to ifqctl
1525
//   assign   ifd_ifc_uncached_i2 = fill_addr_i2[43];
1526
 
1527
   // merged with addren mux to save some timing
1528
   dp_mux4ds #(41) icadr_mux(.dout (icaddr_i2),
1529
                                               .in0  (fill_addr_adj),
1530
                                               .in1  (asi_addr_i2),
1531
                                               .in2  (bist_addr_i2),
1532
                             .in3  ({wraddr_f[42:4], 2'b0}),
1533
                                               .sel0_l (ifc_ifd_addr_sel_fill_i2_l),
1534
                                               .sel1_l (ifc_ifd_addr_sel_asi_i2_l),
1535
                                               .sel2_l (ifc_ifd_addr_sel_bist_i2_l),
1536
                             .sel3_l (ifc_ifd_addr_sel_old_i2_l));
1537
 
1538
   // way, 32B line sel
1539
   assign ifd_inv_wrway_i2 =  icaddr_i2[41:40];
1540
 
1541
//   dp_mux2es  #(39)  addren_mux(.dout (wraddr_i2),
1542
//                                              .in0  (wraddr_f),
1543
//                                              .in1  (icaddr_i2[42:4]),
1544
//                                              .sel  (ifc_ifd_ifqadv_i2));
1545
 
1546
 
1547
   dff #(39) wraddr_reg(.din  (icaddr_i2[42:4]),
1548
                                    .clk  (clk),
1549
                                    .q    (wraddr_f[42:4]),
1550
                                    .se   (se), .si(), .so());
1551
 
1552
   // tag = parity bit + `IC_TAG_SZ bits of address
1553
   assign  ifq_erb_wrindex_f = wraddr_f[11:4];
1554
   assign  ifq_ict_wrtag_f = {wraddr_f[42], wraddr_f[39:(11 + 1)]};
1555
 
1556
   assign  ifq_icd_index_bf = icaddr_i2[11:2];
1557
   assign  ifq_icd_wrway_bf = icaddr_i2[41:40];
1558
 
1559
   //----------------------------------------------------------------------
1560
   // Fill Return Data
1561
   //----------------------------------------------------------------------
1562
   // IFQ-IBUF
1563
   // inq is the same size as the cpx_width
1564
   // inq is replaced with a single flop, ibuf
1565
 
1566
   // ibuf enable mux
1567
//   dp_mux2es  #(`CPX_WIDTH)  ifqen_mux(.dout (inq_cpxpkt_nxt),
1568
//                                                           .in0 (inq_cpxpkt_i1),
1569
//                                                           .in1 (lsu_ifu_cpxpkt_i1), 
1570
//                                                           .sel (ifc_ifd_ld_inq_i1));
1571
 
1572
   wire    clk_ibuf1;
1573
 
1574
 
1575
 
1576
 
1577
 
1578
 
1579
 
1580
 
1581
 
1582
   dffe #(145) ibuf(.din (lsu_ifu_cpxpkt_i1),
1583
                                          .q   (inq_cpxpkt_i1),
1584
                                          .en (~(~ifc_ifd_ld_inq_i1)), .clk(rclk),
1585
                                          .se  (se), .si(), .so());
1586
 
1587
 
1588
 
1589
 
1590
 
1591
 
1592
 
1593
   assign  ifd_ifc_cpxreq_i1 = {inq_cpxpkt_i1[144],
1594
                                                  inq_cpxpkt_i1[143:140]};
1595
 
1596
   // ifq operand bypass mux
1597
   // fill pkt is 128d+2w+2t+3iw+1v+1nc+4r = 140
1598
   dp_mux4ds  #(145)  ifq_bypmux(.dout (ifqop_i1),
1599
                                                              .in0 (fwd_data_pkt),
1600
                                                              .in1 (inq_cpxpkt_i1),
1601
                                                              .in2 (stxa_data_pkt),
1602
                                                              .in3 (lsu_ifu_cpxpkt_i1),
1603
                                                              .sel0_l (ifc_ifd_ifqbyp_sel_fwd_l),
1604
                                                              .sel1_l (ifc_ifd_ifqbyp_sel_inq_l),
1605
                                                              .sel2_l (ifc_ifd_ifqbyp_sel_asi_l),
1606
                                                              .sel3_l (ifc_ifd_ifqbyp_sel_lsu_l));
1607
 
1608
   wire    clk_ifqop;
1609
 
1610
 
1611
 
1612
 
1613
 
1614
 
1615
 
1616
 
1617
 
1618
   dffe #(145)  ifqop_reg(.din (ifqop_i1),
1619
                                                .q   (ifqop_i2),
1620
                                                .en (~(ifc_ifd_ifqbyp_en_l)), .clk(rclk),
1621
                                                .se  (se), .si(), .so());
1622
 
1623
 
1624
 
1625
 
1626
 
1627
 
1628
   assign  ifd_inv_ifqop_i2 = ifqop_i2;
1629
 
1630
   // switch condition pre decode
1631
   sparc_ifu_swpla  swpla0(.in  (ifqop_i2[31:0]),
1632
                                             .out (swc_i2[0]));
1633
   sparc_ifu_swpla  swpla1(.in  (ifqop_i2[63:32]),
1634
                                             .out (swc_i2[1]));
1635
   sparc_ifu_swpla  swpla2(.in  (ifqop_i2[95:64]),
1636
                                             .out (swc_i2[2]));
1637
   sparc_ifu_swpla  swpla3(.in  (ifqop_i2[127:96]),
1638
                                             .out (swc_i2[3]));
1639
 
1640
   // Add Parity to each inst.
1641
   sparc_ifu_par32 par0(.in  (ifqop_i2[31:0]),
1642
                                          .out (par_i2[0]));
1643
   sparc_ifu_par32 par1(.in  (ifqop_i2[63:32]),
1644
                                          .out (par_i2[1]));
1645
   sparc_ifu_par32 par2(.in  (ifqop_i2[95:64]),
1646
                                          .out (par_i2[2]));
1647
   sparc_ifu_par32 par3(.in  (ifqop_i2[127:96]),
1648
                                          .out (par_i2[3]));
1649
 
1650
   // add 8 xor gates in the dp
1651
   //   assign parity_i2 = par_i2 ^ swc_i2 ^ {4{ifc_ifd_insert_pe}};
1652
   //   assign tag_par_i2 = par_i2[0] ^ ifc_ifd_insert_pe;
1653
 
1654
   // Make the par32 cell above, par33 and include cpxue_i2
1655
   assign   parity_i2 = par_i2 ^ swc_i2 ^ {4{ifd_ifc_cpxue_i2}};
1656
   assign   tag_par_i2 = par_i2[0] ^ ifd_ifc_cpxue_i2;
1657
 
1658
   // parity, swc, inst[31:0]
1659
   assign   icdata_i2 = {parity_i2[3], ifqop_i2[127:96], swc_i2[3],
1660
                                     parity_i2[2], ifqop_i2[95:64],  swc_i2[2],
1661
                                     parity_i2[1], ifqop_i2[63:32],  swc_i2[1],
1662
                                     parity_i2[0], ifqop_i2[31:0],   swc_i2[0]};
1663
 
1664
   // write data to icache
1665
   assign ifq_icd_wrdata_i2 = icdata_i2;
1666
 
1667
 
1668
   // very critical
1669
   assign ifd_ifc_cpxreq_nxt   = ifqop_i1[143:140];
1670
   assign ifd_ifc_cpxthr_nxt   = ifqop_i1[135:134];
1671
 
1672
   assign ifd_ifc_cpxvld_i2   = ifqop_i2[144];
1673
   assign ifd_ifc_4bpkt_i2    = ifqop_i2[130];
1674
   assign ifd_ifc_cpxce_i2    = ifqop_i2[137];
1675
   assign ifd_ifc_cpxue_i2    = ifqop_i2[(137 + 1)];
1676
   assign ifd_ifc_cpxms_i2    = ifqop_i2[(137 + 2)];
1677
   assign ifd_ifc_cpxnc_i2    = ifqop_i2[136];
1678
   assign ifd_ifc_fwd2ic_i2   = ifqop_i2[103];
1679
 
1680
   // instr sel mux to write to thread inst regsiter in S stage
1681
   // instr is always BIG ENDIAN
1682
   dp_mux4ds  #(33)  fillinst_mux(.dout (ifq_fdp_fill_inst),
1683
                                                        .in0 (icdata_i2[134:102]),
1684
                                                        .in1 (icdata_i2[100:68]),
1685
                                                        .in2 (icdata_i2[66:34]),
1686
                                                        .in3 (icdata_i2[32:0]),
1687
                                                        .sel0_l (ifc_ifd_finst_sel_l[0]),
1688
                                                        .sel1_l (ifc_ifd_finst_sel_l[1]),
1689
                                                        .sel2_l (ifc_ifd_finst_sel_l[2]),
1690
                                                        .sel3_l (ifc_ifd_finst_sel_l[3]));
1691
 
1692
   // synopsys translate_off
1693
//`ifdef DEFINE_0IN
1694
//`else
1695
//   always @ (ifq_fdp_fill_inst or ifd_ifc_cpxreq_i2)
1696
//     if (((^ifq_fdp_fill_inst[32:0]) == 1'bx) && (ifd_ifc_cpxreq_i2 == `CPX_IFILLPKT))
1697
//       begin
1698
//          $display("ifqdp.v: Imiss Return val = %h\n", ifqop_i2);
1699
//          $display("IFQCPX", "Error: X's detected in Imiss Return Inst %h", 
1700
//                 ifq_fdp_fill_inst[31:0]);
1701
//       end
1702
//`endif
1703
   // synopsys translate_on
1704
 
1705
 
1706
   // TBD: 1. inv way in fill pkt -- DONE
1707
   //      2. inv packet -- DONE
1708
   //      3. DFT pkt from TAP -- NO NEED
1709
   //      4. Ld pkt to invalidate i$  -- DONE
1710
 
1711
   //----------------------------------------------------------------------
1712
   // ASI Access
1713
   //----------------------------------------------------------------------
1714
   // mux stxa pkt into the cpx
1715
   assign  stxa_data_pkt[144] = 1'b0;
1716
   // vbits and parity are muxed into the cpxreq
1717
   assign  stxa_data_pkt[143:140] = {1'b1, lsu_ifu_stxa_data[34:32]};
1718
//   assign  stxa_data_pkt[`CPX_THRFIELD] = lsu_ifu_asi_thrid[1:0];
1719
   assign  stxa_data_pkt[135:134] = 2'b0;
1720
   // use parity to insert error in icache inst or tag
1721
   assign  stxa_data_pkt[(137 + 1)] = lsu_ifu_stxa_data[32];
1722
   assign  stxa_data_pkt[127:0] = {4{lsu_ifu_stxa_data[31:0]}};
1723
 
1724
   // other bits need to be tied off
1725
   assign  stxa_data_pkt[133:128] = 6'b0;
1726
   assign  stxa_data_pkt[137:136] = 2'b0;
1727
   assign  stxa_data_pkt[139] = 1'b0;
1728
 
1729
   // format fwd data pkt in a similar way
1730
   assign  fwd_data_pkt[144:(137 + 2)] = ifqop_i2[144:(137 + 2)];
1731
   assign  fwd_data_pkt[(137 + 1)] = ifqop_i2[32];
1732
   assign  fwd_data_pkt[137:128] = ifqop_i2[137:128];
1733
   assign  fwd_data_pkt[127:0] = {4{ifqop_i2[31:0]}};
1734
 
1735
 
1736
 
1737
   dff #(16) stxa_ff(.din (lsu_ifu_stxa_data[47:32]),
1738
                                 .q   (ifq_erb_asidata_i2[47:32]),
1739
                                 .clk (clk), .se(se), .si(), .so());
1740
   assign  ifq_erb_asidata_i2[31:0] = ifqop_i2[31:0];
1741
 
1742
   // va[63:32] is truncated
1743
   // In this architecture we only need va[17:0]
1744
   // rest of the bits ar ehere only for the address range check
1745
   // 12 new muxes (10 for addr, 2 for way)
1746
   // CHANGE: this mux has been moved before the asi_addr_reg, rather
1747
   // than after.
1748
   // Use mux flop soffm2?
1749
   dp_mux2es #(12) asifwd_mx(.dout (asi_fwd_index[13:2]),
1750
                             .in0  ({lsu_ifu_asi_addr[17:16],   // asi way
1751
                                     lsu_ifu_asi_addr[12:3]}),  // asi addr
1752
                             .in1  ({ifqop_i2[81:80],    // fwd rq way
1753
                                     ifqop_i2[76:67]}),  // fwd rq addr
1754
                             .sel  (ifc_ifd_idx_sel_fwd_i2));
1755
 
1756
   assign asi_va_i1 = {asi_fwd_index[13:12],
1757
                       lsu_ifu_asi_addr[15:13],
1758
                       asi_fwd_index[11:2],
1759
                       lsu_ifu_asi_addr[2:0]};
1760
 
1761
   dff #(18) asi_addr_reg(.din (asi_va_i1[17:0]),  // 15:13 is not used
1762
                                            .q   (asi_va_i2[17:0]),
1763
                                            .clk (clk),
1764
                                            .se  (se), .si(), .so());
1765
 
1766
   // 16b zero cmp: leave out bit 3!! (imask is 0x8)
1767
   assign  ifd_ifc_asi_vachklo_i2 = (|asi_va_i2[16:4]) | (|asi_va_i2[2:0]);
1768
 
1769
   // mux in ifqop and asi_va_i2 to create new asi va?
1770
   // asi va is shifted by 1 bit to look like 64b op
1771
   assign    ifd_ifc_asiaddr_i2[3:2] = asi_va_i2[4:3];
1772
 
1773
   assign    asi_addr_i2 = {tag_par_i2,           // tag parity 42
1774
                                              asi_va_i2[17:16],     // way 41:40
1775
                                              ifqop_i2[27:0],       // tag 39:12
1776
                                              asi_va_i2[12:3]       // index 11:2
1777
                            };
1778
 
1779
   // bist has to go to icache in the same cycle
1780
   // cannot flop it
1781
   assign    bist_addr_i2 = {1'b0,                    // par
1782
                                               mbist_icache_way[1:0],   // way 41:40
1783
                                               28'b0,                   // tag 39:12
1784
                                               mbist_icache_index[7:0], // index 11:4
1785
                             mbist_icache_word,       // 3
1786
                                               1'b0
1787
                                               };
1788
 
1789
   // floating signals
1790
   sink #(2) s0(.in (imiss_paddr_s[1:0]));
1791
   sink s1(.in (pcxreq_e[42]));
1792
   sink s2(.in (fill_addr_i2[4]));
1793
 
1794
 
1795
endmodule // sparc_ifu_ifqdp
1796
 
1797
 
1798
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.