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

Subversion Repositories s1_core

[/] [s1_core/] [trunk/] [hdl/] [rtl/] [sparc_core/] [lsu_qctl2.v] - Blame information for rev 105

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: lsu_qctl2.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
//  Description:  LSU Queue Control for Sparc Core
24
//      - includes monitoring for pcx queues
25
//      - control for lsu datapath
26
//      - rd/wr control of dfq
27
//
28
*/
29
////////////////////////////////////////////////////////////////////////
30
// header file includes
31
////////////////////////////////////////////////////////////////////////
32
// system level definition file which contains the /*
33
/* ========== Copyright Header Begin ==========================================
34
*
35
* OpenSPARC T1 Processor File: sys.h
36
* Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
37
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
38
*
39
* The above named program is free software; you can redistribute it and/or
40
* modify it under the terms of the GNU General Public
41
* License version 2 as published by the Free Software Foundation.
42
*
43
* The above named program is distributed in the hope that it will be
44
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
45
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
46
* General Public License for more details.
47
*
48
* You should have received a copy of the GNU General Public
49
* License along with this work; if not, write to the Free Software
50
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
51
*
52
* ========== Copyright Header End ============================================
53
*/
54
// -*- verilog -*-
55
////////////////////////////////////////////////////////////////////////
56
/*
57
//
58
// Description:         Global header file that contain definitions that
59
//                      are common/shared at the systme level
60
*/
61
////////////////////////////////////////////////////////////////////////
62
//
63
// Setting the time scale
64
// If the timescale changes, JP_TIMESCALE may also have to change.
65
`timescale      1ps/1ps
66
 
67
//
68
// JBUS clock
69
// =========
70
//
71
 
72
 
73
 
74
// Afara Link Defines
75
// ==================
76
 
77
// Reliable Link
78
 
79
 
80
 
81
 
82
// Afara Link Objects
83
 
84
 
85
// Afara Link Object Format - Reliable Link
86
 
87
 
88
 
89
 
90
 
91
 
92
 
93
 
94
 
95
 
96
// Afara Link Object Format - Congestion
97
 
98
 
99
 
100
 
101
 
102
 
103
 
104
 
105
 
106
 
107
 
108
// Afara Link Object Format - Acknowledge
109
 
110
 
111
 
112
 
113
 
114
 
115
 
116
 
117
 
118
 
119
 
120
// Afara Link Object Format - Request
121
 
122
 
123
 
124
 
125
 
126
 
127
 
128
 
129
 
130
 
131
 
132
 
133
 
134
 
135
 
136
 
137
 
138
// Afara Link Object Format - Message
139
 
140
 
141
 
142
// Acknowledge Types
143
 
144
 
145
 
146
 
147
// Request Types
148
 
149
 
150
 
151
 
152
 
153
// Afara Link Frame
154
 
155
 
156
 
157
//
158
// UCB Packet Type
159
// ===============
160
//
161
 
162
 
163
 
164
 
165
 
166
 
167
 
168
 
169
 
170
 
171
 
172
 
173
 
174
 
175
 
176
 
177
 
178
//
179
// UCB Data Packet Format
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
// Size encoding for the UCB_SIZE_HI/LO field
213
// 000 - byte
214
// 001 - half-word
215
// 010 - word
216
// 011 - double-word
217
// 111 - quad-word
218
 
219
 
220
 
221
 
222
 
223
 
224
 
225
//
226
// UCB Interrupt Packet Format
227
// ===========================
228
//
229
 
230
 
231
 
232
 
233
 
234
 
235
 
236
 
237
 
238
 
239
//`define UCB_THR_HI             9      // (6) cpu/thread ID shared with
240
//`define UCB_THR_LO             4             data packet format
241
//`define UCB_PKT_HI             3      // (4) packet type shared with
242
//`define UCB_PKT_LO             0      //     data packet format
243
 
244
 
245
 
246
 
247
 
248
 
249
 
250
//
251
// FCRAM Bus Widths
252
// ================
253
//
254
 
255
 
256
 
257
 
258
 
259
 
260
//
261
// ENET clock periods
262
// ==================
263
//
264
 
265
 
266
 
267
 
268
//
269
// JBus Bridge defines
270
// =================
271
//
272
 
273
 
274
 
275
 
276
 
277
 
278
 
279
 
280
 
281
 
282
 
283
//
284
// PCI Device Address Configuration
285
// ================================
286
//
287
 
288
 
289
 
290
 
291
 
292
 
293
 
294
 
295
 
296
 
297
 
298
 
299
 
300
 
301
 
302
 
303
 
304
 
305
 
306
 
307
 
308
 
309
 
310
                  // time scale definition
311
/*
312
/* ========== Copyright Header Begin ==========================================
313
*
314
* OpenSPARC T1 Processor File: iop.h
315
* Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
316
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
317
*
318
* The above named program is free software; you can redistribute it and/or
319
* modify it under the terms of the GNU General Public
320
* License version 2 as published by the Free Software Foundation.
321
*
322
* The above named program is distributed in the hope that it will be
323
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
324
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
325
* General Public License for more details.
326
*
327
* You should have received a copy of the GNU General Public
328
* License along with this work; if not, write to the Free Software
329
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
330
*
331
* ========== Copyright Header End ============================================
332
*/
333
//-*- verilog -*-
334
////////////////////////////////////////////////////////////////////////
335
/*
336
//
337
//  Description:        Global header file that contain definitions that
338
//                      are common/shared at the IOP chip level
339
*/
340
////////////////////////////////////////////////////////////////////////
341
 
342
 
343
// Address Map Defines
344
// ===================
345
 
346
 
347
 
348
 
349
// CMP space
350
 
351
 
352
 
353
// IOP space
354
 
355
 
356
 
357
 
358
                               //`define ENET_ING_CSR     8'h84
359
                               //`define ENET_EGR_CMD_CSR 8'h85
360
 
361
 
362
 
363
 
364
 
365
 
366
 
367
 
368
 
369
 
370
 
371
 
372
 
373
 
374
 
375
// L2 space
376
 
377
 
378
 
379
// More IOP space
380
 
381
 
382
 
383
 
384
 
385
//Cache Crossbar Width and Field Defines
386
//======================================
387
 
388
 
389
 
390
 
391
 
392
 
393
 
394
 
395
 
396
 
397
 
398
 
399
 
400
 
401
 
402
 
403
 
404
 
405
 
406
 
407
 
408
 
409
 
410
 
411
 
412
 
413
 
414
 
415
 
416
 
417
 
418
 
419
 
420
 
421
 
422
 
423
 
424
 
425
 
426
 
427
 
428
 
429
 
430
 
431
 
432
//bits 133:128 are shared by different fields
433
//for different packet types.
434
 
435
 
436
 
437
 
438
 
439
 
440
 
441
 
442
 
443
 
444
 
445
 
446
 
447
 
448
 
449
 
450
 
451
 
452
 
453
 
454
 
455
 
456
 
457
 
458
 
459
 
460
 
461
 
462
 
463
 
464
 
465
 
466
 
467
 
468
 
469
 
470
 
471
 
472
 
473
 
474
 
475
 
476
 
477
 
478
 
479
 
480
 
481
 
482
 
483
 
484
 
485
 
486
 
487
 
488
 
489
 
490
 
491
 
492
 
493
 
494
 
495
 
496
//End cache crossbar defines
497
 
498
 
499
// Number of COS supported by EECU 
500
 
501
 
502
 
503
// 
504
// BSC bus sizes
505
// =============
506
//
507
 
508
// General
509
 
510
 
511
 
512
 
513
// CTags
514
 
515
 
516
 
517
 
518
 
519
 
520
 
521
 
522
 
523
 
524
 
525
 
526
 
527
// reinstated temporarily
528
 
529
 
530
 
531
 
532
// CoS
533
 
534
 
535
 
536
 
537
 
538
 
539
// L2$ Bank
540
 
541
 
542
 
543
// L2$ Req
544
 
545
 
546
 
547
 
548
 
549
 
550
 
551
 
552
 
553
 
554
 
555
 
556
 
557
// L2$ Ack
558
 
559
 
560
 
561
 
562
 
563
 
564
 
565
 
566
// Enet Egress Command Unit
567
 
568
 
569
 
570
 
571
 
572
 
573
 
574
 
575
 
576
 
577
 
578
 
579
 
580
 
581
// Enet Egress Packet Unit
582
 
583
 
584
 
585
 
586
 
587
 
588
 
589
 
590
 
591
 
592
 
593
 
594
 
595
// This is cleaved in between Egress Datapath Ack's
596
 
597
 
598
 
599
 
600
 
601
 
602
 
603
 
604
// Enet Egress Datapath
605
 
606
 
607
 
608
 
609
 
610
 
611
 
612
 
613
 
614
 
615
 
616
 
617
 
618
 
619
 
620
 
621
// In-Order / Ordered Queue: EEPU
622
// Tag is: TLEN, SOF, EOF, QID = 15
623
 
624
 
625
 
626
 
627
 
628
 
629
// Nack + Tag Info + CTag
630
 
631
 
632
 
633
 
634
// ENET Ingress Queue Management Req
635
 
636
 
637
 
638
 
639
 
640
 
641
 
642
 
643
 
644
 
645
 
646
 
647
// ENET Ingress Queue Management Ack
648
 
649
 
650
 
651
 
652
 
653
 
654
 
655
 
656
// Enet Ingress Packet Unit
657
 
658
 
659
 
660
 
661
 
662
 
663
 
664
 
665
 
666
 
667
 
668
 
669
// ENET Ingress Packet Unit Ack
670
 
671
 
672
 
673
 
674
 
675
 
676
 
677
// In-Order / Ordered Queue: PCI
678
// Tag is: CTAG
679
 
680
 
681
 
682
 
683
 
684
// PCI-X Request
685
 
686
 
687
 
688
 
689
 
690
 
691
 
692
 
693
 
694
 
695
 
696
// PCI_X Acknowledge
697
 
698
 
699
 
700
 
701
 
702
 
703
 
704
 
705
 
706
 
707
 
708
//
709
// BSC array sizes
710
//================
711
//
712
 
713
 
714
 
715
 
716
 
717
 
718
 
719
 
720
 
721
 
722
 
723
 
724
// ECC syndrome bits per memory element
725
 
726
 
727
 
728
 
729
//
730
// BSC Port Definitions
731
// ====================
732
//
733
// Bits 7 to 4 of curr_port_id
734
 
735
 
736
 
737
 
738
 
739
 
740
 
741
 
742
// Number of ports of each type
743
 
744
 
745
// Bits needed to represent above
746
 
747
 
748
// How wide the linked list pointers are
749
// 60b for no payload (2CoS)
750
// 80b for payload (2CoS)
751
 
752
//`define BSC_OBJ_PTR   80
753
//`define BSC_HD1_HI    69
754
//`define BSC_HD1_LO    60
755
//`define BSC_TL1_HI    59
756
//`define BSC_TL1_LO    50
757
//`define BSC_CT1_HI    49
758
//`define BSC_CT1_LO    40
759
//`define BSC_HD0_HI    29
760
//`define BSC_HD0_LO    20
761
//`define BSC_TL0_HI    19
762
//`define BSC_TL0_LO    10
763
//`define BSC_CT0_HI     9
764
//`define BSC_CT0_LO     0
765
 
766
 
767
 
768
 
769
 
770
 
771
 
772
 
773
 
774
 
775
 
776
 
777
 
778
 
779
 
780
 
781
 
782
 
783
 
784
 
785
 
786
 
787
 
788
 
789
 
790
 
791
 
792
 
793
 
794
 
795
 
796
 
797
 
798
 
799
// I2C STATES in DRAMctl
800
 
801
 
802
 
803
 
804
 
805
 
806
 
807
//
808
// IOB defines
809
// ===========
810
//
811
 
812
 
813
 
814
 
815
 
816
 
817
 
818
 
819
 
820
 
821
 
822
 
823
 
824
 
825
 
826
 
827
 
828
 
829
 
830
//`define IOB_INT_STAT_WIDTH   32
831
//`define IOB_INT_STAT_HI      31
832
//`define IOB_INT_STAT_LO       0
833
 
834
 
835
 
836
 
837
 
838
 
839
 
840
 
841
 
842
 
843
 
844
 
845
 
846
 
847
 
848
 
849
 
850
 
851
 
852
 
853
 
854
 
855
 
856
 
857
 
858
 
859
 
860
 
861
 
862
 
863
 
864
 
865
 
866
 
867
 
868
 
869
 
870
 
871
 
872
 
873
 
874
 
875
 
876
 
877
 
878
 
879
 
880
 
881
 
882
// fixme - double check address mapping
883
// CREG in `IOB_INT_CSR space
884
 
885
 
886
 
887
 
888
 
889
 
890
 
891
 
892
 
893
 
894
// CREG in `IOB_MAN_CSR space
895
 
896
 
897
 
898
 
899
 
900
 
901
 
902
 
903
 
904
 
905
 
906
 
907
 
908
 
909
 
910
 
911
 
912
 
913
 
914
 
915
 
916
 
917
 
918
 
919
 
920
 
921
 
922
 
923
 
924
 
925
 
926
 
927
 
928
 
929
 
930
 
931
 
932
// Address map for TAP access of SPARC ASI
933
 
934
 
935
 
936
 
937
 
938
 
939
 
940
 
941
 
942
 
943
 
944
 
945
 
946
//
947
// CIOP UCB Bus Width
948
// ==================
949
//
950
//`define IOB_EECU_WIDTH       16  // ethernet egress command
951
//`define EECU_IOB_WIDTH       16
952
 
953
//`define IOB_NRAM_WIDTH       16  // NRAM (RLDRAM previously)
954
//`define NRAM_IOB_WIDTH        4
955
 
956
 
957
 
958
 
959
//`define IOB_ENET_ING_WIDTH   32  // ethernet ingress
960
//`define ENET_ING_IOB_WIDTH    8
961
 
962
//`define IOB_ENET_EGR_WIDTH    4  // ethernet egress
963
//`define ENET_EGR_IOB_WIDTH    4
964
 
965
//`define IOB_ENET_MAC_WIDTH    4  // ethernet MAC
966
//`define ENET_MAC_IOB_WIDTH    4
967
 
968
 
969
 
970
 
971
//`define IOB_BSC_WIDTH         4  // BSC
972
//`define BSC_IOB_WIDTH         4
973
 
974
 
975
 
976
 
977
 
978
 
979
 
980
//`define IOB_CLSP_WIDTH        4  // clk spine unit
981
//`define CLSP_IOB_WIDTH        4
982
 
983
 
984
 
985
 
986
 
987
//
988
// CIOP UCB Buf ID Type
989
// ====================
990
//
991
 
992
 
993
 
994
//
995
// Interrupt Device ID
996
// ===================
997
//
998
// Caution: DUMMY_DEV_ID has to be 9 bit wide
999
//          for fields to line up properly in the IOB.
1000
 
1001
 
1002
 
1003
//
1004
// Soft Error related definitions 
1005
// ==============================
1006
//
1007
 
1008
 
1009
 
1010
//
1011
// CMP clock
1012
// =========
1013
//
1014
 
1015
 
1016
 
1017
 
1018
//
1019
// NRAM/IO Interface
1020
// =================
1021
//
1022
 
1023
 
1024
 
1025
 
1026
 
1027
 
1028
 
1029
 
1030
 
1031
 
1032
//
1033
// NRAM/ENET Interface
1034
// ===================
1035
//
1036
 
1037
 
1038
 
1039
 
1040
 
1041
 
1042
 
1043
//
1044
// IO/FCRAM Interface
1045
// ==================
1046
//
1047
 
1048
 
1049
 
1050
 
1051
 
1052
 
1053
//
1054
// PCI Interface
1055
// ==================
1056
// Load/store size encodings
1057
// -------------------------
1058
// Size encoding
1059
// 000 - byte
1060
// 001 - half-word
1061
// 010 - word
1062
// 011 - double-word
1063
// 100 - quad
1064
 
1065
 
1066
 
1067
 
1068
 
1069
 
1070
//
1071
// JBI<->SCTAG Interface
1072
// =======================
1073
// Outbound Header Format
1074
 
1075
 
1076
 
1077
 
1078
 
1079
 
1080
 
1081
 
1082
 
1083
 
1084
 
1085
 
1086
 
1087
 
1088
 
1089
 
1090
 
1091
 
1092
 
1093
 
1094
 
1095
 
1096
 
1097
 
1098
 
1099
 
1100
 
1101
// Inbound Header Format
1102
 
1103
 
1104
 
1105
 
1106
 
1107
 
1108
 
1109
 
1110
 
1111
 
1112
 
1113
 
1114
 
1115
 
1116
 
1117
 
1118
 
1119
 
1120
 
1121
 
1122
//
1123
// JBI->IOB Mondo Header Format
1124
// ============================
1125
//
1126
 
1127
 
1128
 
1129
 
1130
 
1131
 
1132
 
1133
 
1134
 
1135
 
1136
 
1137
 
1138
 
1139
 
1140
// JBI->IOB Mondo Bus Width/Cycle
1141
// ==============================
1142
// Cycle  1 Header[15:8]
1143
// Cycle  2 Header[ 7:0]
1144
// Cycle  3 J_AD[127:120]
1145
// Cycle  4 J_AD[119:112]
1146
// .....
1147
// Cycle 18 J_AD[  7:  0]
1148
 
1149
 
1150
 
1151
/*
1152
/* ========== Copyright Header Begin ==========================================
1153
*
1154
* OpenSPARC T1 Processor File: lsu.h
1155
* Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
1156
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
1157
*
1158
* The above named program is free software; you can redistribute it and/or
1159
* modify it under the terms of the GNU General Public
1160
* License version 2 as published by the Free Software Foundation.
1161
*
1162
* The above named program is distributed in the hope that it will be
1163
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
1164
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1165
* General Public License for more details.
1166
*
1167
* You should have received a copy of the GNU General Public
1168
* License along with this work; if not, write to the Free Software
1169
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
1170
*
1171
* ========== Copyright Header End ============================================
1172
*/
1173
 
1174
 
1175
 
1176
 
1177
 
1178
 
1179
 
1180
 
1181
//`define STB_PCX_WY_HI   107
1182
//`define STB_PCX_WY_LO   106
1183
 
1184
 
1185
 
1186
 
1187
 
1188
 
1189
 
1190
 
1191
 
1192
 
1193
 
1194
 
1195
 
1196
 
1197
 
1198
 
1199
 
1200
 
1201
 
1202
 
1203
 
1204
 
1205
 
1206
 
1207
 
1208
 
1209
 
1210
 
1211
 
1212
 
1213
 
1214
 
1215
 
1216
 
1217
 
1218
 
1219
 
1220
 
1221
 
1222
 
1223
 
1224
 
1225
 
1226
 
1227
 
1228
 
1229
 
1230
 
1231
 
1232
 
1233
 
1234
 
1235
 
1236
 
1237
 
1238
 
1239
 
1240
 
1241
 
1242
 
1243
 
1244
 
1245
 
1246
 
1247
 
1248
 
1249
 
1250
 
1251
 
1252
 
1253
 
1254
 
1255
 
1256
 
1257
 
1258
 
1259
 
1260
 
1261
 
1262
 
1263
 
1264
 
1265
 
1266
// TLB Tag and Data Format
1267
 
1268
 
1269
 
1270
 
1271
 
1272
 
1273
 
1274
 
1275
 
1276
 
1277
 
1278
 
1279
 
1280
 
1281
 
1282
 
1283
 
1284
 
1285
 
1286
 
1287
 
1288
 
1289
 
1290
 
1291
 
1292
 
1293
 
1294
 
1295
 
1296
 
1297
 
1298
 
1299
 
1300
 
1301
 
1302
 
1303
 
1304
 
1305
 
1306
 
1307
 
1308
 
1309
 
1310
 
1311
 
1312
 
1313
 
1314
 
1315
 
1316
 
1317
 
1318
 
1319
 
1320
 
1321
 
1322
 
1323
 
1324
 
1325
 
1326
 
1327
 
1328
// I-TLB version - lsu_tlb only.
1329
 
1330
 
1331
 
1332
 
1333
 
1334
 
1335
 
1336
 
1337
 
1338
 
1339
 
1340
 
1341
 
1342
 
1343
 
1344
 
1345
 
1346
 
1347
 
1348
 
1349
 
1350
 
1351
 
1352
 
1353
// Invalidate Format
1354
//addr<5:4>=00
1355
 
1356
 
1357
 
1358
 
1359
 
1360
 
1361
 
1362
 
1363
 
1364
 
1365
 
1366
 
1367
 
1368
 
1369
 
1370
 
1371
 
1372
//addr<5:4>=01
1373
 
1374
 
1375
 
1376
 
1377
 
1378
 
1379
 
1380
 
1381
 
1382
 
1383
 
1384
 
1385
 
1386
 
1387
 
1388
 
1389
 
1390
//addr<5:4>=10
1391
 
1392
 
1393
 
1394
 
1395
 
1396
 
1397
 
1398
 
1399
 
1400
 
1401
 
1402
 
1403
 
1404
 
1405
 
1406
 
1407
 
1408
//addr<5:4>=11
1409
 
1410
 
1411
 
1412
 
1413
 
1414
 
1415
 
1416
 
1417
 
1418
 
1419
 
1420
 
1421
 
1422
 
1423
 
1424
 
1425
 
1426
// cpuid - 4b
1427
 
1428
 
1429
 
1430
// CPUany, addr<5:4>=00,10
1431
 
1432
 
1433
 
1434
 
1435
 
1436
// CPUany, addr<5:4>=01,11
1437
 
1438
 
1439
 
1440
 
1441
// CPUany, addr<5:4>=01,11
1442
 
1443
 
1444
 
1445
 
1446
// DTAG parity error Invalidate
1447
 
1448
 
1449
 
1450
 
1451
// CPX BINIT STORE
1452
 
1453
 
1454
////////////////////////////////////////////////////////////////////////
1455
// Local header file includes / local defines
1456
////////////////////////////////////////////////////////////////////////
1457
 
1458
module lsu_qctl2 ( /*AUTOARG*/
1459
   // Outputs
1460
   so, lsu_fwd_rply_sz1_unc, lsu_dcache_iob_rd_w, ldd_in_dfq_out,
1461
   lsu_dfq_rd_vld_d1, dfq_byp_ff_en, lsu_dfill_data_sel_hi,
1462
   lsu_ifill_pkt_vld, cpx_fwd_pkt_en_cx, lsu_cpxpkt_type_dcd_cx,
1463
   lsu_cpu_dcd_sel, lsu_cpu_uhlf_sel, lsu_iobrdge_rply_data_sel,
1464
   lsu_iobrdge_fwd_pkt_vld, lsu_tlu_cpx_vld, lsu_tlu_cpx_req,
1465
   lsu_tlu_intpkt, ld_sec_active, dfq_byp_sel,
1466
   lsu_cpx_ld_dtag_perror_e, lsu_cpx_ld_dcache_perror_e,
1467
   lsu_exu_rd_m, lsu_spu_strm_ack_cmplt, lsu_atm_st_cmplt_e,
1468
   dva_svld_e, dfq_wptr_vld, dfq_wptr, lsu_dfq_flsh_cmplt,
1469
   dfq_rptr_vld, dfq_rptr, lsu_ifu_stallreq, dva_snp_addr_e,
1470
   lsu_st_ack_dq_stb, lsu_cpx_rmo_st_ack, lsu_st_wr_dcache,
1471
   cpx_st_ack_tid0, cpx_st_ack_tid1, cpx_st_ack_tid2,
1472
   cpx_st_ack_tid3, lsu_tlu_l2_dmiss, lsu_l2fill_vld,
1473
   lsu_byp_ldd_oddrd_m, lsu_pcx_fwd_reply, lsu_fwdpkt_vld,
1474
   lsu_dcfill_active_e, lsu_dfq_ld_vld, lsu_fldd_vld_en,
1475
   lsu_dfill_dcd_thrd, lsu_fwdpkt_dest, dva_snp_bit_wr_en_e,
1476
   lsu_cpx_spc_inv_vld, lsu_cpx_thrdid, lsu_cpx_stack_dcfill_vld,
1477
   lsu_dfq_vld_entry_w, lsu_cpx_stack_icfill_vld, lsu_dfq_st_vld,
1478
   lsu_dfq_ldst_vld, lsu_qdp2_dfq_ld_vld, lsu_qdp2_dfq_st_vld,
1479
   lsu_cpx_stack_dcfill_vld_b130, lsu_dfq_vld, lsu_dfq_byp_ff_en,
1480
   // Inputs
1481
   rclk, grst_l, arst_l, si, se, rst_tri_en, ld_inst_vld_e,
1482
   ifu_pcx_pkt_b51, ifu_pcx_pkt_b41t40, ifu_pcx_pkt_b10t5,
1483
   lsu_dfq_rdata_flush_bit, lsu_dfq_rdata_b17_b0,
1484
   cpx_spc_data_cx_b144to140, cpx_spc_data_cx_b138,
1485
   cpx_spc_data_cx_b135to134,
1486
   cpx_spc_data_cx_b133, cpx_spc_data_cx_b130, cpx_spc_data_cx_b129,
1487
   cpx_spc_data_cx_b128, cpx_spc_data_cx_b125,
1488
   cpx_spc_data_cx_b124to123, cpx_spc_data_cx_b120to118,
1489
   cpx_spc_data_cx_b71to70, cpx_spc_data_cx_b0, cpx_spc_data_cx_b4,
1490
   cpx_spc_data_cx_b8, cpx_spc_data_cx_b12, cpx_spc_data_cx_b16,
1491
   cpx_spc_data_cx_b20, cpx_spc_data_cx_b24, cpx_spc_data_cx_b28,
1492
   cpx_spc_data_cx_b32, cpx_spc_data_cx_b35, cpx_spc_data_cx_b38,
1493
   cpx_spc_data_cx_b41, cpx_spc_data_cx_b44, cpx_spc_data_cx_b47,
1494
   cpx_spc_data_cx_b50, cpx_spc_data_cx_b53, cpx_spc_data_cx_b56,
1495
   cpx_spc_data_cx_b60, cpx_spc_data_cx_b64, cpx_spc_data_cx_b68,
1496
   cpx_spc_data_cx_b72, cpx_spc_data_cx_b76, cpx_spc_data_cx_b80,
1497
   cpx_spc_data_cx_b84, cpx_spc_data_cx_b88, cpx_spc_data_cx_b91,
1498
   cpx_spc_data_cx_b94, cpx_spc_data_cx_b97, cpx_spc_data_cx_b100,
1499
   cpx_spc_data_cx_b103, cpx_spc_data_cx_b106, cpx_spc_data_cx_b109,
1500
   cpx_spc_data_cx_b1, cpx_spc_data_cx_b5, cpx_spc_data_cx_b9,
1501
   cpx_spc_data_cx_b13, cpx_spc_data_cx_b17, cpx_spc_data_cx_b21,
1502
   cpx_spc_data_cx_b25, cpx_spc_data_cx_b29, cpx_spc_data_cx_b57,
1503
   cpx_spc_data_cx_b61, cpx_spc_data_cx_b65, cpx_spc_data_cx_b69,
1504
   cpx_spc_data_cx_b73, cpx_spc_data_cx_b77, cpx_spc_data_cx_b81,
1505
   cpx_spc_data_cx_b85, ifu_lsu_rd_e, lmq_ld_rd1, lmq_ldd_vld,
1506
   dfq_tid, const_cpuid, lmq_ld_addr_b3, ifu_lsu_ibuf_busy,
1507
   ifu_lsu_inv_clear, lsu_byp_misc_sz_e, lsu_dfq_byp_tid,
1508
   lsu_cpx_pkt_atm_st_cmplt, lsu_cpx_pkt_l2miss, lsu_cpx_pkt_tid,
1509
   lsu_cpx_pkt_invwy, lsu_dfq_byp_flush, lsu_dfq_byp_type,
1510
   lsu_dfq_byp_invwy_vld, lsu_cpu_inv_data_b13to9,
1511
   lsu_cpu_inv_data_b7to2, lsu_cpu_inv_data_b0, lsu_cpx_pkt_inv_pa,
1512
   lsu_cpx_pkt_ifill_type, lsu_cpx_pkt_atomic, lsu_cpx_pkt_binit_st,
1513
   lsu_cpx_pkt_prefetch, lsu_dfq_byp_binit_st, lsu_tlbop_force_swo,
1514
   lsu_iobrdge_tap_rq_type, lsu_dcache_tag_perror_g,
1515
   lsu_dcache_data_perror_g, lsu_cpx_pkt_perror_iinv,
1516
   lsu_cpx_pkt_perror_dinv, lsu_cpx_pkt_perror_set,
1517
   lsu_l2fill_fpld_e, lsu_cpx_pkt_strm_ack, ifu_lsu_memref_d,
1518
   lsu_fwdpkt_pcx_rq_sel, lsu_imiss_pcx_rq_sel_d1,
1519
   lsu_dfq_byp_cpx_inv, lsu_dfq_byp_stack_adr_b54,
1520
   lsu_dfq_byp_stack_wrway, lsu_dfq_rdata_st_ack_type,
1521
   lsu_dfq_rdata_stack_dcfill_vld, lsu_dfq_rdata_stack_iinv_vld,
1522
   lsu_dfq_rdata_cpuid, lsu_dfq_byp_atm, lsu_ld_inst_vld_g,
1523
   lsu_dfq_rdata_type, lsu_dfq_rdata_invwy_vld, ifu_lsu_fwd_data_vld,
1524
   ifu_lsu_fwd_wr_ack, lsu_dfq_rdata_rq_type, lsu_dfq_rdata_b103,
1525
   sehold
1526
   ) ;
1527
 
1528
 
1529
input     rclk ;
1530
input     grst_l;
1531
input     arst_l;
1532
input     si;
1533
input     se;
1534
input     rst_tri_en;
1535
output    so;
1536
 
1537
input                   ld_inst_vld_e;        // valid ld inst; d-stage
1538
input                   ifu_pcx_pkt_b51;        // pcx pkt from ifu on imiss
1539
input [1:0]             ifu_pcx_pkt_b41t40;     // pcx pkt from ifu on imiss
1540
input [5:0]             ifu_pcx_pkt_b10t5;      // pcx pkt from ifu on imiss
1541
//input                   cpx_spc_data_rdy_cx ;   // data ready to processor
1542
//input [`CPX_WIDTH-1:71] cpx_spc_data_cx ;       // cpx to processor packet
1543
//input [`CPX_WIDTH-1:0] cpx_spc_data_cx ;       // cpx to processor packet
1544
//input [17:0]            cpx_spc_data_b17t0_cx ; // cpx to processor packet
1545
   input                lsu_dfq_rdata_flush_bit;
1546
   input [17:0]         lsu_dfq_rdata_b17_b0;
1547
 
1548
input [145-1:140] cpx_spc_data_cx_b144to140 ;       // vld, req type
1549
input                   cpx_spc_data_cx_b138 ;
1550
//input                   cpx_spc_data_cx_b136 ;  
1551
input [135:134] cpx_spc_data_cx_b135to134 ;  // thread id
1552
input                   cpx_spc_data_cx_b133 ;
1553
input                   cpx_spc_data_cx_b130 ;
1554
input                   cpx_spc_data_cx_b129 ;
1555
input                   cpx_spc_data_cx_b128 ;
1556
input                   cpx_spc_data_cx_b125 ;
1557
input [123+1:123] cpx_spc_data_cx_b124to123 ;  // inv packet iinv,dinv
1558
input [120:118] cpx_spc_data_cx_b120to118 ;  // inv packet cpu id
1559
input [1:0]             cpx_spc_data_cx_b71to70 ;
1560
 
1561
input        cpx_spc_data_cx_b0 ;
1562
input        cpx_spc_data_cx_b4 ;
1563
input        cpx_spc_data_cx_b8 ;
1564
input        cpx_spc_data_cx_b12 ;
1565
input        cpx_spc_data_cx_b16 ;
1566
input        cpx_spc_data_cx_b20 ;
1567
input        cpx_spc_data_cx_b24 ;
1568
input        cpx_spc_data_cx_b28 ;
1569
 
1570
input        cpx_spc_data_cx_b32 ;
1571
input        cpx_spc_data_cx_b35 ;
1572
input        cpx_spc_data_cx_b38 ;
1573
input        cpx_spc_data_cx_b41 ;
1574
input        cpx_spc_data_cx_b44 ;
1575
input        cpx_spc_data_cx_b47 ;
1576
input        cpx_spc_data_cx_b50 ;
1577
input        cpx_spc_data_cx_b53 ;
1578
 
1579
input        cpx_spc_data_cx_b56 ;
1580
input        cpx_spc_data_cx_b60 ;
1581
input        cpx_spc_data_cx_b64 ;
1582
input        cpx_spc_data_cx_b68 ;
1583
input        cpx_spc_data_cx_b72 ;
1584
input        cpx_spc_data_cx_b76 ;
1585
input        cpx_spc_data_cx_b80 ;
1586
input        cpx_spc_data_cx_b84 ;
1587
 
1588
input        cpx_spc_data_cx_b88 ;
1589
input        cpx_spc_data_cx_b91 ;
1590
input        cpx_spc_data_cx_b94 ;
1591
input        cpx_spc_data_cx_b97 ;
1592
input        cpx_spc_data_cx_b100 ;
1593
input        cpx_spc_data_cx_b103 ;
1594
input        cpx_spc_data_cx_b106 ;
1595
input        cpx_spc_data_cx_b109 ;
1596
 
1597
input        cpx_spc_data_cx_b1 ;
1598
input        cpx_spc_data_cx_b5 ;
1599
input        cpx_spc_data_cx_b9 ;
1600
input        cpx_spc_data_cx_b13 ;
1601
input        cpx_spc_data_cx_b17 ;
1602
input        cpx_spc_data_cx_b21 ;
1603
input        cpx_spc_data_cx_b25 ;
1604
input        cpx_spc_data_cx_b29 ;
1605
 
1606
input        cpx_spc_data_cx_b57 ;
1607
input        cpx_spc_data_cx_b61 ;
1608
input        cpx_spc_data_cx_b65 ;
1609
input        cpx_spc_data_cx_b69 ;
1610
input        cpx_spc_data_cx_b73 ;
1611
input        cpx_spc_data_cx_b77 ;
1612
input        cpx_spc_data_cx_b81 ;
1613
input        cpx_spc_data_cx_b85 ;
1614
 
1615
input [4:0]             ifu_lsu_rd_e ;          // rd for current load request.
1616
//input                   lsu_ld_miss_g ;         // load misses in dcache.
1617
input  [4:0]            lmq_ld_rd1 ;            // rd for all loads
1618
input                   lmq_ldd_vld ;           // ld double   
1619
//input                   ld_stb_full_raw_g ;    // full raw for load - thread0
1620
//input                   ld_stb_partial_raw_g ; // partial raw for load - thread0
1621
/*
1622
input                   ld_sec_hit_thrd0 ;      // ld has sec. hit against th0
1623
input                   ld_sec_hit_thrd1 ;      // ld has sec. hit against th1
1624
input                   ld_sec_hit_thrd2 ;      // ld has sec. hit against th2
1625
input                   ld_sec_hit_thrd3 ;      // ld has sec. hit against th3
1626
*/
1627
input   [1:0]           dfq_tid ;               // thread-id for load at head of DFQ. 
1628
//input   [1:0]           dfq_byp_tid ;           // in-flight thread-id for load at head of DFQ. 
1629
//input                   ldxa_internal ;         // internal ldxa, stg g 
1630
//input [3:0]             ld_thrd_byp_sel ;       // stb,ldxa thread byp sel
1631
input [2:0]             const_cpuid ;           // cpu id
1632
input                   lmq_ld_addr_b3 ;        // bit3 of addr at head of queue.
1633
//input                   ifu_tlu_inst_vld_m ;    // inst is vld - wstage
1634
//input                   tlu_ifu_flush_pipe_w ;  // flush event in wstage
1635
//input                   lsu_ldstub_g ;          // ldstub(a) instruction
1636
//input                   lsu_swap_g ;            // swap(a) instruction 
1637
//input                   tlu_lsu_pcxpkt_vld ;
1638
//input [11:10]           tlu_lsu_pcxpkt_l2baddr ;
1639
//input [19:18]           tlu_lsu_pcxpkt_tid ;
1640
input                   ifu_lsu_ibuf_busy ;
1641
input                   ifu_lsu_inv_clear ;
1642
input   [1:0]           lsu_byp_misc_sz_e ;     // size for ldxa/raw etc
1643
input   [1:0]           lsu_dfq_byp_tid ;
1644
input                   lsu_cpx_pkt_atm_st_cmplt ;
1645
input                   lsu_cpx_pkt_l2miss ;
1646
input   [1:0]           lsu_cpx_pkt_tid ;
1647
input   [1:0]           lsu_cpx_pkt_invwy ;     // invalidate way
1648
input                   lsu_dfq_byp_flush ;
1649
input   [5:0]           lsu_dfq_byp_type ;
1650
input                   lsu_dfq_byp_invwy_vld ;
1651
//input   [13:0]          lsu_cpu_inv_data ;
1652
input   [13:9]          lsu_cpu_inv_data_b13to9 ;
1653
input   [7:2]           lsu_cpu_inv_data_b7to2 ;
1654
input                   lsu_cpu_inv_data_b0 ;
1655
//input   [2:0]           lsu_dfq_byp_cpuid ;
1656
input   [4:0]           lsu_cpx_pkt_inv_pa ;    // invalidate pa [10:6]
1657
input                   lsu_cpx_pkt_ifill_type ;
1658
//input                   stb_cam_hit ; REMOVED
1659
input                   lsu_cpx_pkt_atomic ;
1660
//input                   lsu_dfq_byp_stquad_pkt2 ;
1661
//input                   lsu_cpx_pkt_stquad_pkt2 ;
1662
input                   lsu_cpx_pkt_binit_st ;
1663
input                   lsu_cpx_pkt_prefetch ;
1664
input                   lsu_dfq_byp_binit_st ;
1665
//input   [3:0]           lsu_stb_empty ;
1666
input                   lsu_tlbop_force_swo ;
1667
input   [7:3]           lsu_iobrdge_tap_rq_type ;
1668
input                   lsu_dcache_tag_perror_g ;  // dcache tag parity error
1669
input                   lsu_dcache_data_perror_g ; // dcache data parity error
1670
//input                   lsu_dfq_byp_perror_dinv ;  // dtag perror corr. st ack
1671
//input                   lsu_dfq_byp_perror_iinv ;  // itag perror corr. st ack
1672
 
1673
 
1674
input                   lsu_cpx_pkt_perror_iinv ;   // itag perror corr. st ack
1675
input                   lsu_cpx_pkt_perror_dinv ;   // dtag perror corr. st ack
1676
input   [1:0]           lsu_cpx_pkt_perror_set ;   // dtag perror - spec. b54
1677
//input                   lsu_diagnstc_wr_src_sel_e ;// dcache/dtag/vld
1678
input                   lsu_l2fill_fpld_e ;      // fp load
1679
input                   lsu_cpx_pkt_strm_ack ;
1680
 
1681
input                   ifu_lsu_memref_d ;
1682
//input   [3:0]           lmq_enable;
1683
//input   [3:0]           ld_pcx_rq_sel ;
1684
input                   lsu_fwdpkt_pcx_rq_sel ;
1685
//input                   lsu_ld0_pcx_rq_sel_d1, lsu_ld1_pcx_rq_sel_d1 ;
1686
//input                   lsu_ld2_pcx_rq_sel_d1, lsu_ld3_pcx_rq_sel_d1 ;
1687
input                   lsu_imiss_pcx_rq_sel_d1 ;
1688
 
1689
//input                   lsu_dc_iob_access_e;
1690
 
1691
//   input                mbist_dcache_write;
1692
//   input                mbist_dcache_read;
1693
 
1694
 
1695
input                   lsu_dfq_byp_cpx_inv ;
1696
//input                 lsu_dfq_byp_stack_dcfill_vld ;
1697
input  [1:0]            lsu_dfq_byp_stack_adr_b54;
1698
input  [1:0]            lsu_dfq_byp_stack_wrway;
1699
 
1700
input                   lsu_dfq_rdata_st_ack_type;
1701
input                   lsu_dfq_rdata_stack_dcfill_vld;
1702
 
1703
input                   lsu_dfq_rdata_stack_iinv_vld;
1704
 
1705
input  [2:0]            lsu_dfq_rdata_cpuid;
1706
 
1707
input                   lsu_dfq_byp_atm;
1708
 
1709
input   [3:0]            lsu_ld_inst_vld_g ;
1710
 
1711
input   [5:0]            lsu_dfq_rdata_type ;
1712
input                   lsu_dfq_rdata_invwy_vld ;
1713
 
1714
input                   ifu_lsu_fwd_data_vld ; // icache ramtest read cmplt
1715
input                   ifu_lsu_fwd_wr_ack ;   // icache ramtest wr cmplt
1716
 
1717
input   [3:0]            lsu_dfq_rdata_rq_type ;
1718
input                   lsu_dfq_rdata_b103 ;
1719
 
1720
input                   sehold ;
1721
 
1722
output                  lsu_fwd_rply_sz1_unc ;
1723
output                  lsu_dcache_iob_rd_w ;
1724
 
1725
output                  ldd_in_dfq_out;
1726
 
1727
output                  lsu_dfq_rd_vld_d1 ;
1728
output                  dfq_byp_ff_en ;
1729
output                  lsu_dfill_data_sel_hi;// select hi or low order 8B. 
1730
output                  lsu_ifill_pkt_vld ;   // ifill pkt vld
1731
output                  cpx_fwd_pkt_en_cx ;
1732
output  [5:0]           lsu_cpxpkt_type_dcd_cx ;
1733
output  [7:0]           lsu_cpu_dcd_sel ;
1734
output                  lsu_cpu_uhlf_sel ;
1735
//output                  lsu_st_wr_sel_e ;
1736
//output  [1:0]           lsu_st_ack_addr_b54 ;
1737
//output  [1:0]           lsu_st_ack_wrwy ;       // cache set way to write to.
1738
 
1739
output  [2:0]           lsu_iobrdge_rply_data_sel ;
1740
output                  lsu_iobrdge_fwd_pkt_vld ;
1741
output                  lsu_tlu_cpx_vld;    // cpx pkt vld
1742
output  [3:0]           lsu_tlu_cpx_req;    // cpx pkt rq type
1743
output  [17:0]          lsu_tlu_intpkt;     // cpx interrupt pkt
1744
//output                  lsu_tlu_pcxpkt_ack; // ack for intr pkt.
1745
//output  [3:0]           lsu_intrpt_cmplt ;      // intrpt can restart thread
1746
//output                  lsu_ld_sec_hit_l2access_g ;
1747
//output  [1:0]           lsu_ld_sec_hit_wy_g ;
1748
output                  ld_sec_active ;     // secondary bypassing
1749
output  [3:0]           dfq_byp_sel ;
1750
//output  [3:0]           lsu_dfq_byp_mxsel ; // to qdp1
1751
//output  [3:0]           lmq_byp_misc_sel ;    // select g-stage lmq source
1752
//output                  lsu_pcx_ld_dtag_perror_w2 ;
1753
output                  lsu_cpx_ld_dtag_perror_e ;
1754
output                  lsu_cpx_ld_dcache_perror_e ;
1755
//output  [1:0]           lsu_cpx_atm_st_err ;
1756
//output                  lsu_ignore_fill ;
1757
//output  [4:0]           lsu_exu_rd_w2 ;
1758
output  [4:0]           lsu_exu_rd_m ;
1759
output  [1:0]           lsu_spu_strm_ack_cmplt ;
1760
output                  lsu_atm_st_cmplt_e ;  // atm st ack will restart thread
1761
output                  dva_svld_e ;        // snoop is valid
1762
output                  dfq_wptr_vld ;          // write pointer valid
1763
output  [4:0]           dfq_wptr ;              // encoded write pointer
1764
output  [3:0]           lsu_dfq_flsh_cmplt ;
1765
output                  dfq_rptr_vld ;          // read pointer valid
1766
output  [4:0]           dfq_rptr ;              // encoded read pointer
1767
output                  lsu_ifu_stallreq ;      // cfq has crossed high-water mark
1768
output  [4:0]           dva_snp_addr_e;         // Upper 5b of cache set index PA[10:6]
1769
//output  [3:0]           dva_snp_set_vld_e;      // Lower 2b of cache set index - decoded
1770
//output  [1:0]           dva_snp_wy0_e ;         // way for addr<5:4>=00
1771
//output  [1:0]           dva_snp_wy1_e ;         // way for addr<5:4>=01
1772
//output  [1:0]           dva_snp_wy2_e ;         // way for addr<5:4>=10
1773
//output  [1:0]           dva_snp_wy3_e ;         // way for addr<5:4>=11
1774
//output  [3:0]           lsu_st_ack_rq_stb ;
1775
output  [3:0]           lsu_st_ack_dq_stb ;
1776
output  [3:0]           lsu_cpx_rmo_st_ack ;    // rmo ack clears
1777
output                  lsu_st_wr_dcache ;
1778
output                  cpx_st_ack_tid0 ;   // st ack for thread0
1779
output                  cpx_st_ack_tid1 ;   // st ack for thread1
1780
output                  cpx_st_ack_tid2 ;   // st ack for thread2
1781
output                  cpx_st_ack_tid3 ;   // st ack for thread3
1782
output  [3:0]           lsu_tlu_l2_dmiss ;       // performance cntr
1783
//output  [3:0]           lsu_ifu_stq_busy ;         // thread is busy with 1 stq - not used
1784
output                  lsu_l2fill_vld ;        // dfill data vld
1785
output                  lsu_byp_ldd_oddrd_m ; // rd fill for non-alt ldd
1786
output                  lsu_pcx_fwd_reply ;   // fwd reply on pcx pkt
1787
//output                  lsu_intrpt_pkt_vld ;
1788
output                  lsu_fwdpkt_vld;
1789
//output  [3:0]           lsu_error_rst ;
1790
output                  lsu_dcfill_active_e;    // not same as dcfill_active_e; qual'ed w/ ignore_fill
1791
//output                  lsu_dfq_byp_vld ;
1792
output                  lsu_dfq_ld_vld;
1793
output                  lsu_fldd_vld_en;
1794
output  [3:0]           lsu_dfill_dcd_thrd ;
1795
output  [4:0]           lsu_fwdpkt_dest ;
1796
//output                  dcfill_src_dfq_sel ;    // ld-inv is src
1797
output [15:0]        dva_snp_bit_wr_en_e;
1798
 
1799
//output [3:0]         lsu_dcfill_mx_sel_e;
1800
//output               lsu_dcfill_addr_mx_sel_e;
1801
//output               lsu_dcfill_data_mx_sel_e;
1802
//output               lsu_dcfill_size_mx_sel_e;
1803
 
1804
output               lsu_cpx_spc_inv_vld;  // dfq write data in[152]
1805
output [3:0]         lsu_cpx_thrdid;
1806
output               lsu_cpx_stack_dcfill_vld ;
1807
 
1808
//output        [3:0]           lsu_dtag_perror_w2 ;
1809
 
1810
output                  lsu_dfq_vld_entry_w ;
1811
 
1812
output                  lsu_cpx_stack_icfill_vld ;
1813
 
1814
output                  lsu_dfq_st_vld;
1815
output                  lsu_dfq_ldst_vld;
1816
   //pref counter
1817
//   output [3:0] lsu_cpx_pref_ack;
1818
 
1819
output                  lsu_qdp2_dfq_ld_vld;
1820
output                  lsu_qdp2_dfq_st_vld;
1821
 
1822
output                  lsu_cpx_stack_dcfill_vld_b130;
1823
 
1824
output                  lsu_dfq_vld ;
1825
 
1826
output                  lsu_dfq_byp_ff_en ;
1827
 
1828
/*AUTOWIRE*/
1829
// Beginning of automatic wires (for undeclared instantiated-module outputs)
1830
// End of automatics
1831
 
1832
 
1833
wire        cpx_local_st_ack_type ;
1834
wire  [3:0] cpx_pkt_thrd_sel ;
1835
//wire  [3:0] tap_thread ;
1836
wire      cpx_reverse_req , cpx_reverse_req_d1 ;
1837
wire    cpx_fwd_req,cpx_fwd_reply;
1838
wire    fwdpkt_reset ;
1839
wire        dfq_inv_vld ;
1840
//wire    intrpt_vld_reset ;
1841
//wire    intrpt_vld_en ;
1842
//wire    ld0_sec_hit_g,ld1_sec_hit_g,ld2_sec_hit_g,ld3_sec_hit_g;
1843
//wire  [3:0] intrpt_thread ;
1844
wire    dfq_byp_ld_vld ;
1845
//wire    intrpt_clr ;
1846
wire    dfq_rptr_vld_d1 ;
1847
wire    dfq_rd_advance ;
1848
wire        dfq_wr_en, dfq_byp_full, dcfill_active_e ;
1849
wire    dfq_thread0,dfq_thread1,dfq_thread2,dfq_thread3;
1850
//wire    ld_any_thrd_byp_sel ;
1851
wire    stwr_active_e,stdq_active_e ;
1852
wire  [3:0] error_en ;
1853
wire        ldd_vld_reset, ldd_vld_en, ldd_in_dfq_out ;
1854
wire    ldd_non_alt_space ;
1855
wire    ldd_oddrd_e ;
1856
wire        inv_active_e ;
1857
wire    dfq_st_vld ;
1858
//wire    local_inv ;
1859
wire    dfq_local_inv ;
1860
//wire    st_ack_rq_stb_d1 ;
1861
//wire    cpx_inv ;
1862
wire    dfq_byp_inv_vld ;
1863
wire    dfq_invwy_vld;
1864
wire    local_pkt ;
1865
wire    dfq_byp_st_vld ;
1866
wire        dfq_vld_reset, dfq_vld_en ;
1867
//wire  [3:0] st_wrwy_sel ;
1868
//wire  [13:0]  cpx_cpu_inv_data ;
1869
wire        dfq_vld_entry_exists ;
1870
wire    cpx_st_ack_type,cpx_strm_st_ack_type,cpx_int_type;
1871
wire    cpx_ld_type,cpx_ifill_type,cpx_evict_type;
1872
wire  [5:0]     dfq_wptr_new_w_wrap ;   // 5b ptr with wrap bit.
1873
wire  [5:0]     dfq_rptr_new_w_wrap ;   // 5b ptr with wrap bit.
1874
wire  [5:0]     dfq_wptr_w_wrap ;   // 5b ptr with wrap bit.
1875
//wire    i_and_d_codepend ;
1876
wire    dfq_ld_type,dfq_ifill_type,dfq_evict_type ;
1877
wire    dfq_st_ack_type,dfq_strm_st_ack_type,dfq_int_type;
1878
wire  [5:0]     dfq_rptr_w_wrap ;   // 3b ptr with wrap bit.
1879
wire  [3:0]   imiss_dcd_b54 ;
1880
//wire    st_ack_rq_stb ;
1881
//wire  [1:0] st_ack_tid ;
1882
wire  [3:0] cpu_sel ;
1883
wire  [1:0] fwdpkt_l2bnk_addr ;
1884
//wire  [2:0] intrpt_l2bnk_addr ;
1885
//wire  [3:0] dfq_byp_sel_m, dfq_byp_sel_g ;
1886
//wire  [1:0] ld_error0,ld_error1,ld_error2,ld_error3 ;
1887
//wire  [4:0] ld_l1hit_rd_m,ld_l1hit_rd_g;
1888
wire  [4:0] ld_l1hit_rd_m;
1889
//wire  [13:0]  dfq_inv_data ;
1890
wire  [13:9]  dfq_inv_data_b13to9 ;
1891
wire  [7:2]   dfq_inv_data_b7to2 ;
1892
wire          dfq_inv_data_b0 ;
1893
wire          fwdpkt_vld;
1894
wire  [3:0]   dfill_dcd_thrd ;
1895
wire  [3:0]   error_rst ;
1896
wire          dfq_ld_vld;
1897
wire          dfq_byp_vld ;
1898
wire          reset;
1899
wire          st_rd_advance;
1900
wire    vld_dfq_pkt ;
1901
wire          dfq_vld_entry_exists_w;
1902
wire          dfq_rdata_local_pkt;
1903
wire          dfq_st_cmplt ;
1904
wire          cpx_fp_type ;
1905
wire    dfq_stall, dfq_stall_d1 ;
1906
wire          cpx_error_type ;
1907
wire          dfq_error_type ;
1908
wire          cpx_fwd_req_ic ;
1909
wire          dfq_fwd_req_ic_type ;
1910
wire          dfq_rd_vld_d1 ;
1911
 
1912
 
1913
    dffrl_async rstff(.din (grst_l),
1914
                        .q   (dbb_reset_l),
1915
                        .clk (clk), .se(se), .si(), .so(),
1916
                        .rst_l (arst_l));
1917
 
1918
assign  reset  =  ~dbb_reset_l;
1919
assign  clk = rclk;
1920
 
1921
 
1922
 
1923
//wire                   lsu_bist_wvld_e;
1924
//wire                   lsu_bist_rvld_e;
1925
 
1926
//dff #(2) mbist_stge (
1927
//   .din ({mbist_dcache_write, mbist_dcache_read}),
1928
//   .q   ({lsu_bist_wvld_e,    lsu_bist_rvld_e  }),
1929
//   .clk (clk),
1930
//   .se  (1'b0),       .si (),          .so ()
1931
//);   
1932
 
1933
//=================================================================================================
1934
// SHADOW SCAN
1935
//=================================================================================================
1936
 
1937
// Monitors whether there is a valid entry in the dfq.
1938
assign  lsu_dfq_vld_entry_w = dfq_vld_entry_exists_w ;
1939
// Monitors whether dfq_byp flop remains full
1940
//assign        lsu_sscan_data[?] = dfq_byp_full ;
1941
 
1942
//=================================================================================================
1943
//
1944
// QDP2 Specific Control
1945
//
1946
//=================================================================================================
1947
 
1948
// Need to be careful. This may prevent stores
1949
//assign  dcfill_src_dfq_sel = dcfill_active_e ;
1950
 
1951
 
1952
 
1953
 
1954
 
1955
//=================================================================================================
1956
//  IMISS X-INVALIDATION
1957
//=================================================================================================
1958
 
1959
// Assume all imisses are alligned to a 32B boundary in L2 ?
1960
 
1961
wire  imiss0_inv_en, imiss1_inv_en ;
1962
wire  imiss2_inv_en, imiss3_inv_en ;
1963
wire  [10:5] imiss0_set_index,imiss1_set_index ;
1964
wire  [10:5] imiss2_set_index,imiss3_set_index ;
1965
//8/28/03 - vlint cleanup
1966
//wire  [10:4] imiss0_set_index,imiss1_set_index ;
1967
//wire  [10:4] imiss2_set_index,imiss3_set_index ;
1968
 
1969
assign  imiss0_inv_en = ifu_pcx_pkt_b51 & ~ifu_pcx_pkt_b41t40[1] & ~ifu_pcx_pkt_b41t40[0] & lsu_imiss_pcx_rq_sel_d1 ;
1970
assign  imiss1_inv_en = ifu_pcx_pkt_b51 & ~ifu_pcx_pkt_b41t40[1] &  ifu_pcx_pkt_b41t40[0] & lsu_imiss_pcx_rq_sel_d1 ;
1971
assign  imiss2_inv_en = ifu_pcx_pkt_b51 &  ifu_pcx_pkt_b41t40[1] & ~ifu_pcx_pkt_b41t40[0] & lsu_imiss_pcx_rq_sel_d1 ;
1972
assign  imiss3_inv_en = ifu_pcx_pkt_b51 &  ifu_pcx_pkt_b41t40[1] &  ifu_pcx_pkt_b41t40[0] & lsu_imiss_pcx_rq_sel_d1 ;
1973
 
1974
dffe #(6) imiss_inv0 (
1975
        .din    ({ifu_pcx_pkt_b10t5[5:0]}),
1976
        .q      ({imiss0_set_index[10:5]}),
1977
        .en (imiss0_inv_en),
1978
        .clk  (clk),
1979
        .se     (1'b0),       .si (),          .so ()
1980
        );
1981
 
1982
dffe #(6) imiss_inv1 (
1983
        .din    ({ifu_pcx_pkt_b10t5[5:0]}),
1984
        .q      ({imiss1_set_index[10:5]}),
1985
        .en (imiss1_inv_en),
1986
        .clk  (clk),
1987
        .se     (1'b0),       .si (),          .so ()
1988
        );
1989
 
1990
dffe #(6) imiss_inv2 (
1991
        .din    ({ifu_pcx_pkt_b10t5[5:0]}),
1992
        .q      ({imiss2_set_index[10:5]}),
1993
        .en (imiss2_inv_en),
1994
        .clk  (clk),
1995
        .se     (1'b0),       .si (),          .so ()
1996
        );
1997
 
1998
dffe #(6) imiss_inv3 (
1999
        .din    ({ifu_pcx_pkt_b10t5[5:0]}),
2000
        .q      ({imiss3_set_index[10:5]}),
2001
        .en (imiss3_inv_en),
2002
        .clk  (clk),
2003
        .se     (1'b0),       .si (),          .so ()
2004
        );
2005
 
2006
assign  cpx_pkt_thrd_sel[0] = ~lsu_cpx_pkt_tid[1] & ~lsu_cpx_pkt_tid[0] ;
2007
assign  cpx_pkt_thrd_sel[1] = ~lsu_cpx_pkt_tid[1] &  lsu_cpx_pkt_tid[0] ;
2008
assign  cpx_pkt_thrd_sel[2] =  lsu_cpx_pkt_tid[1] & ~lsu_cpx_pkt_tid[0] ;
2009
assign  cpx_pkt_thrd_sel[3] =  lsu_cpx_pkt_tid[1] &  lsu_cpx_pkt_tid[0] ;
2010
// This needs to be included once the change for the stb bug is complete
2011
wire  [6:1] imiss_inv_set_index ;
2012
assign  imiss_inv_set_index[6:1] =
2013
  cpx_pkt_thrd_sel[0] ? imiss0_set_index[10:5] :
2014
    cpx_pkt_thrd_sel[1] ? imiss1_set_index[10:5] :
2015
      cpx_pkt_thrd_sel[2] ? imiss2_set_index[10:5] :
2016
        cpx_pkt_thrd_sel[3] ? imiss3_set_index[10:5] : 6'bxx_xxxx ;
2017
 
2018
 
2019
 
2020
//=================================================================================================
2021
//  FWD REPLY/REQUEST
2022
//=================================================================================================
2023
 
2024
// cpx pkt decode. fwd req/reply do not go into dfq.
2025
 
2026
 
2027
//assign  tap_thread[0] = ~lsu_iobrdge_tap_rq_type[1] & ~lsu_iobrdge_tap_rq_type[0] ;
2028
//assign  tap_thread[1] = ~lsu_iobrdge_tap_rq_type[1] &  lsu_iobrdge_tap_rq_type[0] ;
2029
//assign  tap_thread[2] =  lsu_iobrdge_tap_rq_type[1] & ~lsu_iobrdge_tap_rq_type[0] ;
2030
//assign  tap_thread[3] =  lsu_iobrdge_tap_rq_type[1] &  lsu_iobrdge_tap_rq_type[0] ;
2031
 
2032
// This is the pkt from the TAP to be returned to the TAP
2033
//assign  cpx_reverse_req = cpx_spc_data_cx[130] ;
2034
assign  cpx_reverse_req = cpx_spc_data_cx_b130;
2035
 
2036
// removed tap_rq_type[2] from the data_sel logic
2037
assign  lsu_iobrdge_rply_data_sel[0] =  // defeature, margin, bist
2038
  (|lsu_iobrdge_tap_rq_type[5:3]) & cpx_reverse_req_d1 ;
2039
assign  lsu_iobrdge_rply_data_sel[1] =  // i/dcache
2040
  (|lsu_iobrdge_tap_rq_type[7:6] & ~(|lsu_iobrdge_tap_rq_type[5:3])) & cpx_reverse_req_d1 ;
2041
// regular fwd pkt
2042
//  - sothea - 0in bug - can be 0-hot
2043
//assign  lsu_iobrdge_rply_data_sel[2] = ~((|lsu_iobrdge_tap_rq_type[7:3]) & cpx_reverse_req_d1) ;
2044
assign  lsu_iobrdge_rply_data_sel[2] = ~|lsu_iobrdge_rply_data_sel[1:0] ;
2045
 
2046
wire dcache_iob_rd,dcache_iob_rd_e, dcache_iob_rd_m, dcache_iob_rd_w ;
2047
assign  dcache_iob_rd = lsu_iobrdge_tap_rq_type[6] & lsu_iobrdge_fwd_pkt_vld ;
2048
 
2049
dff  dciob_rd_e (
2050
        .din    (dcache_iob_rd),
2051
        .q      (dcache_iob_rd_e),
2052
        .clk    (clk),
2053
        .se     (1'b0),       .si (),          .so ()
2054
        );
2055
 
2056
dff  dciob_rd_m (
2057
        .din    (dcache_iob_rd_e),
2058
        .q      (dcache_iob_rd_m),
2059
        .clk    (clk),
2060
        .se     (1'b0),       .si (),          .so ()
2061
        );
2062
 
2063
dff  dciob_rd_w (
2064
        .din    (dcache_iob_rd_m),
2065
        .q      (dcache_iob_rd_w),
2066
        .clk    (clk),
2067
        .se     (1'b0),       .si (),          .so ()
2068
        );
2069
 
2070
assign  lsu_dcache_iob_rd_w = dcache_iob_rd_w ;
2071
 
2072
wire  cpx_fwd_rq_type ;
2073
assign  cpx_fwd_rq_type =
2074
        cpx_spc_data_cx_b144to140[143]   & ~cpx_spc_data_cx_b144to140[140+2] & // fwd req
2075
        cpx_spc_data_cx_b144to140[140+1] & ~cpx_spc_data_cx_b144to140[140];
2076
wire  cpx_fwd_rply_type ;
2077
assign  cpx_fwd_rply_type =
2078
        cpx_spc_data_cx_b144to140[143]   & ~cpx_spc_data_cx_b144to140[140+2] & // fwd reply
2079
        cpx_spc_data_cx_b144to140[140+1] &  cpx_spc_data_cx_b144to140[140] ;
2080
 
2081
// cpx pkt decode. fwd req/reply do not go into dfq.
2082
assign  cpx_fwd_req =
2083
         cpx_spc_data_cx_b144to140[144] & ~cpx_reverse_req & cpx_fwd_rq_type ;
2084
 
2085
//8/25/03: add fwd req to L1I$ for RAMTEST to dfq_wr_en, dfq_rd_dvance
2086
//bug4293 - set fwd_req_ic based on cpx_fwd_req_type and not based on cpx_fwd_req. this causes the request to 
2087
//          de dropped i.e. not written into dfq 'cos cpx_fwd_req_ic is not set
2088
//assign  cpx_fwd_req_ic =  cpx_fwd_req & cpx_spc_data_cx_b103 ;
2089
 
2090
assign  cpx_fwd_req_ic =  cpx_spc_data_cx_b144to140[144] & cpx_fwd_rq_type &
2091
                          cpx_reverse_req & cpx_spc_data_cx_b103 ;
2092
 
2093
assign  cpx_fwd_pkt_en_cx = cpx_fwd_req | cpx_fwd_reply ;
2094
 
2095
assign  cpx_fwd_reply =
2096
         cpx_spc_data_cx_b144to140[144] & (cpx_fwd_rply_type | (cpx_fwd_rq_type & cpx_reverse_req)) ;
2097
 
2098
dff #(1) fwdpkt_stgd1 (
2099
        .din    (fwd_reply_vld),
2100
        .q      (lsu_pcx_fwd_reply),
2101
        .clk    (clk),
2102
        .se     (1'b0),       .si (),          .so ()
2103
        );
2104
 
2105
 
2106
// Requests from iobrdge will not be speculative as core is expected to be quiescent.
2107
assign  fwdpkt_reset =
2108
  (reset | lsu_fwdpkt_pcx_rq_sel) ;
2109
  // (reset | (lsu_fwdpkt_pcx_rq_sel & ~pcx_req_squash)) ; 
2110
wire    fwdpkt_vld_unmasked,fwdpkt_vld_unmasked_d1 ;
2111
wire    fwd_unc_err ;
2112
// There can be only one outstanding fwd reply or request.
2113
dffre #(7)  fwdpkt_ff (
2114
        .din    ({cpx_fwd_pkt_en_cx,cpx_fwd_req,cpx_fwd_reply,
2115
                cpx_spc_data_cx_b138,cpx_spc_data_cx_b71to70[1:0], cpx_reverse_req}),
2116
        .q      ({fwdpkt_vld_unmasked,fwd_req_vld,fwd_reply_vld,
2117
                fwd_unc_err,fwdpkt_l2bnk_addr[1:0],cpx_reverse_req_d1}),
2118
  .rst  (fwdpkt_reset), .en (cpx_fwd_pkt_en_cx),
2119
        .clk  (clk),
2120
        .se     (1'b0),       .si (),          .so ()
2121
        );
2122
 
2123
wire    fwd_rply_sz1_unc ; // Either size[1] for fwd-rq or unc-err for fwd-rply.
2124
assign  fwd_rply_sz1_unc = fwd_reply_vld ? fwd_unc_err : 1'b1 ;
2125
 
2126
dff  fpktunc_d1 (
2127
        .din    (fwd_rply_sz1_unc),
2128
        .q      (lsu_fwd_rply_sz1_unc),
2129
        .clk    (clk),
2130
        .se     (1'b0),       .si (),          .so ()
2131
        );
2132
 
2133
dff  fpktv_d1 (
2134
        .din    (fwdpkt_vld_unmasked),
2135
        .q      (fwdpkt_vld_unmasked_d1),
2136
        .clk    (clk),
2137
        .se     (1'b0),       .si (),          .so ()
2138
        );
2139
 
2140
 
2141
wire icache_rd_done,icache_wr_done ;
2142
dff #(2) ifwd_d1 (
2143
        .din    ({ifu_lsu_fwd_data_vld,ifu_lsu_fwd_wr_ack}),
2144
        .q      ({icache_rd_done,icache_wr_done}),
2145
        .clk    (clk),
2146
        .se     (1'b0),       .si (),          .so ()
2147
        );
2148
 
2149
// make one-shot : read data may be off.
2150
assign  lsu_iobrdge_fwd_pkt_vld = fwdpkt_vld_unmasked & ~fwdpkt_vld_unmasked_d1 & cpx_reverse_req_d1 ;
2151
//assign  lsu_iobrdge_fwd_pkt_vld = fwdpkt_vld ;
2152
assign  fwdpkt_vld =
2153
        // immediate for all but dcache rd.
2154
        (fwdpkt_vld_unmasked & ~((|lsu_iobrdge_tap_rq_type[7:6]) & cpx_reverse_req_d1)) |
2155
        // dcache rd - wait until w.
2156
        (fwdpkt_vld_unmasked &  lsu_iobrdge_tap_rq_type[6] & cpx_reverse_req_d1 &
2157
                ~(dcache_iob_rd | dcache_iob_rd_e | dcache_iob_rd_m | dcache_iob_rd_w)) |
2158
        // icache rd - wait for rd & wr 
2159
        (fwdpkt_vld_unmasked &  lsu_iobrdge_tap_rq_type[7] & cpx_reverse_req_d1 &
2160
                        (icache_rd_done | icache_wr_done)) ;
2161
 
2162
assign  lsu_fwdpkt_vld  =  fwdpkt_vld;
2163
 
2164
assign  lsu_fwdpkt_dest[0] = fwd_req_vld & ~fwdpkt_l2bnk_addr[1] & ~fwdpkt_l2bnk_addr[0] ; // l2bank=0
2165
assign  lsu_fwdpkt_dest[1] = fwd_req_vld & ~fwdpkt_l2bnk_addr[1] &  fwdpkt_l2bnk_addr[0] ; // l2bank=1
2166
assign  lsu_fwdpkt_dest[2] = fwd_req_vld &  fwdpkt_l2bnk_addr[1] & ~fwdpkt_l2bnk_addr[0] ; // l2bank=2
2167
assign  lsu_fwdpkt_dest[3] = fwd_req_vld &  fwdpkt_l2bnk_addr[1] &  fwdpkt_l2bnk_addr[0] ; // l2bank=3
2168
assign  lsu_fwdpkt_dest[4] = fwd_reply_vld ; // reply always goes back to IO Bridge
2169
 
2170
//=================================================================================================
2171
//  INTERRUPT CPX PKT REQ CTL
2172
//=================================================================================================
2173
 
2174
//bug6322
2175
//assign  lsu_tlu_cpx_vld = cpx_spc_data_cx_b144to140[`CPX_VLD] & ~cpx_spc_data_cx_b136 ;
2176
//assign  lsu_tlu_cpx_req[3:0] = cpx_spc_data_cx_b144to140[`CPX_RQ_HI:`CPX_RQ_LO] ;
2177
//assign  lsu_tlu_intpkt[17:0] = cpx_spc_data_b17t0_cx[17:0] ;
2178
 
2179
   wire lsu_tlu_cpx_vld_din_l;
2180
   wire [17:0] lsu_tlu_intpkt_din;
2181
   wire [3:0]  lsu_tlu_cpx_req_din_l;
2182
 
2183
assign  lsu_tlu_cpx_vld_din_l = ~(dfq_int_type & ~lsu_dfq_rdata_flush_bit & dfq_rd_advance) ;
2184
assign  lsu_tlu_intpkt_din[17:0] = lsu_dfq_rdata_b17_b0[17:0] ;
2185
assign  lsu_tlu_cpx_req_din_l[3:0] = ~ lsu_dfq_rdata_rq_type[3:0];
2186
 
2187
   wire lsu_tlu_cpx_vld_l;
2188
   wire [3:0] lsu_tlu_cpx_req_l;
2189
 
2190
dff  #(23) lsu_tlu_stg (
2191
        .din    ({lsu_tlu_cpx_vld_din_l, lsu_tlu_intpkt_din[17:0], lsu_tlu_cpx_req_din_l[3:0]}),
2192
        .q      ({lsu_tlu_cpx_vld_l,     lsu_tlu_intpkt[17:0], lsu_tlu_cpx_req_l[3:0]}),
2193
        .clk    (clk),
2194
        .se     (1'b0),       .si (),          .so ()
2195
        );
2196
 
2197
   assign     lsu_tlu_cpx_vld = ~lsu_tlu_cpx_vld_l;
2198
   assign     lsu_tlu_cpx_req[3:0] = ~lsu_tlu_cpx_req_l[3:0];
2199
 
2200
//=================================================================================================
2201
//  STQUAD PKT CONTROL
2202
//=================================================================================================
2203
 
2204
 
2205
 
2206
 
2207
 
2208
//=================================================================================================
2209
// SECONDARY VS. PRIMARY LOADS
2210
//=================================================================================================
2211
 
2212
 
2213
// NOT USED
2214
//wire  [1:0] dfq_sel_tid ;
2215
//assign  dfq_sel_tid[1:0] = 
2216
//  // select byp tid if ld from cfq or cpx will be latched in byp ff next cycle
2217
//  (dfq_byp_ld_vld & ((dfq_rptr_vld_d1 & dfq_rd_advance) | (cpx_spc_data_cx_b144to140[`CPX_VLD] & ~dfq_wr_en))) ? 
2218
//  dfq_byp_tid[1:0] : dfq_tid[1:0] ;
2219
 
2220
//temp, send to dctl, phase 2     
2221
assign  ld_sec_active = 1'b0 ;
2222
 
2223
assign  dfq_thread0 = ~dfq_tid[1] & ~dfq_tid[0] ;
2224
assign  dfq_thread1 = ~dfq_tid[1] &  dfq_tid[0] ;
2225
assign  dfq_thread2 =  dfq_tid[1] & ~dfq_tid[0] ;
2226
assign  dfq_thread3 =  dfq_tid[1] &  dfq_tid[0] ;
2227
 
2228
// NOT USED
2229
//assign  ld_any_thrd_byp_sel = |(ld_thrd_byp_sel[3:0]);
2230
 
2231
// phase 2 change   
2232
// L2$ sends response for both prim and sec requests. Both will go into DFQ
2233
// and fill D$
2234
// can we eliminate dcfill_active_e ?
2235
 
2236
//11/7/03 - add rst_tri_en
2237
wire  [3:0]  dfq_byp_sel_tmp ;
2238
   assign dfq_byp_sel_tmp[0]  = dfq_thread0  & dcfill_active_e & ~lsu_cpx_pkt_prefetch;
2239
   assign dfq_byp_sel_tmp[1]  = dfq_thread1  & dcfill_active_e & ~lsu_cpx_pkt_prefetch;
2240
   assign dfq_byp_sel_tmp[2]  = dfq_thread2  & dcfill_active_e & ~lsu_cpx_pkt_prefetch;
2241
   assign dfq_byp_sel_tmp[3]  = dfq_thread3  & dcfill_active_e & ~lsu_cpx_pkt_prefetch;
2242
 
2243
   assign dfq_byp_sel[2:0]  =  dfq_byp_sel_tmp[2:0]  & {3{~rst_tri_en}} ;
2244
   assign dfq_byp_sel[3]    =  dfq_byp_sel_tmp[3]    | rst_tri_en ;
2245
 
2246
//   assign lsu_dfq_byp_mxsel[0]  = dfq_thread0  & dcfill_active_e;
2247
//   assign lsu_dfq_byp_mxsel[1]  = dfq_thread1  & dcfill_active_e;
2248
//   assign lsu_dfq_byp_mxsel[2]  = dfq_thread2  & dcfill_active_e;
2249
//   assign lsu_dfq_byp_mxsel[3]  = ~|lsu_dfq_byp_mxsel[2:0];
2250
 
2251
// includes store cmplt tid also. 
2252
assign  dfill_dcd_thrd[0] =   dfq_byp_sel[0] |    // for load
2253
        (dfq_thread0 & stdq_active_e)  ;// for store
2254
assign  dfill_dcd_thrd[1] =   dfq_byp_sel[1] |    // for load
2255
        (dfq_thread1 & stdq_active_e)  ;// for store
2256
assign  dfill_dcd_thrd[2] =   dfq_byp_sel[2] |    // for load
2257
        (dfq_thread2 & stdq_active_e)  ;// for store
2258
assign  dfill_dcd_thrd[3] =   dfq_byp_sel[3] |    // for load
2259
        (dfq_thread3 & stdq_active_e)  ;// for store
2260
 
2261
assign  lsu_dfill_dcd_thrd[3:0]  =  dfill_dcd_thrd[3:0];
2262
 
2263
//=================================================================================================
2264
//  Error Related Logic
2265
//=================================================================================================
2266
 
2267
// Equivalent of lmq but lmq has run out of bits
2268
// Following bits need to be logged.
2269
// Dtag parity error 
2270
//  - output on bit 130 of equivalent ld pkt
2271
//  - when cpx pkt is at head of cfq, then log error
2272
//  and take corresponding trap synchronous to pipe.
2273
// DCache parity error
2274
//  - when cpx pkt is at head of cfq, then log error
2275
//  and take corresponding trap synchronous to pipe.
2276
 
2277
 
2278
// The load component of the cpx response for an atomic will
2279
// save it's error info for the store component. The store
2280
// component will take the trap in the g stage, depending
2281
// on the error information from the ld. However, it can
2282
// always override the parity error info initially written,
2283
// as atomics do not lookup the cache or tag.
2284
 
2285
 
2286
//assign  error_en[0] = lmq_enable[0] | (lsu_cpx_pkt_atm_st_cmplt & dcfill_active_e & dfq_byp_sel[0]);
2287
assign  error_en[0] =
2288
        //lsu_ld_inst_vld_g[0] | (lsu_cpx_pkt_atm_st_cmplt & dcfill_active_e & dfq_byp_sel[0]); // Bug 3624
2289
        lsu_ld_inst_vld_g[0] ;
2290
assign  error_en[1] =
2291
        lsu_ld_inst_vld_g[1] ;
2292
assign  error_en[2] =
2293
        lsu_ld_inst_vld_g[2] ;
2294
assign  error_en[3] =
2295
        lsu_ld_inst_vld_g[3] ;
2296
 
2297
// 10/15/03: error reset is set only by reset. lsu_ld[0-3]_pcx_rq_sel_d1 is not needed because the
2298
//           the flop is used only for reporting error to ifu. Also, the error_en is set for new requests.
2299
//tmp fix for reset
2300
//wire              lsu_pcx_ld_dtag_perror_w2 ;
2301
//assign lsu_pcx_ld_dtag_perror_w2  = 1'b0;
2302
 
2303
//assign  error_rst[0] = reset | (lsu_ld0_pcx_rq_sel_d1 & lsu_pcx_ld_dtag_perror_w2) ;
2304
//assign  error_rst[1] = reset | (lsu_ld1_pcx_rq_sel_d1 & lsu_pcx_ld_dtag_perror_w2) ;
2305
//assign  error_rst[2] = reset | (lsu_ld2_pcx_rq_sel_d1 & lsu_pcx_ld_dtag_perror_w2) ;
2306
//assign  error_rst[3] = reset | (lsu_ld3_pcx_rq_sel_d1 & lsu_pcx_ld_dtag_perror_w2) ;
2307
 
2308
assign  error_rst[0] = reset ;
2309
assign  error_rst[1] = reset ;
2310
assign  error_rst[2] = reset ;
2311
assign  error_rst[3] = reset ;
2312
 
2313
//assign  lsu_error_rst[3:0]  =  error_rst[3:0];
2314
 
2315
wire    dtag_perror3,dtag_perror2,dtag_perror1,dtag_perror0;
2316
 
2317
// Thread 0
2318
dffre  #(2) error_t0 (
2319
        .din    ({lsu_dcache_tag_perror_g,lsu_dcache_data_perror_g}),
2320
    //lsu_cpx_pkt_ld_err[1:0]}),
2321
        .q      ({dtag_perror0,dcache_perror0}),
2322
        //.q      ({dtag_perror0,dcache_perror0,ld_error0[1:0]}),
2323
        .rst  (error_rst[0]), .en     (error_en[0]),
2324
        .clk    (clk),
2325
        .se     (1'b0),       .si (),          .so ()
2326
        );
2327
 
2328
// Thread 1
2329
dffre  #(2) error_t1 (
2330
        .din    ({lsu_dcache_tag_perror_g,lsu_dcache_data_perror_g}),
2331
    //lsu_cpx_pkt_ld_err[1:0]}),
2332
        .q      ({dtag_perror1,dcache_perror1}),
2333
        //.q      ({dtag_perror1,dcache_perror1,ld_error1[1:0]}),
2334
        .rst  (error_rst[1]), .en     (error_en[1]),
2335
        .clk    (clk),
2336
        .se     (1'b0),       .si (),          .so ()
2337
        );
2338
 
2339
// Thread 2
2340
dffre  #(2) error_t2 (
2341
        .din    ({lsu_dcache_tag_perror_g,lsu_dcache_data_perror_g}),
2342
    //lsu_cpx_pkt_ld_err[1:0]}),
2343
        .q      ({dtag_perror2,dcache_perror2}),
2344
        //.q      ({dtag_perror2,dcache_perror2,ld_error2[1:0]}),
2345
        .rst  (error_rst[2]), .en     (error_en[2]),
2346
        .clk    (clk),
2347
        .se     (1'b0),       .si (),          .so ()
2348
        );
2349
 
2350
// Thread 3
2351
dffre  #(2) error_t3 (
2352
        .din    ({lsu_dcache_tag_perror_g,lsu_dcache_data_perror_g}),
2353
    //lsu_cpx_pkt_ld_err[1:0]}),
2354
        .q      ({dtag_perror3,dcache_perror3}),
2355
        //.q      ({dtag_perror3,dcache_perror3,ld_error3[1:0]}),
2356
        .rst  (error_rst[3]), .en     (error_en[3]),
2357
        .clk    (clk),
2358
        .se     (1'b0),       .si (),          .so ()
2359
        );
2360
 
2361
//assign        lsu_dtag_perror_w2[3] = dtag_perror3 ;
2362
//assign        lsu_dtag_perror_w2[2] = dtag_perror2 ;
2363
//assign        lsu_dtag_perror_w2[1] = dtag_perror1 ;
2364
//assign        lsu_dtag_perror_w2[0] = dtag_perror0 ;
2365
 
2366
// Determine if ld pkt requires correction due to dtag parity error.
2367
//5/22/03: moved to qctl1
2368
//assign  lsu_pcx_ld_dtag_perror_w2 =
2369
//  ld_pcx_rq_sel[0] ? dtag_perror0 :
2370
//    ld_pcx_rq_sel[1] ? dtag_perror1 :
2371
//      ld_pcx_rq_sel[2] ? dtag_perror2 : dtag_perror3 ;
2372
 
2373
// Now post sparc related errors and take traps
2374
// error is reset after it is sent to pcx. the logic below will never be set!!
2375
assign  lsu_cpx_ld_dtag_perror_e =
2376
  dfq_byp_sel[0] ? dtag_perror0 :
2377
    dfq_byp_sel[1] ? dtag_perror1 :
2378
      dfq_byp_sel[2] ? dtag_perror2 : (dfq_byp_sel[3] & dtag_perror3) ; // Bug 4655
2379
 
2380
assign  lsu_cpx_ld_dcache_perror_e =
2381
  dfq_byp_sel[0] ? dcache_perror0 :
2382
    dfq_byp_sel[1] ? dcache_perror1 :
2383
      dfq_byp_sel[2] ? dcache_perror2 : (dfq_byp_sel[3] & dcache_perror3) ; // Bug 4655
2384
 
2385
//Bug 3624
2386
/*
2387
assign  lsu_cpx_atm_st_err[1:0] =
2388
  cpx_pkt_thrd_sel[0] ? ld_error0[1:0] :
2389
    cpx_pkt_thrd_sel[1] ? ld_error1[1:0] :
2390
      cpx_pkt_thrd_sel[2] ? ld_error2[1:0] : ld_error3[1:0] ;*/
2391
 
2392
//===
2393
wire memref_e;
2394
 
2395
dff #(1) stge_ad_e (
2396
  .din (ifu_lsu_memref_d),
2397
  .q   (memref_e),
2398
  .clk (clk),
2399
  .se     (1'b0),       .si (),          .so ()
2400
);
2401
 
2402
 
2403
 
2404
 
2405
//=================================================================================================
2406
//  LDD HANDLING
2407
//=================================================================================================
2408
 
2409
assign ldd_vld_reset =
2410
        (reset | (dcfill_active_e & ldd_in_dfq_out));
2411
 
2412
// prefetch qual is required for case where prefetch may get interference
2413
// from lmq contents set by a later load that issues before the prefetch
2414
// is returned.
2415
// integer
2416
assign ldd_vld_en = lmq_ldd_vld & ~lsu_cpx_pkt_prefetch & dcfill_active_e ;
2417
// fp
2418
assign lsu_fldd_vld_en = lmq_ldd_vld & ~lsu_cpx_pkt_prefetch & lsu_l2fill_fpld_e & dcfill_active_e ;
2419
 
2420
 
2421
dffre   ldd_in_dfq_ff (
2422
        .din    (lmq_ldd_vld), .q  (ldd_in_dfq_out),
2423
        .rst    (ldd_vld_reset),        .en     (ldd_vld_en),
2424
        .clk  (clk),
2425
        .se     (1'b0),       .si (),          .so ()
2426
        );
2427
 
2428
 
2429
wire lsu_ignore_fill;
2430
//dfq_ld_vld is redundant   
2431
assign lsu_ignore_fill = dfq_ld_vld & lmq_ldd_vld & ~ldd_in_dfq_out & dcfill_active_e ;
2432
 
2433
 
2434
dff #(5)   dfq_rd_m (
2435
        .din    (ifu_lsu_rd_e[4:0]), .q  (ld_l1hit_rd_m[4:0]),
2436
        .clk  (clk),
2437
        .se     (1'b0),       .si (),          .so ()
2438
        );
2439
 
2440
//dff #(5)   dfq_rd_g (
2441
//        .din    (ld_l1hit_rd_m[4:0]), .q  (ld_l1hit_rd_g[4:0]),
2442
//        .clk  (clk),
2443
//        .se     (1'b0),       .si (),          .so ()
2444
//        ); 
2445
 
2446
 
2447
dff #(1)   stgd1_lrd (
2448
        .din    (ldd_in_dfq_out),
2449
  .q    (ldd_in_dfq_out_d1),
2450
        .clk  (clk),
2451
        .se     (1'b0),       .si (),          .so ()
2452
        );
2453
 
2454
//dff #(1)   stgd2_lrd (
2455
//        .din    (ldd_in_dfq_out_d1), 
2456
//  .q    (ldd_in_dfq_out_d2),
2457
//        .clk  (clk),
2458
//        .se     (1'b0),       .si (),          .so ()
2459
//        ); 
2460
 
2461
 
2462
//wire [4:0] lmq_ld_rd1_g;   
2463
//dff #(5) ff_lmq_ld_rd1 (
2464
//        .din  (lmq_ld_rd1[4:0]), 
2465
//        .q    (lmq_ld_rd1_g[4:0]),
2466
//        .clk  (clk),
2467
//        .se   (1'b0),       .si (),          .so ()
2468
//        ); 
2469
 
2470
 
2471
// Stage l2fill vld
2472
//wire  l2fill_vld_m, l2fill_vld_g ;
2473
wire    l2fill_vld_e,l2fill_vld_m ;
2474
dff     l2fv_stgm (
2475
        .din  (l2fill_vld_e),
2476
        .q    (l2fill_vld_m),
2477
        .clk  (clk),
2478
        .se   (1'b0),       .si (),          .so ()
2479
        );
2480
 
2481
//dff           l2fv_stgg (
2482
//        .din  (l2fill_vld_m), 
2483
//      .q    (l2fill_vld_g),
2484
//        .clk  (clk),
2485
//        .se   (1'b0),       .si (),          .so ()
2486
//        ); 
2487
 
2488
wire    ld_inst_vld_m ;
2489
dff     lvld_stgm (
2490
        .din  (ld_inst_vld_e),
2491
        .q    (ld_inst_vld_m),
2492
        .clk  (clk),
2493
        .se   (1'b0),       .si (),          .so ()
2494
        );
2495
 
2496
//wire  ld_inst_vld_g ;
2497
//dff           lvld_stgg (
2498
//        .din  (ld_inst_vld_m), 
2499
//      .q    (ld_inst_vld_g),
2500
//        .clk  (clk),
2501
//        .se   (1'b0),       .si (),          .so ()
2502
//        ); 
2503
 
2504
wire    ldd_in_dfq_out_vld ;
2505
assign  ldd_in_dfq_out_vld = ldd_in_dfq_out_d1 & l2fill_vld_m ;
2506
assign lsu_exu_rd_m[4:0] =
2507
  ld_inst_vld_m ? ld_l1hit_rd_m[4:0] :
2508
                ldd_in_dfq_out_vld ?  {lmq_ld_rd1[4:1],~lmq_ld_rd1[0]}
2509
                                                : lmq_ld_rd1[4:0];
2510
/*wire  ldd_in_dfq_out_vld ;
2511
assign  ldd_in_dfq_out_vld = ldd_in_dfq_out_d2 & l2fill_vld_g ;
2512
assign lsu_exu_rd_w2[4:0] =
2513
  ld_inst_vld_g ? ld_l1hit_rd_g[4:0] :
2514
                ldd_in_dfq_out_vld ?  {lmq_ld_rd1_g[4:1],~lmq_ld_rd1_g[0]}
2515
                                                : lmq_ld_rd1_g[4:0];*/
2516
 
2517
 
2518
// Generate data select for 128b. ldd will cause hi-order 8B followed by low order
2519
// 8B to be selected.
2520
 
2521
// ldd will select from same 64b dw.
2522
assign  lsu_dfill_data_sel_hi = ~lmq_ld_addr_b3 ^ (ldd_in_dfq_out & ~ldd_non_alt_space) ;
2523
 
2524
// ldd non-alternate space. sz distinguishes between quad, fp ldd and int ldd.
2525
// quad ldd, fp ldd sz = 2'b11, int ldd sz = 2'b10   
2526
assign  ldd_non_alt_space = lsu_byp_misc_sz_e[1] & ~lsu_byp_misc_sz_e[0] ;
2527
 
2528
assign  ldd_oddrd_e = ldd_in_dfq_out & ldd_non_alt_space ;
2529
 
2530
dff   ldd_stgm (
2531
        .din    (ldd_oddrd_e),
2532
  .q    (lsu_byp_ldd_oddrd_m),
2533
        .clk  (clk),
2534
        .se     (1'b0),       .si (),          .so ()
2535
        );
2536
 
2537
// all incoming ld and inv packets must be written to dfq or its bypass flop.
2538
// wrt ptr must be updated in cycle that cpx pkt is sent.
2539
 
2540
// invalidate does not need bubble, only ld bypass and/or fill.
2541
// fill bypass can only occur if bubble is in pipeline.
2542
 
2543
//------
2544
// strm ack cmplt - needs to be visible in dcache
2545
//------
2546
 
2547
//bug4460 - qualify stream store ack w/ local packet
2548
//Bug4969
2549
wire    dfq_local_pkt ;
2550
wire    strmack_cmplt1, strmack_cmplt2, strmack_cmplt3 ;
2551
wire    strmack_cmplt1_d1, strmack_cmplt2_d1, strmack_cmplt3_d1 ;
2552
//wire  strm_ack_cmplt ;
2553
assign  strmack_cmplt1 =
2554
        // check inflight, no inv. if inv, write to dfq_byp.
2555
        (cpx_strm_st_ack_type & ~(dfq_wr_en | lsu_cpx_spc_inv_vld) &
2556
         (const_cpuid[2:0] == cpx_spc_data_cx_b120to118[120:118])) ;
2557
assign  strmack_cmplt2 =
2558
        // check dfq-rd - no inv, gets dropped.
2559
        (lsu_dfq_byp_type[1] & dfq_rd_advance & ~lsu_dfq_byp_cpx_inv & local_pkt) ;
2560
assign  strmack_cmplt3 =
2561
        // check dfq-rd - inv, and thus process from dfq_bypass.
2562
        (lsu_cpx_pkt_strm_ack & inv_active_e & dfq_inv_vld & dfq_local_pkt) ;
2563
 
2564
/*assign        strm_ack_cmplt =
2565
        // check inflight, no inv. if inv, write to dfq_byp.
2566
        (cpx_strm_st_ack_type & ~(dfq_wr_en | lsu_cpx_spc_inv_vld) &
2567
         (const_cpuid[2:0] == cpx_spc_data_cx_b120to118[`CPX_INV_CID_HI:`CPX_INV_CID_LO])) |
2568
        // check dfq-rd - no inv, gets dropped.
2569
        (lsu_dfq_byp_type[1] & dfq_rd_advance & ~lsu_dfq_byp_cpx_inv & local_pkt) |
2570
        // check dfq-rd - inv, and thus process from dfq_bypass.
2571
        (lsu_cpx_pkt_strm_ack & inv_active_e & dfq_inv_vld & dfq_local_pkt) ;*/
2572
 
2573
dff #(3)   strmackcnt_stg (
2574
        .din    ({strmack_cmplt3,strmack_cmplt2,strmack_cmplt1}),
2575
        .q      ({strmack_cmplt3_d1,strmack_cmplt2_d1,strmack_cmplt1_d1}),
2576
        .clk    (clk),
2577
        .se     (1'b0),       .si (),          .so ()
2578
        );
2579
 
2580
assign  lsu_spu_strm_ack_cmplt[0] =      // lsb  of cnt, 1 or 3.
2581
        (~strmack_cmplt1_d1 & ~strmack_cmplt2_d1 &  strmack_cmplt3_d1) | //001
2582
        (~strmack_cmplt1_d1 &  strmack_cmplt2_d1 & ~strmack_cmplt3_d1) | //010
2583
        ( strmack_cmplt1_d1 &  strmack_cmplt2_d1 &  strmack_cmplt3_d1) | //111
2584
        ( strmack_cmplt1_d1 & ~strmack_cmplt2_d1 & ~strmack_cmplt3_d1) ; //100
2585
 
2586
assign  lsu_spu_strm_ack_cmplt[1] =     // msb  of cnt, 2 or 3.
2587
        (strmack_cmplt1_d1 & strmack_cmplt2_d1) |
2588
        (strmack_cmplt2_d1 & strmack_cmplt3_d1) |
2589
        (strmack_cmplt1_d1 & strmack_cmplt3_d1) ;
2590
 
2591
/*dff   strmack_d1 (
2592
        .din  (strm_ack_cmplt),
2593
        .q    (lsu_spu_strm_ack_cmplt),
2594
        .clk  (clk),
2595
        .se     (1'b0),       .si (),          .so ()
2596
        ); */
2597
 
2598
// Active as soon as it is visible in dfq byp ff.
2599
assign  inv_active_e = dfq_inv_vld ;      // evict/icache/strm-st
2600
//wire  st_atm_err ;
2601
// An atomic st is forced to punch a bubble in the pipe if
2602
// an error is encountered on the load. error en is not checked
2603
// at this point.
2604
/*assign  st_atm_err =
2605
  ((|lsu_cpx_atm_st_err[1:0]) & lsu_cpx_pkt_atm_st_cmplt) ;*/
2606
 
2607
assign  stwr_active_e =
2608
  dfq_st_vld & dfq_local_inv  & ~memref_e &
2609
  ~lsu_cpx_pkt_atm_st_cmplt & ~lsu_cpx_pkt_binit_st ;
2610
// & ~lsu_cpx_pkt_stquad_pkt2 ;  // fix for ifill_pkt_vld -b[130]
2611
//  dfq_st_vld & local_inv & ~st_ack_rq_stb_d1 & ~memref_e & //st ack timing fix
2612
//  ~lsu_cpx_pkt_stquad_pkt2 // bug 2942
2613
 
2614
assign  stdq_active_e =
2615
  dfq_st_vld &
2616
  //((~dfq_local_inv & (~st_atm_err | (st_atm_err & ~memref_e))) | //Bug 3624
2617
  ((~dfq_local_inv) |
2618
   (dfq_local_inv & ~memref_e)) ;
2619
//  ((~local_inv & (~st_atm_err | (st_atm_err & ~memref_e))) | 
2620
//   (local_inv & (~st_ack_rq_stb_d1 & ~memref_e))) ;
2621
 
2622
 
2623
assign  dfq_st_cmplt = stdq_active_e | (inv_active_e & dfq_st_vld) ;
2624
 
2625
wire    atm_st_cmplt ;
2626
assign  atm_st_cmplt = dfq_st_cmplt & lsu_cpx_pkt_atm_st_cmplt ;
2627
assign  lsu_atm_st_cmplt_e = atm_st_cmplt ;
2628
 
2629
assign  dcfill_active_e = dfq_ld_vld & ~memref_e ;
2630
 
2631
//bug3753 - qualify ld*_fill_reset w/ dcfill_active & ~ignore_fill
2632
//          in qctl1 this is qual'ed w/ dfq_ld_vld
2633
assign  lsu_dcfill_active_e  =  dcfill_active_e & ~lsu_ignore_fill;
2634
//assign  lsu_dcfill_active_e  =  dcfill_active_e;
2635
 
2636
assign  dva_svld_e =
2637
  inv_active_e |      // evict/icache/strm-st
2638
  (dfq_st_vld & lsu_cpx_pkt_perror_dinv) |      // dtag parity error invalidation.
2639
  (dfq_local_inv & dfq_st_vld & // local st - atomic
2640
  lsu_cpx_pkt_atomic ) ;
2641
  //lsu_cpx_pkt_atomic & ~lsu_cpx_pkt_stquad_pkt2) ; // store quad pkt not present - cmp1_regr fail
2642
  //(local_inv & dfq_st_vld & // local st - stquad/atomic
2643
assign  l2fill_vld_e  = dcfill_active_e &
2644
                        ~lsu_cpx_pkt_prefetch ; // prefetch will not fill
2645
 
2646
assign  lsu_l2fill_vld = dcfill_active_e ;
2647
 
2648
//=================================================================================================
2649
//  DFQ RD/WR CONTROL
2650
//=================================================================================================
2651
 
2652
//assign  cpx_inv =
2653
//  lsu_cpu_inv_data[`CPX_AX0_INV_DVLD]   |   // line 0
2654
//  lsu_cpu_inv_data[`CPX_AX1_INV_DVLD+4] |   // line 1
2655
//  lsu_cpu_inv_data[`CPX_AX0_INV_DVLD+7] |   // line 2
2656
//  lsu_cpu_inv_data[`CPX_AX1_INV_DVLD+11] ;  // line 3
2657
 
2658
// All invalidates go into byp buffer
2659
assign  dfq_byp_ld_vld = lsu_dfq_byp_type[5] ;
2660
// local store inv path is separate.
2661
assign  dfq_byp_inv_vld =
2662
       (lsu_dfq_byp_type[4] & dfq_invwy_vld)    | // icache x-inv
2663
       (lsu_dfq_byp_type[3]                     | // evict
2664
       (lsu_dfq_byp_type[2] & ~local_pkt)       | // sparc st-ack - non-local
2665
        lsu_dfq_byp_type[1]                     | // strm st-ack
2666
        (lsu_dfq_byp_type[2] & local_pkt & lsu_dfq_byp_binit_st)) &
2667
                                // blk init st invalidates L1
2668
        lsu_dfq_byp_cpx_inv ;         // local invalidate
2669
        //cpx_inv ;         // local invalidate
2670
 
2671
// Local store which writes to cache
2672
//timing fix: 7/14/03 - to improve setup of dfq_st_vld and dfq_ld_vld and move the flop to qdp2 -
2673
//            to eventually improve dcache_fill_data timing
2674
//            add byp mux for cpuid in qctl2
2675
wire  [2:0]  dfq_byp_cpuid ;
2676
assign  dfq_byp_cpuid[2:0]  =  dfq_rd_vld_d1 ? lsu_dfq_rdata_cpuid[2:0] :
2677
                                   cpx_spc_data_cx_b120to118[120:118] ;
2678
 
2679
//assign  local_pkt =  &(const_cpuid[2:0] ~^ lsu_dfq_byp_cpuid[2:0]) ;
2680
assign  local_pkt =  &(const_cpuid[2:0] ~^ dfq_byp_cpuid[2:0]) ;
2681
assign  dfq_rdata_local_pkt =  &(const_cpuid[2:0] ~^ lsu_dfq_rdata_cpuid[2:0]) ;
2682
assign  dfq_byp_st_vld = lsu_dfq_byp_type[2] & local_pkt ;
2683
 
2684
// Add ifill invalidate
2685
// screen cpx data which gets written to dfq
2686
assign  dfq_byp_vld =
2687
(dfq_byp_ld_vld | dfq_byp_inv_vld | dfq_byp_st_vld) &
2688
(dfq_rd_vld_d1 | (~dfq_rd_vld_d1 & ~dfq_wr_en))  ;
2689
 
2690
//assign  lsu_dfq_byp_vld  =  dfq_byp_vld;
2691
 
2692
/*assign dfq_vld_reset =
2693
        reset | ((dcfill_active_e | inv_active_e | stdq_active_e) &
2694
    ~dfq_vld_en & // dside pkt in waiting
2695
    ~lsu_ignore_fill &  // ldd
2696
    ~ld_ignore_sec  // secondary loads
2697
    ) ; */
2698
 
2699
/*wire  ld_sec_rst, ld_sec_rst_d1 ;
2700
assign  ld_sec_rst = dcfill_active_e & ld_ignore_sec_last ;
2701
dff   secl_d1 (
2702
        .din    (ld_sec_rst), .q  (ld_sec_rst_d1),
2703
        .clk  (clk),
2704
        .se     (1'b0),       .si (),          .so ()
2705
        ); */
2706
 
2707
/* phase 2 change
2708
assign dfq_vld_reset =
2709
    // dside pkt in waiting, ldd, secondary loads
2710
        reset | (dcfill_active_e & ~(dfq_vld_en | lsu_ignore_fill | (ld_ignore_sec & ~ld_ignore_sec_last))) |
2711
    // dside pkt in waiting
2712
          ((inv_active_e | stdq_active_e) & ~dfq_vld_en) ;
2713
*/
2714
 
2715
assign dfq_vld_reset =
2716
    // dside pkt in waiting, ldd, no need secondary loads waiting
2717
        reset | (dcfill_active_e & ~(dfq_vld_en | (lsu_ignore_fill & ~lsu_cpx_pkt_prefetch))) |
2718
    // dside pkt in waiting
2719
          ((inv_active_e | stdq_active_e) & ~dfq_vld_en) ;
2720
 
2721
// vld is enabled only if both i and d side buffers are clear
2722
// for co-dependent events. co-dependent events are rare.
2723
wire    dfq_rd_advance_buf1 ;
2724
assign dfq_vld_en = dfq_byp_vld &
2725
                (dfq_rd_advance_buf1 |
2726
                (cpx_spc_data_cx_b144to140[144] & vld_dfq_pkt & ~dfq_wr_en)) ;
2727
 
2728
/* phase 2 change
2729
assign  dfq_byp_ff_en =
2730
  (~dfq_byp_full |
2731
  ( dfq_byp_full & ((dcfill_active_e & ~(lsu_ignore_fill | ld_ignore_sec)) |
2732
       (inv_active_e | stdq_active_e)))) ;
2733
*/
2734
 
2735
assign  dfq_byp_ff_en =
2736
  (~dfq_byp_full |
2737
  ( dfq_byp_full & ((dcfill_active_e & ~lsu_ignore_fill) |
2738
       (inv_active_e | stdq_active_e)))) ;
2739
 
2740
//bug4576: add sehold to the flop enable in qdp2
2741
assign lsu_dfq_byp_ff_en  =  sehold | dfq_byp_ff_en ;
2742
 
2743
   // i.e., byp currently filling.
2744
 
2745
/*
2746
assign  dfq_byp_ff_en =
2747
  (~dfq_byp_full |
2748
  (dfq_byp_full & (dcfill_active_e | inv_active_e | stdq_active_e) & ~(lsu_ignore_fill | ld_ignore_sec))) ;
2749
  // i.e., byp currently filling.
2750
*/
2751
 
2752
// dfq bypass valid
2753
//timing fix: 6/6/03: add duplicate flop for dfq_byp_ld_vld and dfq_byp_st_vld
2754
//timing fix: 10/3/03 - add separate flop for lsu_dfq_vld lsu_dfq_st_vld to dctl
2755
//bug4460:  qualify stream store ack w/ local packet - add local pkt flop
2756
dffre  #(10) dfq_vld (
2757
        .din({local_pkt,dfq_byp_st_vld,dfq_byp_vld,dfq_byp_vld,
2758
              dfq_byp_ld_vld,dfq_byp_inv_vld,dfq_byp_st_vld,
2759
              lsu_dfq_byp_cpx_inv,dfq_byp_ld_vld,dfq_byp_st_vld}),
2760
        .q  ({dfq_local_pkt,lsu_dfq_st_vld,lsu_dfq_vld,dfq_byp_full,
2761
              dfq_ld_vld,dfq_inv_vld,dfq_st_vld,
2762
              dfq_local_inv,lsu_qdp2_dfq_ld_vld,lsu_qdp2_dfq_st_vld}),
2763
//.din    ({dfq_byp_vld,dfq_byp_ld_vld,dfq_byp_inv_vld,dfq_byp_st_vld,cpx_inv,lsu_dfq_byp_cpx_inv}),
2764
//.q      ({dfq_byp_full,dfq_ld_vld,dfq_inv_vld,dfq_st_vld,local_inv,dfq_local_inv}),
2765
        .rst    (dfq_vld_reset),        .en     (dfq_vld_en),
2766
        .clk    (clk),
2767
        .se     (1'b0),       .si (),          .so ()
2768
        );
2769
 
2770
//bug4057: kill diagnostic write if dfq has valid requests to l1d$
2771
//timing fix: 10/3/03 - add separate flop for lsu_dfq_vld
2772
//assign  lsu_dfq_vld  =  dfq_byp_full ;
2773
 
2774
assign  lsu_dfq_ld_vld  =  dfq_ld_vld;
2775
//timing fix: 9/29/03 - instantiate buffer for dfq_st_vld to dctl
2776
//timing fix: 10/3/03 - remove buffer and add separate flop
2777
//assign  lsu_dfq_st_vld  =  dfq_st_vld;
2778
//bw_u1_buf_30x UZsize_lsu_dfq_st_vld_buf1 ( .a(dfq_st_vld), .z(lsu_dfq_st_vld) );
2779
assign  lsu_dfq_ldst_vld  =  lsu_qdp2_dfq_ld_vld | lsu_qdp2_dfq_st_vld;
2780
 
2781
 
2782
// Flop invalidate bits
2783
dffe  #(12) dfq_inv (
2784
        .din    ({lsu_cpu_inv_data_b13to9,lsu_cpu_inv_data_b7to2,lsu_cpu_inv_data_b0}),
2785
        .q    ({dfq_inv_data_b13to9,dfq_inv_data_b7to2,dfq_inv_data_b0}),
2786
        //.din    (lsu_cpu_inv_data[13:0]),
2787
        //.q      (dfq_inv_data[13:0]),
2788
        .en     (dfq_vld_en),
2789
        .clk    (clk),
2790
        .se     (1'b0),       .si (),          .so ()
2791
        );
2792
 
2793
 
2794
/*
2795
assign  lsu_st_ack_addr_b54[0] = dfq_inv_data[4] | dfq_inv_data[11] ;
2796
assign  lsu_st_ack_addr_b54[1] = dfq_inv_data[7] | dfq_inv_data[11] ;
2797
 
2798
 
2799
assign  st_wrwy_sel[0] = ~lsu_st_ack_addr_b54[1] & ~lsu_st_ack_addr_b54[0] ;
2800
assign  st_wrwy_sel[1] = ~lsu_st_ack_addr_b54[1] &  lsu_st_ack_addr_b54[0] ;
2801
assign  st_wrwy_sel[2] =  lsu_st_ack_addr_b54[1] & ~lsu_st_ack_addr_b54[0] ;
2802
assign  st_wrwy_sel[3] =  lsu_st_ack_addr_b54[1] &  lsu_st_ack_addr_b54[0] ;
2803
 
2804
assign  lsu_st_ack_wrwy[1:0]   =
2805
st_wrwy_sel[0] ? dfq_inv_data[`CPX_AX0_INV_WY_HI:`CPX_AX0_INV_WY_LO] :
2806
  st_wrwy_sel[1] ? dfq_inv_data[`CPX_AX1_INV_WY_HI+4:`CPX_AX1_INV_WY_LO+4] :
2807
    st_wrwy_sel[2] ? dfq_inv_data[`CPX_AX0_INV_WY_HI+7:`CPX_AX0_INV_WY_LO+7] :
2808
      st_wrwy_sel[3] ? dfq_inv_data[`CPX_AX1_INV_WY_HI+11:`CPX_AX1_INV_WY_LO+11] :
2809
            2'bxx ;
2810
*/
2811
 
2812
// cpx invalidate data obtained via the cfq.
2813
// b[8[ and b[1] are unused
2814
//8/28/03: vlint cleanup - remove cpx_cpu_inv_data and use dfq_inv_data directly
2815
//assign  cpx_cpu_inv_data[13:0] =  {dfq_inv_data_b13to9,1'b0,dfq_inv_data_b7to2,1'b0,dfq_inv_data_b0} ;
2816
//assign  cpx_cpu_inv_data[13:0] =  dfq_inv_data[13:0] ;
2817
 
2818
// write control set up.   
2819
// All cpx pkts are written.
2820
// - unwanted pkts are explicity overwritten by next incoming pkt.
2821
 
2822
   /*wire stb_cam_hit_w2;
2823
 
2824
dff #(1)  stb_cam_hit_stg_w2  (
2825
  .din (stb_cam_hit),
2826
  .q   (stb_cam_hit_w2),
2827
  .clk (clk),
2828
  .se  (1'b0), .si (), .so ()
2829
  ); */
2830
 
2831
// Need to include error pkt !!
2832
//8/25/03: add error type to dfq_wr_en, dfq_rd_advance
2833
//8/25/03: add fwd req to L1I$ for RAMTEST to dfq_wr_en, dfq_rd_dvance
2834
assign  vld_dfq_pkt =
2835
cpx_int_type | cpx_ld_type | cpx_ifill_type | cpx_evict_type | cpx_st_ack_type | cpx_strm_st_ack_type | cpx_error_type | cpx_fwd_req_ic ;
2836
 
2837
//NOTE: restore cpx_inv qualification after adding cpx_inv part of dfq read - done
2838
 
2839
assign  dfq_wr_en =
2840
  // local st wr which writes to cache is put in dfq if cam-hit occurs.
2841
  //(cpx_local_st_ack_type & stb_cam_hit_w2 & cpx_inv) |
2842
  //(cpx_local_st_ack_type & stb_cam_hit_w2 & lsu_dfq_byp_cpx_inv) |
2843
  //(cpx_local_st_ack_type) |  //bug2623
2844
  (cpx_st_ack_type) |
2845
  // always write under these conditions
2846
  //(vld_dfq_pkt & (dfq_vld_entry_exists | dfq_rptr_vld_d1)) | 
2847
  (vld_dfq_pkt & (dfq_vld_entry_exists_w | dfq_rptr_vld_d1)) |
2848
  //(cpx_spc_data_cx_b144to140[`CPX_VLD] & (dfq_vld_entry_exists | dfq_rptr_vld_d1)) | 
2849
  // interrupts always write to queue
2850
    cpx_int_type |
2851
  // error type or forward request to l1i$ - bypass
2852
   ((cpx_error_type | cpx_fwd_req_ic) & ifu_lsu_ibuf_busy)  |
2853
  // selectively write under these conditions
2854
   ((cpx_ld_type & ~dfq_byp_ff_en)          |
2855
    (cpx_ld_type &  cpx_spc_data_cx_b133 & ifu_lsu_ibuf_busy)  |
2856
    (cpx_ifill_type & ifu_lsu_ibuf_busy)          |
2857
    (cpx_ifill_type & cpx_spc_data_cx_b133 & ~dfq_byp_ff_en) |
2858
    // the evictions/acks will wr to the dfq if any buffer is full
2859
    ((cpx_evict_type | cpx_st_ack_type | cpx_strm_st_ack_type) & (ifu_lsu_ibuf_busy | ~dfq_byp_ff_en))) ;
2860
 
2861
assign  dfq_wptr_new_w_wrap[5:0]  = dfq_wptr_w_wrap[5:0] + {5'b00000, dfq_wr_en} ;
2862
//assign  dfq_wptr_vld = dfq_wr_en ;
2863
// every pkt is to be written to dfq. The pkt may be rejected by not updating
2864
// write ptr based on certain conditions.
2865
assign  dfq_wptr_vld = cpx_spc_data_cx_b144to140[144] ;
2866
 
2867
dffre  #(6) dfq_wptr_ff (
2868
        .din    (dfq_wptr_new_w_wrap[5:0]), .q  (dfq_wptr_w_wrap[5:0]),
2869
        .rst    (reset), .en (dfq_wr_en), .clk (clk),
2870
        .se     (1'b0),       .si (),          .so ()
2871
        );
2872
 
2873
//1/20/04: mintime fix - add minbuf to dfq_wptr
2874
//assign  dfq_wptr[4:0] = dfq_wptr_w_wrap[4:0] ;
2875
 
2876
wire  [4:0]  dfq_wptr_minbuf ;
2877
bw_u1_minbuf_5x UZfix_dfq_wptr_b0_minbuf (.a(dfq_wptr_w_wrap[0]), .z(dfq_wptr_minbuf[0]));
2878
bw_u1_minbuf_5x UZfix_dfq_wptr_b1_minbuf (.a(dfq_wptr_w_wrap[1]), .z(dfq_wptr_minbuf[1]));
2879
bw_u1_minbuf_5x UZfix_dfq_wptr_b2_minbuf (.a(dfq_wptr_w_wrap[2]), .z(dfq_wptr_minbuf[2]));
2880
bw_u1_minbuf_5x UZfix_dfq_wptr_b3_minbuf (.a(dfq_wptr_w_wrap[3]), .z(dfq_wptr_minbuf[3]));
2881
bw_u1_minbuf_5x UZfix_dfq_wptr_b4_minbuf (.a(dfq_wptr_w_wrap[4]), .z(dfq_wptr_minbuf[4]));
2882
 
2883
bw_u1_buf_10x UZsize_dfq_wptr_b0_buf2 ( .a(dfq_wptr_minbuf[0]), .z(dfq_wptr[0]) );
2884
bw_u1_buf_10x UZsize_dfq_wptr_b1_buf2 ( .a(dfq_wptr_minbuf[1]), .z(dfq_wptr[1]) );
2885
bw_u1_buf_10x UZsize_dfq_wptr_b2_buf2 ( .a(dfq_wptr_minbuf[2]), .z(dfq_wptr[2]) );
2886
bw_u1_buf_10x UZsize_dfq_wptr_b3_buf2 ( .a(dfq_wptr_minbuf[3]), .z(dfq_wptr[3]) );
2887
bw_u1_buf_10x UZsize_dfq_wptr_b4_buf2 ( .a(dfq_wptr_minbuf[4]), .z(dfq_wptr[4]) );
2888
 
2889
// Bit3 of both pointers is a wrap bit. Including this in the compare
2890
// will tell us whether the queue is empty or not. It is assumed that
2891
// the wptr will never runover the rptr because of flow control.
2892
// This will have to be fine-tuned once dfq is accurate !!!
2893
assign  dfq_vld_entry_exists = (dfq_rptr_new_w_wrap[5:0] != dfq_wptr_w_wrap[5:0]) ;
2894
 
2895
assign  dfq_vld_entry_exists_w = (dfq_rptr_w_wrap[5:0] != dfq_wptr_w_wrap[5:0]) ;
2896
 
2897
// dfq is read iff bypass flop is empty and valid entry in dfq available. 
2898
// i.e., we need to initialize bypass ff such that it always contains
2899
// latest entry.
2900
//  (dfq_rptr_vld_d1 & (~i_and_d_codepend | (i_and_d_codepend & dfq_rd_advance))) |
2901
 
2902
//assign  lsu_ifill_pkt_vld =   
2903
//  (dfq_rptr_vld_d1 & ~(dfq_st_ack_type & lsu_dfq_byp_stack_dcfill_vld) & (~i_and_d_codepend | (i_and_d_codepend & dfq_byp_ff_en))) |
2904
//        (cpx_spc_data_cx[`CPX_VLD] & ~dfq_wr_en) ;
2905
//
2906
//  (dfq_rptr_vld_d1 & ~(dfq_st_ack_type & lsu_dfq_byp_stack_dcfill_vld) & ~ifill_pkt_fwd_done_d1) |
2907
//
2908
//  (dfq_rptr_vld_d1 & ~(lsu_dfq_rdata_st_ack_type & lsu_dfq_rdata_stack_dcfill_vld) & ~ifill_pkt_fwd_done_d1) | // bug:2767
2909
//  change lsu_dfq_rdata_stack_dcfill_vld from b[87] to b[151] in the top level 
2910
//
2911
//timing fix: 6/16/03 - fix for ifill_pkt_vld - use b130 if store_ack_dcfill_vld=1
2912
//            change lsu_dfq_rdata_stack_dcfill_vld from b[151] to b[130] in the top level 
2913
//  (dfq_rptr_vld_d1 & ~(lsu_dfq_rdata_st_ack_type & dfq_rdata_local_pkt & lsu_dfq_rdata_stack_dcfill_vld) & ~ifill_pkt_fwd_done_d1) |
2914
//
2915
//bug3657 - kill ifill vld in bypass path when cpxtype=fp/fwd_reply
2916
//NOTE: stream loads should also be included
2917
//bug5080 - kill ifill vld in bypass path when cpxtype=strm load - similar to bug3657
2918
//          kill bypass when dfq_rptr_vld_d1=1
2919
//  (cpx_spc_data_cx_b144to140[`CPX_VLD] & ~(dfq_wr_en | cpx_fwd_rply_type | cpx_fp_type)) ;
2920
//
2921
//bug6372: ifill dcache x-inv causes incorrect dcache index to be invalidated.
2922
//         - this occurs 'cos the imiss index gets overwritten by another imiss to the same thread.
2923
//           the dcache x-inv(head of dfq) is stalled in dfq 'cos of load in bypass flop being stalled by memref_e=1
2924
//           but the ifill pkt vld is set to 1 and ifu starts issuing the next imiss for same thread
2925
//         
2926
//  (dfq_rptr_vld_d1 & ~(lsu_dfq_rdata_st_ack_type & lsu_dfq_rdata_stack_dcfill_vld) & ~ifill_pkt_fwd_done_d1) |
2927
 
2928
wire   ifill_pkt_fwd_done,ifill_pkt_fwd_done_d1;
2929
wire   ifill_dinv_head_of_dfq_pend ;
2930
 
2931
 
2932
assign  ifill_dinv_head_of_dfq_pend  =  lsu_dfq_rdata_type[4] & lsu_dfq_rdata_invwy_vld & ~dfq_byp_ff_en ;
2933
 
2934
assign  lsu_ifill_pkt_vld =
2935
  (dfq_rptr_vld_d1 & ~(lsu_dfq_rdata_st_ack_type & lsu_dfq_rdata_stack_dcfill_vld) &
2936
                     ~ifill_dinv_head_of_dfq_pend &
2937
                     ~ifill_pkt_fwd_done_d1 ) |
2938
  (~dfq_rptr_vld_d1 & cpx_spc_data_cx_b144to140[144] & ~(dfq_wr_en | cpx_fwd_rply_type | cpx_fp_type)) ;
2939
 
2940
// this signal acts as a mask i.e. fill valid will be asserted until the ifu_lsu_ibuf_busy=0. But certain packets need
2941
// both busy=0 and memref_e=0 - in which case it is safer to mask until the dfq_rd_advance=1.
2942
 
2943
//bug5309: add reset to the flop; x's get recycled from flop o/p until a dfq_rd_advance occurs i.e. flop reset
2944
//         after first ifill; failed in cmp1.92 cmp8 regression w/ vcs7.1
2945
 
2946
assign  ifill_pkt_fwd_done  =  ~reset &
2947
                               (((dfq_rptr_vld_d1 & ~ifu_lsu_ibuf_busy & ~ifill_dinv_head_of_dfq_pend) |
2948
                                ifill_pkt_fwd_done_d1)   // set|hold
2949
                                & ~dfq_rd_advance);                                               // reset
2950
 
2951
dff  #(1) ifill_pkt_fwd_done_ff (
2952
        .din    (ifill_pkt_fwd_done),
2953
        .q      (ifill_pkt_fwd_done_d1),
2954
        .clk    (clk),
2955
        .se     (1'b0),       .si (),          .so ()
2956
        );
2957
 
2958
 
2959
 
2960
// Note that this becomes valid in cycle of read. Flush will be continuously read
2961
// out of dfq until all intermmediate buffers are clear.
2962
 
2963
// timing fix: 06/04/03: dfq_rd_advance uses byp_mux output; instead use dfq read output
2964
//             i.e. dfq_rd_advance is valid only when there is a valid entry in dfq
2965
//             it is already qual'ed w/ dfq_rd_vld_d1 to determine this.
2966
 
2967
//assign  dfq_ld_type     = lsu_dfq_byp_type[5] ;
2968
//assign  dfq_ifill_type    = lsu_dfq_byp_type[4] ;
2969
//assign  dfq_evict_type    = lsu_dfq_byp_type[3] ;
2970
//assign  dfq_st_ack_type   = lsu_dfq_byp_type[2] ;
2971
//assign  dfq_strm_st_ack_type  = lsu_dfq_byp_type[1] ;
2972
//assign  dfq_int_type    = lsu_dfq_byp_type[0] ;
2973
 
2974
assign  dfq_ld_type     = lsu_dfq_rdata_type[5] ;
2975
assign  dfq_ifill_type    = lsu_dfq_rdata_type[4] ;
2976
assign  dfq_evict_type    = lsu_dfq_rdata_type[3] ;
2977
assign  dfq_st_ack_type   = lsu_dfq_rdata_type[2] ;
2978
assign  dfq_strm_st_ack_type  = lsu_dfq_rdata_type[1] ;
2979
assign  dfq_int_type    = lsu_dfq_rdata_type[0] ;
2980
 
2981
//8/25/03: add error type to dfq_wr_en, dfq_rd_advance
2982
assign  dfq_error_type    = (lsu_dfq_rdata_rq_type[3:0]==4'b1100) ;
2983
//8/25/03: add fwd req to L1I$ for RAMTEST to dfq_wr_en, dfq_rd_dvance
2984
assign  dfq_fwd_req_ic_type  = (lsu_dfq_rdata_rq_type[3:0]==4'b1010) & lsu_dfq_rdata_b103;
2985
 
2986
assign  dfq_invwy_vld     = lsu_dfq_byp_invwy_vld ;
2987
 
2988
// if the there is a co-dependent event, then the ifu will not
2989
// be signalled vld until rd_advance is asserted.
2990
//assign  i_and_d_codepend = 
2991
//    ((dfq_ld_type | dfq_ifill_type) &  dfq_invwy_vld)   |
2992
//    (dfq_evict_type | dfq_st_ack_type | dfq_strm_st_ack_type) |
2993
//    dfq_int_type ;
2994
 
2995
//NOTE: restore cpx_inv qualification after adding cpx_inv part of dfq read - done
2996
//assign  st_rd_advance  =  dfq_byp_st_vld & (~lsu_dfq_byp_cpx_inv | (lsu_dfq_byp_cpx_inv & ~stb_cam_hit_w2)) & dfq_byp_ff_en;
2997
//assign  st_rd_advance  =  dfq_byp_st_vld & dfq_byp_ff_en; // bug:2770
2998
//                          (dfq_byp_st_vld &  lsu_dfq_rdata_stack_iinv_vld & ~ifu_lsu_ibuf_busy) ; // bug:2775
2999
 
3000
// timing fix: 06/04/03: dfq_rd_advance uses byp_mux output; instead use dfq read output
3001
//             i.e. dfq_rd_advance is valid only when there is a valid entry in dfq
3002
//             it is already qual'ed w/ dfq_rd_vld_d1 to determine this.
3003
 
3004
 
3005
assign  st_rd_advance  =
3006
        (dfq_st_ack_type & dfq_rdata_local_pkt & ~lsu_dfq_rdata_stack_iinv_vld & dfq_byp_ff_en) |
3007
        (dfq_st_ack_type & dfq_rdata_local_pkt &  lsu_dfq_rdata_stack_iinv_vld & ~ifu_lsu_ibuf_busy & dfq_byp_ff_en) ;
3008
 
3009
// The pointer is advanced based on pre-flop bypass data.
3010
 
3011
wire inv_clear_d1 ;
3012
dff  #(1) invclr_d1 (
3013
        .din    (ifu_lsu_inv_clear),
3014
        .q      (inv_clear_d1),
3015
        .clk    (clk),
3016
        .se     (1'b0),       .si (),          .so ()
3017
        );
3018
 
3019
//---
3020
// Dealing with skid involving invalidate clear.
3021
// 1. No stall asserted. If the int is immed. preceeded by an inv,
3022
// then the the inv will not be visible thru inv_clear. For this
3023
// reason, int will always wait an additional cycle before examining
3024
// inv_clear.
3025
// 2. In case int has been dispatched to the ifu with stall asserted,
3026
// stalls are conditionally inserted. 
3027
// Note : interrupts are always written into dfq.
3028
//---
3029
 
3030
wire    dfq_rd_advance_d1 ;
3031
dff   rda_d1 (
3032
        .din    (dfq_rd_advance),
3033
        .q      (dfq_rd_advance_d1),
3034
        .clk    (clk),
3035
        .se     (1'b0),       .si (),          .so ()
3036
        );
3037
 
3038
 
3039
// Begin Bug 5583
3040
wire    dfq_int_type_d1 ;
3041
wire    int_skid_c1,int_skid_c2;
3042
wire    int_skid_stall ;
3043
dff   itype_d1 (
3044
        .din    (dfq_int_type),
3045
        .q      (dfq_int_type_d1),
3046
        .clk    (clk),
3047
        .se     (1'b0),       .si (),          .so ()
3048
        );
3049
 
3050
// decision made to issue intrpt from dfq even though 
3051
// intr-clear was not high, thus introduce stall for
3052
// 2 more cycles.
3053
assign int_skid_c1 =
3054
        dfq_int_type_d1 & dfq_rd_advance_d1 & ~inv_clear_d1 ;
3055
 
3056
dff   iskid_c2 (
3057
        .din    (int_skid_c1),
3058
        .q      (int_skid_c2),
3059
        .clk    (clk),
3060
        .se     (1'b0),       .si (),          .so ()
3061
        );
3062
 
3063
assign  int_skid_stall = int_skid_c1 | int_skid_c2 ;
3064
 
3065
// End Bug 5583
3066
 
3067
// timing fix: 06/04/03: dfq_rd_advance uses byp_mux output; instead use dfq read output
3068
//             i.e. dfq_rd_advance is valid only when there is a valid entry in dfq
3069
//             it is already qual'ed w/ dfq_rd_vld_d1 to determine this.
3070
//8/25/03: add error type to dfq_wr_en, dfq_rd_advance
3071
//8/25/03: add fwd req to L1I$ for RAMTEST to dfq_wr_en, dfq_rd_dvance
3072
 
3073
assign  dfq_rd_advance   =
3074
  // local st which writes to cache cannot advance if simultaneous cam hit. 
3075
  //((dfq_byp_st_vld & (~cpx_inv | (cpx_inv & ~stb_cam_hit_w2)) & dfq_byp_ff_en)  | 
3076
  (st_rd_advance |
3077
  // advance beyond a dside ld if it can be written to the byp ff
3078
  (dfq_ld_type & ~lsu_dfq_rdata_invwy_vld & dfq_byp_ff_en) |
3079
  // advance beyond a dside & iside ld if it can be written to the byp ff/ibuf clr
3080
  (dfq_ld_type &  lsu_dfq_rdata_invwy_vld & (dfq_byp_ff_en & ~ifu_lsu_ibuf_busy))   |
3081
  // advance beyond a iside ifill if it can be written to the ibuf
3082
  (dfq_ifill_type & ~lsu_dfq_rdata_invwy_vld & ~ifu_lsu_ibuf_busy)      |
3083
  // advance beyond a dside & iside ifill if it can be written to the byp ff/ibuf clr
3084
  (dfq_ifill_type &  lsu_dfq_rdata_invwy_vld & (dfq_byp_ff_en & ~ifu_lsu_ibuf_busy))  |
3085
  // any form of invalidate could invalidate both i and dside.
3086
  ((dfq_evict_type | (dfq_st_ack_type & ~dfq_rdata_local_pkt) | dfq_strm_st_ack_type) &
3087
        (dfq_byp_ff_en & ~ifu_lsu_ibuf_busy)) |
3088
  // interrupts and flushes have to ensure invalidates are visible in caches.
3089
  // interrupts do not enter d-side byp buffer.  flush needs to look at inv clear.
3090
  (dfq_int_type & (dfq_byp_ff_en & ~ifu_lsu_ibuf_busy & ((inv_clear_d1 & ~dfq_rd_advance_d1) | dfq_stall_d1))) | // Bug 3820.
3091
  //(dfq_int_type & (dfq_byp_ff_en & ~ifu_lsu_ibuf_busy & ((inv_clear_d1 & ~dfq_rd_advance_d1) | dfq_stall_d2))) | // Bug 3820.
3092
  ((dfq_error_type | dfq_fwd_req_ic_type) & ~ifu_lsu_ibuf_busy))
3093
    & dfq_rptr_vld_d1 & ~reset ;
3094
 
3095
//timing fix: 9/16/03 - dfq_rd_advance is late signal; use it as mux select to pick the correct read pointer
3096
//            add duplicate signal for dfq_rd_advance - has FO16 - adds 3inv to this path
3097
//            fix for dfq_read -> dfq_rd_advance -> dfq_rptr to dfq
3098
wire   dfq_rd_advance_dup ;
3099
assign dfq_rd_advance_dup =  dfq_rd_advance ;
3100
 
3101
//timing fix: 9/29/03 - instantiate buffer for dfq_rd_advance to dfq_vld_en
3102
bw_u1_buf_30x UZsize_dfq_rd_advance_buf1 ( .a(dfq_rd_advance), .z(dfq_rd_advance_buf1) );
3103
 
3104
wire    local_flush ;
3105
assign  local_flush = lsu_dfq_byp_type[0] & lsu_dfq_byp_flush & local_pkt & dfq_rd_advance ;
3106
 
3107
wire    [3:0]    dfq_flsh_cmplt ;
3108
assign  dfq_flsh_cmplt[0] = local_flush & ~lsu_dfq_byp_tid[1] & ~lsu_dfq_byp_tid[0] ;
3109
assign  dfq_flsh_cmplt[1] = local_flush & ~lsu_dfq_byp_tid[1] &  lsu_dfq_byp_tid[0] ;
3110
assign  dfq_flsh_cmplt[2] = local_flush &  lsu_dfq_byp_tid[1] & ~lsu_dfq_byp_tid[0] ;
3111
assign  dfq_flsh_cmplt[3] = local_flush &  lsu_dfq_byp_tid[1] &  lsu_dfq_byp_tid[0] ;
3112
 
3113
dff  #(4) flshcmplt (
3114
        .din    (dfq_flsh_cmplt[3:0]),
3115
        .q      (lsu_dfq_flsh_cmplt[3:0]),
3116
        .clk    (clk),
3117
        .se     (1'b0),       .si (),          .so ()
3118
        );
3119
 
3120
 
3121
// Check for extra bubbles in pipeline.
3122
//timing fix: 10/3/03 - use dfq_rd_advance as mux select
3123
//assign  dfq_rptr_new_w_wrap[5:0] =  dfq_rptr_w_wrap[5:0] + {5'b00000, dfq_rd_advance} ;
3124
wire  [5:0]  dfq_rptr_new_w_wrap_inc ;
3125
assign  dfq_rptr_new_w_wrap_inc[5:0] =  dfq_rptr_w_wrap[5:0] + 6'b000001 ;
3126
assign  dfq_rptr_new_w_wrap[5:0]  =  dfq_rd_advance ? dfq_rptr_new_w_wrap_inc[5:0] : dfq_rptr_w_wrap[5:0] ;
3127
 
3128
// The dfq will always read as long as there is a valid entry.
3129
// ** Design note : If dfq output is held at latches, this is not longer required !! **
3130
//assign  dfq_rptr_vld  =   dfq_vld_entry_exists ;
3131
assign  dfq_rptr_vld  =   dfq_vld_entry_exists_w ;
3132
 
3133
wire   dfq_rptr_vld_w_d1;
3134
 
3135
 
3136
dff   rvld_stgd1_new (
3137
        .din    (dfq_vld_entry_exists), .q  (dfq_vld_entry_exists_d1),
3138
        .clk  (clk),
3139
        .se     (1'b0),       .si (),          .so ()
3140
        );
3141
dff   rvld_stgd1 (
3142
        .din    (dfq_rptr_vld), .q  (dfq_rptr_vld_w_d1),
3143
        //.din    (dfq_rptr_vld), .q  (dfq_rptr_vld_d1),
3144
        .clk  (clk),
3145
        .se     (1'b0),       .si (),          .so ()
3146
        );
3147
//dff   rdad_stgd1 (
3148
//        .din    (dfq_rd_advance), .q  (dfq_rd_advance_d1),
3149
//        .clk  (clk),
3150
//        .se     (1'b0),       .si (),          .so ()
3151
//        ); 
3152
 
3153
dffre  #(6) dfq_rptr_ff (
3154
        .din    (dfq_rptr_new_w_wrap[5:0]), .q  (dfq_rptr_w_wrap[5:0]),
3155
        .rst    (reset), .en (dfq_rd_advance), .clk (clk),
3156
        .se     (1'b0),       .si (),          .so ()
3157
        );
3158
 
3159
assign  dfq_rptr_vld_d1 = dfq_rptr_vld_w_d1 & dfq_vld_entry_exists_d1;
3160
assign  dfq_rd_vld_d1 = dfq_rptr_vld_d1 ;
3161
//bug4576: add sehold to the dfq_rdata mux select
3162
assign  lsu_dfq_rd_vld_d1 = sehold | dfq_rptr_vld_d1 ;
3163
 
3164
//timing fix: 9/16/03 - dfq_rd_advance is late signal; use it as mux select to pick the correct read pointer
3165
//            add duplicate signal for dfq_rd_advance - has FO16 - adds 3inv to this path
3166
//            fix for dfq_read -> dfq_rd_advance -> dfq_rptr to dfq
3167
//assign  dfq_rptr[4:0] = dfq_rptr_w_wrap[4:0] + {4'b0000, dfq_rd_advance} ;
3168
 
3169
//1/20/04: mintime fix - add minbuf to dfq_rptr_w_wrap in dfq_rptr
3170
wire  [4:0]  dfq_rptr_w_wrap_minbuf ;
3171
 
3172
bw_u1_minbuf_5x UZfix_dfq_rptr_b0 (.a(dfq_rptr_w_wrap[0]), .z(dfq_rptr_w_wrap_minbuf[0]));
3173
bw_u1_minbuf_5x UZfix_dfq_rptr_b1 (.a(dfq_rptr_w_wrap[1]), .z(dfq_rptr_w_wrap_minbuf[1]));
3174
bw_u1_minbuf_5x UZfix_dfq_rptr_b2 (.a(dfq_rptr_w_wrap[2]), .z(dfq_rptr_w_wrap_minbuf[2]));
3175
bw_u1_minbuf_5x UZfix_dfq_rptr_b3 (.a(dfq_rptr_w_wrap[3]), .z(dfq_rptr_w_wrap_minbuf[3]));
3176
bw_u1_minbuf_5x UZfix_dfq_rptr_b4 (.a(dfq_rptr_w_wrap[4]), .z(dfq_rptr_w_wrap_minbuf[4]));
3177
 
3178
wire  [4:0]  dfq_rptr_inc ;
3179
assign dfq_rptr_inc[4:0]  =  dfq_rptr_w_wrap[4:0] + 5'b00001 ;
3180
assign  dfq_rptr[4:0] = dfq_rd_advance_dup ? dfq_rptr_inc[4:0] : dfq_rptr_w_wrap_minbuf[4:0] ;
3181
//assign  dfq_rptr[4:0] = dfq_rd_advance_dup ? dfq_rptr_inc[4:0] : dfq_rptr_w_wrap[4:0] ;
3182
 
3183
// Determine whether cfq has crossed high-water mark. IFU must switchout all threads
3184
// for every cycle that this is valid.
3185
// Need to change wptr size once new cfq array description incorporated.
3186
// Wrap bit may not be needed !!!
3187
wire  [5:0] dfq_vld_entries ;
3188
assign  dfq_vld_entries[5:0] = (dfq_wptr_w_wrap[5:0] - dfq_rptr_w_wrap[5:0]) ;
3189
/*assign  dfq_vld_entries[3:0] =
3190
  (dfq_rptr_w_wrap[4] ^ dfq_wptr_w_wrap[4]) ?
3191
  (dfq_rptr_w_wrap[3:0] - dfq_wptr_w_wrap[3:0]) : (dfq_wptr_w_wrap[3:0] - dfq_rptr_w_wrap[3:0]) ;*/
3192
 
3193
// High water mark conservatively put at 16-4 = 12
3194
assign  dfq_stall = (dfq_vld_entries[5:0] >= 6'd4) ;
3195
assign  lsu_ifu_stallreq =
3196
        dfq_stall |  int_skid_stall | lsu_tlbop_force_swo ;
3197
        //dfq_stall | dfq_stall_d1 | dfq_stall_d2 | int_skid_stall | lsu_tlbop_force_swo ; 
3198
 
3199
dff   dfqst_d1 (
3200
        .din  (dfq_stall), .q  (dfq_stall_d1),
3201
        .clk  (clk),
3202
        .se     (1'b0),       .si (),          .so ()
3203
        );
3204
 
3205
//=================================================================================================
3206
//  INVALIDATE PROCESSING
3207
//=================================================================================================
3208
 
3209
assign  dva_snp_addr_e[4:0]  =
3210
  lsu_cpx_pkt_ifill_type ? imiss_inv_set_index[6:2] : {lsu_cpx_pkt_inv_pa[4:0]} ;
3211
 
3212
//bug3356 - b4 never changed to invalidate the 2nd offset of the i$ fill.
3213
//          l2 now generates b4 in b129 of cpx ifill packet. for ifill pkt
3214
//          b[129] = 0 for 1st ifill packet, b[129]=1 for 2nd ifill packet.
3215
 
3216
wire    cpxpkt_ifill_b4 ;
3217
assign  cpxpkt_ifill_b4  =  lsu_cpx_pkt_atm_st_cmplt & lsu_cpx_pkt_ifill_type ;
3218
 
3219
assign  imiss_dcd_b54[0] = ~imiss_inv_set_index[1] & ~cpxpkt_ifill_b4 ;
3220
assign  imiss_dcd_b54[1] = ~imiss_inv_set_index[1] &  cpxpkt_ifill_b4 ;
3221
assign  imiss_dcd_b54[2] =  imiss_inv_set_index[1] & ~cpxpkt_ifill_b4 ;
3222
assign  imiss_dcd_b54[3] =  imiss_inv_set_index[1] &  cpxpkt_ifill_b4 ;
3223
 
3224
wire  [3:0] perror_dcd_b54 ;
3225
assign  perror_dcd_b54[0] = ~lsu_cpx_pkt_perror_set[1] & ~lsu_cpx_pkt_perror_set[0] ;
3226
assign  perror_dcd_b54[1] = ~lsu_cpx_pkt_perror_set[1] &  lsu_cpx_pkt_perror_set[0] ;
3227
assign  perror_dcd_b54[2] =  lsu_cpx_pkt_perror_set[1] & ~lsu_cpx_pkt_perror_set[0] ;
3228
assign  perror_dcd_b54[3] =  lsu_cpx_pkt_perror_set[1] &  lsu_cpx_pkt_perror_set[0] ;
3229
 
3230
wire   [3:0]           dva_snp_set_vld_e;      // Lower 2b of cache set index - decoded
3231
wire   [1:0]           dva_snp_wy0_e ;         // way for addr<5:4>=00
3232
wire   [1:0]           dva_snp_wy1_e ;         // way for addr<5:4>=01
3233
wire   [1:0]           dva_snp_wy2_e ;         // way for addr<5:4>=10
3234
wire   [1:0]           dva_snp_wy3_e ;         // way for addr<5:4>=11
3235
 
3236
 
3237
 
3238
/*
3239
assign  dva_snp_set_vld_e[0] =
3240
lsu_cpx_pkt_ifill_type ? imiss_dcd_b54[0] :
3241
  lsu_cpx_pkt_perror_dinv ? perror_dcd_b54[0] : cpx_cpu_inv_data[`CPX_AX0_INV_DVLD] ;
3242
assign  dva_snp_set_vld_e[1] =
3243
lsu_cpx_pkt_ifill_type ? imiss_dcd_b54[1] :
3244
  lsu_cpx_pkt_perror_dinv ? perror_dcd_b54[1] : cpx_cpu_inv_data[`CPX_AX1_INV_DVLD+4] ;
3245
assign  dva_snp_set_vld_e[2] =
3246
lsu_cpx_pkt_ifill_type ? imiss_dcd_b54[2] :
3247
  lsu_cpx_pkt_perror_dinv ? perror_dcd_b54[2] : cpx_cpu_inv_data[`CPX_AX0_INV_DVLD+7] ;
3248
assign  dva_snp_set_vld_e[3] =
3249
lsu_cpx_pkt_ifill_type ? imiss_dcd_b54[3] :
3250
  lsu_cpx_pkt_perror_dinv ? perror_dcd_b54[3] : cpx_cpu_inv_data[`CPX_AX1_INV_DVLD+11] ;
3251
 
3252
assign  dva_snp_wy0_e[1:0]   =
3253
lsu_cpx_pkt_ifill_type ? lsu_cpx_pkt_invwy[1:0] : cpx_cpu_inv_data[`CPX_AX0_INV_WY_HI:`CPX_AX0_INV_WY_LO];
3254
assign  dva_snp_wy1_e[1:0]   =
3255
lsu_cpx_pkt_ifill_type ? lsu_cpx_pkt_invwy[1:0] : cpx_cpu_inv_data[`CPX_AX1_INV_WY_HI+4:`CPX_AX1_INV_WY_LO+4];
3256
assign  dva_snp_wy2_e[1:0]   =
3257
lsu_cpx_pkt_ifill_type ? lsu_cpx_pkt_invwy[1:0] : cpx_cpu_inv_data[`CPX_AX0_INV_WY_HI+7:`CPX_AX0_INV_WY_LO+7];
3258
assign  dva_snp_wy3_e[1:0]   =
3259
lsu_cpx_pkt_ifill_type ? lsu_cpx_pkt_invwy[1:0] : cpx_cpu_inv_data[`CPX_AX1_INV_WY_HI+11:`CPX_AX1_INV_WY_LO+11];
3260
*/
3261
 
3262
wire    stack_type_dcfill_vld,
3263
        stack_type_dcfill_vld_d1;
3264
//assign  stack_type_dcfill_vld  =  dfq_st_ack_type & lsu_dfq_byp_stack_dcfill_vld; // bug 2767
3265
//--------------------------------------------------------------
3266
// st_ack_type  local_pkt   b[87]  dcfill_vld==b[151]
3267
//--------------------------------------------------------------
3268
//   1           0          0          -      pkt not modified
3269
//   1           0          1          -      pkt not modified
3270
//--------------------------------------------------------------
3271
//   1           1          0          0      pkt not modified
3272
//   1           1          0          1      pkt modified
3273
//--------------------------------------------------------------
3274
//   1           1          1          0      pkt not modified  <---using b[87] will fail even w/ local pkt qual; hence use b[151]
3275
//   1           1          1          1      pkt modified 
3276
//--------------------------------------------------------------
3277
 
3278
// 4/7/03: set dcfill_vld only for local dcache data write and not for invalidate
3279
//         atomic and bis do not write dcache and hence dont set dcfill_vld
3280
assign  stack_type_dcfill_vld  =  lsu_dfq_byp_type[2] & local_pkt & lsu_dfq_byp_cpx_inv & ~(lsu_dfq_byp_atm | lsu_dfq_byp_binit_st) ;
3281
 
3282
wire  [1:0]  lsu_dfq_byp_stack_adr_b54_d1,
3283
             lsu_dfq_byp_stack_wrway_d1;
3284
 
3285
// bug3375: add enable to this flop - dfq_vld_en
3286
dffe #(5)  dfq_by_wrway_ad54_ff (
3287
        .din    ({stack_type_dcfill_vld,lsu_dfq_byp_stack_adr_b54[1:0],lsu_dfq_byp_stack_wrway[1:0]}),
3288
        .q      ({stack_type_dcfill_vld_d1,lsu_dfq_byp_stack_adr_b54_d1[1:0],lsu_dfq_byp_stack_wrway_d1[1:0]}),
3289
        .en     (dfq_vld_en),
3290
        .clk  (clk),
3291
        .se     (1'b0),       .si (),          .so ()
3292
        );
3293
 
3294
//cpx_cpu_inv_data[13:0] =  {dfq_inv_data_b13to9,1'b0,dfq_inv_data_b7to2,1'b0,dfq_inv_data_b0} 
3295
//CPX_AX0_INV_DVLD 0
3296
//CPX_AX0_INV_WY_LO 2
3297
//CPX_AX0_INV_WY_HI 3
3298
//CPX_AX1_INV_DVLD 0
3299
//CPX_AX1_INV_WY_LO 1
3300
//CPX_AX1_INV_WY_HI 2
3301
 
3302
assign  dva_snp_set_vld_e[0] =
3303
lsu_cpx_pkt_ifill_type ? imiss_dcd_b54[0] :
3304
  lsu_cpx_pkt_perror_dinv ? perror_dcd_b54[0] :
3305
     stack_type_dcfill_vld_d1 ? (lsu_dfq_byp_stack_adr_b54_d1[1:0]==2'b00) : dfq_inv_data_b0 ;
3306
     //stack_type_dcfill_vld_d1 ? (lsu_dfq_byp_stack_adr_b54_d1[1:0]==2'b00) : cpx_cpu_inv_data[`CPX_AX0_INV_DVLD] ;
3307
assign  dva_snp_set_vld_e[1] =
3308
lsu_cpx_pkt_ifill_type ? imiss_dcd_b54[1] :
3309
  lsu_cpx_pkt_perror_dinv ? perror_dcd_b54[1] :
3310
     stack_type_dcfill_vld_d1 ? (lsu_dfq_byp_stack_adr_b54_d1[1:0]==2'b01) : dfq_inv_data_b7to2[4] ;
3311
     //stack_type_dcfill_vld_d1 ? (lsu_dfq_byp_stack_adr_b54_d1[1:0]==2'b01) : cpx_cpu_inv_data[`CPX_AX1_INV_DVLD+4] ;
3312
assign  dva_snp_set_vld_e[2] =
3313
lsu_cpx_pkt_ifill_type ? imiss_dcd_b54[2] :
3314
  lsu_cpx_pkt_perror_dinv ? perror_dcd_b54[2] :
3315
     stack_type_dcfill_vld_d1 ? (lsu_dfq_byp_stack_adr_b54_d1[1:0]==2'b10) : dfq_inv_data_b7to2[7] ;
3316
     //stack_type_dcfill_vld_d1 ? (lsu_dfq_byp_stack_adr_b54_d1[1:0]==2'b10) : cpx_cpu_inv_data[`CPX_AX0_INV_DVLD+7] ;
3317
assign  dva_snp_set_vld_e[3] =
3318
lsu_cpx_pkt_ifill_type ? imiss_dcd_b54[3] :
3319
  lsu_cpx_pkt_perror_dinv ? perror_dcd_b54[3] :
3320
      stack_type_dcfill_vld_d1 ? (lsu_dfq_byp_stack_adr_b54_d1[1:0]==2'b11) : dfq_inv_data_b13to9[11] ;
3321
      //stack_type_dcfill_vld_d1 ? (lsu_dfq_byp_stack_adr_b54_d1[1:0]==2'b11) : cpx_cpu_inv_data[`CPX_AX1_INV_DVLD+11] ; 
3322
 
3323
assign  dva_snp_wy0_e[1:0]   =
3324
lsu_cpx_pkt_ifill_type ? lsu_cpx_pkt_invwy[1:0] :
3325
   stack_type_dcfill_vld_d1 ? lsu_dfq_byp_stack_wrway_d1[1:0] : dfq_inv_data_b7to2[3:2] ;
3326
   //stack_type_dcfill_vld_d1 ? lsu_dfq_byp_stack_wrway_d1[1:0] : cpx_cpu_inv_data[`CPX_AX0_INV_WY_HI:`CPX_AX0_INV_WY_LO] ;
3327
assign  dva_snp_wy1_e[1:0]   =
3328
lsu_cpx_pkt_ifill_type ? lsu_cpx_pkt_invwy[1:0] :
3329
   stack_type_dcfill_vld_d1 ? lsu_dfq_byp_stack_wrway_d1[1:0] : dfq_inv_data_b7to2[6:5] ;
3330
   //stack_type_dcfill_vld_d1 ? lsu_dfq_byp_stack_wrway_d1[1:0] : cpx_cpu_inv_data[`CPX_AX1_INV_WY_HI+4:`CPX_AX1_INV_WY_LO+4] ;
3331
assign  dva_snp_wy2_e[1:0]   =
3332
lsu_cpx_pkt_ifill_type ? lsu_cpx_pkt_invwy[1:0] :
3333
   stack_type_dcfill_vld_d1 ? lsu_dfq_byp_stack_wrway_d1[1:0] : dfq_inv_data_b13to9[10:9] ;
3334
   //stack_type_dcfill_vld_d1 ? lsu_dfq_byp_stack_wrway_d1[1:0] : cpx_cpu_inv_data[`CPX_AX0_INV_WY_HI+7:`CPX_AX0_INV_WY_LO+7] ;
3335
assign  dva_snp_wy3_e[1:0]   =
3336
lsu_cpx_pkt_ifill_type ? lsu_cpx_pkt_invwy[1:0] :
3337
   stack_type_dcfill_vld_d1 ? lsu_dfq_byp_stack_wrway_d1[1:0] : dfq_inv_data_b13to9[13:12] ;
3338
   //stack_type_dcfill_vld_d1 ? lsu_dfq_byp_stack_wrway_d1[1:0] : cpx_cpu_inv_data[`CPX_AX1_INV_WY_HI+11:`CPX_AX1_INV_WY_LO+11] ;
3339
 
3340
 
3341
 
3342
//   wire [1:0] dva_snp_way_e;
3343
//assign dva_snp_way_e[1:0] =  
3344
//  dva_snp_set_vld_e[0] ?  dva_snp_wy0_e[1:0]:
3345
//  dva_snp_set_vld_e[1] ?  dva_snp_wy1_e[1:0]:
3346
//  dva_snp_set_vld_e[2] ?  dva_snp_wy2_e[1:0]:
3347
//  dva_snp_set_vld_e[3] ?  dva_snp_wy3_e[1:0]: 2'bxx;
3348
 
3349
//bug 2333 fix
3350
//06/09/03: bug 3420 - add logic for dtag parity error invalidate - inv all 4 ways of the index that had error
3351
//bug 3608 - qualify perror_dinv w/ dfq_st_vld
3352
wire     derror_inv_vld ;
3353
assign   derror_inv_vld  =  dfq_st_vld & lsu_cpx_pkt_perror_dinv ;
3354
 
3355
   assign dva_snp_bit_wr_en_e [15] =  dva_snp_set_vld_e[3] &  (( dva_snp_wy3_e [1] &  dva_snp_wy3_e[0]) | derror_inv_vld ) ;
3356
   assign dva_snp_bit_wr_en_e [14] =  dva_snp_set_vld_e[3] &  (( dva_snp_wy3_e [1] & ~dva_snp_wy3_e[0]) | derror_inv_vld );
3357
   assign dva_snp_bit_wr_en_e [13] =  dva_snp_set_vld_e[3] &  ((~dva_snp_wy3_e [1] &  dva_snp_wy3_e[0]) | derror_inv_vld );
3358
   assign dva_snp_bit_wr_en_e [12] =  dva_snp_set_vld_e[3] &  ((~dva_snp_wy3_e [1] & ~dva_snp_wy3_e[0]) | derror_inv_vld );
3359
 
3360
   assign dva_snp_bit_wr_en_e [11] =  dva_snp_set_vld_e[2] &  (( dva_snp_wy2_e [1] &  dva_snp_wy2_e[0]) | derror_inv_vld );
3361
   assign dva_snp_bit_wr_en_e [10] =  dva_snp_set_vld_e[2] &  (( dva_snp_wy2_e [1] & ~dva_snp_wy2_e[0]) | derror_inv_vld );
3362
   assign dva_snp_bit_wr_en_e [09] =  dva_snp_set_vld_e[2] &  ((~dva_snp_wy2_e [1] &  dva_snp_wy2_e[0]) | derror_inv_vld );
3363
   assign dva_snp_bit_wr_en_e [08] =  dva_snp_set_vld_e[2] &  ((~dva_snp_wy2_e [1] & ~dva_snp_wy2_e[0]) | derror_inv_vld );
3364
 
3365
   assign dva_snp_bit_wr_en_e [07] =  dva_snp_set_vld_e[1] &  (( dva_snp_wy1_e [1] &  dva_snp_wy1_e[0]) | derror_inv_vld );
3366
   assign dva_snp_bit_wr_en_e [06] =  dva_snp_set_vld_e[1] &  (( dva_snp_wy1_e [1] & ~dva_snp_wy1_e[0]) | derror_inv_vld );
3367
   assign dva_snp_bit_wr_en_e [05] =  dva_snp_set_vld_e[1] &  ((~dva_snp_wy1_e [1] &  dva_snp_wy1_e[0]) | derror_inv_vld );
3368
   assign dva_snp_bit_wr_en_e [04] =  dva_snp_set_vld_e[1] &  ((~dva_snp_wy1_e [1] & ~dva_snp_wy1_e[0]) | derror_inv_vld );
3369
 
3370
   assign dva_snp_bit_wr_en_e [03] =  dva_snp_set_vld_e[0] &  (( dva_snp_wy0_e [1] &  dva_snp_wy0_e[0]) | derror_inv_vld );
3371
   assign dva_snp_bit_wr_en_e [02] =  dva_snp_set_vld_e[0] &  (( dva_snp_wy0_e [1] & ~dva_snp_wy0_e[0]) | derror_inv_vld );
3372
   assign dva_snp_bit_wr_en_e [01] =  dva_snp_set_vld_e[0] &  ((~dva_snp_wy0_e [1] &  dva_snp_wy0_e[0]) | derror_inv_vld );
3373
   assign dva_snp_bit_wr_en_e [00] =  dva_snp_set_vld_e[0] &  ((~dva_snp_wy0_e [1] & ~dva_snp_wy0_e[0]) | derror_inv_vld );
3374
 
3375
 
3376
//=================================================================================================
3377
//  LOCAL ST ACK PROCESSING
3378
//=================================================================================================
3379
 
3380
// st-ack at head of cfq may write to cache if not indicated as invalid 
3381
// L2.
3382
 
3383
//wire  byp_tag_perror ;
3384
//assign        byp_tag_perror = lsu_dfq_byp_perror_dinv | lsu_dfq_byp_perror_iinv ;
3385
 
3386
// one-shot rd-enable for stb for st data.
3387
// st-quad pkt2 will not rd stb
3388
//NOTE: restore cpx_inv qualification after adding cpx_inv part of dfq read - done
3389
/*
3390
assign  st_ack_rq_stb =
3391
   (dfq_byp_st_vld & st_rd_advance & ~byp_tag_perror)   // local st ack from dfq
3392
  & lsu_dfq_byp_cpx_inv ;
3393
*/
3394
  //((cpx_local_st_ack_type & ~dfq_wr_en & ~(|cpx_spc_data_cx[`CPX_PERR_DINV+1:`CPX_PERR_DINV])) | // local st ack from cpx
3395
  //(dfq_byp_st_vld & dfq_rd_advance & ~byp_tag_perror))   // local st ack from dfq
3396
  //(dfq_byp_st_vld & dfq_rd_advance_d1)) // local st ack from dfq
3397
 
3398
/*assign  st_ack_rq_stb =
3399
  ((cpx_local_st_ack_type & ~dfq_wr_en & ~cpx_spc_data_cx[107]) | // local st ack from cpx
3400
  (dfq_byp_st_vld & dfq_rd_advance & ~lsu_dfq_byp_stquad_pkt2))   // local st ack from dfq
3401
  //(dfq_byp_st_vld & dfq_rd_advance_d1)) // local st ack from dfq
3402
  & cpx_inv ; */
3403
 
3404
/*
3405
dff #(1)  stackr_d1 (
3406
        .din    (st_ack_rq_stb),
3407
        .q      (st_ack_rq_stb_d1),
3408
        .clk  (clk),
3409
        .se     (1'b0),       .si (),          .so ()
3410
        );
3411
*/
3412
 
3413
// Mux's control signal can be flipped - TIMING
3414
//assign  st_ack_tid[1:0] =
3415
//  (dfq_byp_st_vld & dfq_rd_advance) ?  
3416
//      lsu_dfq_byp_tid[1:0] : cpx_spc_data_cx[`CPX_TH_HI:`CPX_TH_LO] ;
3417
 
3418
// This can be critical !!!
3419
//assign  lsu_st_ack_rq_stb[0] = ~st_ack_tid[1] & ~st_ack_tid[0] & st_ack_rq_stb ;
3420
//assign  lsu_st_ack_rq_stb[1] = ~st_ack_tid[1] &  st_ack_tid[0] & st_ack_rq_stb ;
3421
//assign  lsu_st_ack_rq_stb[2] =  st_ack_tid[1] & ~st_ack_tid[0] & st_ack_rq_stb ;
3422
//assign  lsu_st_ack_rq_stb[3] =  st_ack_tid[1] &  st_ack_tid[0] & st_ack_rq_stb ;
3423
 
3424
// the ack decode can be combined with the above (grape)
3425
 
3426
assign  lsu_st_ack_dq_stb[0] =
3427
        cpx_pkt_thrd_sel[0] & dfq_st_cmplt &
3428
        ~(lsu_cpx_pkt_perror_dinv | lsu_cpx_pkt_perror_iinv | lsu_cpx_pkt_binit_st) ;
3429
assign  lsu_st_ack_dq_stb[1] =
3430
        cpx_pkt_thrd_sel[1] & dfq_st_cmplt &
3431
        ~(lsu_cpx_pkt_perror_dinv | lsu_cpx_pkt_perror_iinv | lsu_cpx_pkt_binit_st) ;
3432
assign  lsu_st_ack_dq_stb[2] =
3433
        cpx_pkt_thrd_sel[2] & dfq_st_cmplt &
3434
        ~(lsu_cpx_pkt_perror_dinv | lsu_cpx_pkt_perror_iinv | lsu_cpx_pkt_binit_st) ;
3435
assign  lsu_st_ack_dq_stb[3] =
3436
        cpx_pkt_thrd_sel[3] & dfq_st_cmplt &
3437
        ~(lsu_cpx_pkt_perror_dinv | lsu_cpx_pkt_perror_iinv | lsu_cpx_pkt_binit_st) ;
3438
 
3439
// Signal rmo ack completion.
3440
assign  lsu_cpx_rmo_st_ack[0] =
3441
        cpx_pkt_thrd_sel[0] & dfq_st_cmplt  & lsu_cpx_pkt_binit_st ;
3442
assign  lsu_cpx_rmo_st_ack[1] =
3443
        cpx_pkt_thrd_sel[1] & dfq_st_cmplt  & lsu_cpx_pkt_binit_st ;
3444
assign  lsu_cpx_rmo_st_ack[2] =
3445
        cpx_pkt_thrd_sel[2] & dfq_st_cmplt  & lsu_cpx_pkt_binit_st ;
3446
assign  lsu_cpx_rmo_st_ack[3] =
3447
        cpx_pkt_thrd_sel[3] & dfq_st_cmplt  & lsu_cpx_pkt_binit_st ;
3448
 
3449
assign  lsu_st_wr_dcache = stwr_active_e ;
3450
 
3451
//assign  lsu_st_wr_sel_e = stwr_active_e |  lsu_diagnstc_wr_src_sel_e ;
3452
 
3453
//=================================================================================================
3454
//  CPX PKT DECODE
3455
//=================================================================================================
3456
 
3457
// The decode is meant to qualify writes into the dfq.
3458
// These values are also stored in the dfq to save on decode at the head of the queue.
3459
 
3460
assign lsu_cpxpkt_type_dcd_cx[5:0] =
3461
{cpx_ld_type,cpx_ifill_type,cpx_evict_type,cpx_st_ack_type,cpx_strm_st_ack_type,cpx_int_type};
3462
 
3463
assign  cpx_ld_type =
3464
         cpx_spc_data_cx_b144to140[144] &
3465
        ((~cpx_spc_data_cx_b144to140[143]   & ~cpx_spc_data_cx_b144to140[140+2] & // 0000
3466
          ~cpx_spc_data_cx_b144to140[140+1] & ~cpx_spc_data_cx_b144to140[140]));
3467
 
3468
assign  cpx_ifill_type =
3469
         cpx_spc_data_cx_b144to140[144] &
3470
        ((~cpx_spc_data_cx_b144to140[143]   & ~cpx_spc_data_cx_b144to140[140+2] & // 0001
3471
          ~cpx_spc_data_cx_b144to140[140+1] &  cpx_spc_data_cx_b144to140[140]));
3472
 
3473
assign  cpx_evict_type =
3474
         cpx_spc_data_cx_b144to140[144] &
3475
        ((~cpx_spc_data_cx_b144to140[143]   & ~cpx_spc_data_cx_b144to140[140+2] & // 0011
3476
           cpx_spc_data_cx_b144to140[140+1] &  cpx_spc_data_cx_b144to140[140]));
3477
 
3478
assign  cpx_st_ack_type =
3479
         cpx_spc_data_cx_b144to140[144] &
3480
        ((~cpx_spc_data_cx_b144to140[143]  &   cpx_spc_data_cx_b144to140[140+2] & // 0100
3481
          ~cpx_spc_data_cx_b144to140[140+1] & ~cpx_spc_data_cx_b144to140[140]));
3482
         //~cpx_spc_data_cx[108] ;  // 1st stquad ack is rejected
3483
 
3484
assign  cpx_strm_st_ack_type =
3485
         cpx_spc_data_cx_b144to140[144] &
3486
        ((~cpx_spc_data_cx_b144to140[143]   &  cpx_spc_data_cx_b144to140[140+2] & // 0110
3487
           cpx_spc_data_cx_b144to140[140+1] & ~cpx_spc_data_cx_b144to140[140]));
3488
 
3489
assign  cpx_int_type =
3490
         cpx_spc_data_cx_b144to140[144] &
3491
        ((~cpx_spc_data_cx_b144to140[143]   &  cpx_spc_data_cx_b144to140[140+2] & // 0111
3492
           cpx_spc_data_cx_b144to140[140+1] &  cpx_spc_data_cx_b144to140[140]));
3493
 
3494
//bug3657  - kill ifill vld in bypass path when cpxtype=fp/fwd_reply
3495
 
3496
assign  cpx_fp_type =
3497
         cpx_spc_data_cx_b144to140[144] &
3498
        (( cpx_spc_data_cx_b144to140[143]   & ~cpx_spc_data_cx_b144to140[140+2] & // 1000
3499
          ~cpx_spc_data_cx_b144to140[140+1] & ~cpx_spc_data_cx_b144to140[140]));
3500
 
3501
//8/25/03: add error type to dfq_wr_en, dfq_rd_advance
3502
assign  cpx_error_type =
3503
         cpx_spc_data_cx_b144to140[144] &
3504
        (( cpx_spc_data_cx_b144to140[143]   &  cpx_spc_data_cx_b144to140[140+2] & // 1100
3505
          ~cpx_spc_data_cx_b144to140[140+1] & ~cpx_spc_data_cx_b144to140[140]));
3506
 
3507
// Miscellaneous cpu based decode
3508
 
3509
assign  lsu_cpu_dcd_sel[7:0]  = {cpu_sel[3:0],cpu_sel[3:0]} ;
3510
assign  lsu_cpu_uhlf_sel  = const_cpuid[2] ;
3511
 
3512
// removed cpu_id[2] qual in the eqn.
3513
assign  cpu_sel[0] =  ~const_cpuid[1] & ~const_cpuid[0] ;
3514
assign  cpu_sel[1] =  ~const_cpuid[1] &  const_cpuid[0] ;
3515
assign  cpu_sel[2] =   const_cpuid[1] & ~const_cpuid[0] ;
3516
assign  cpu_sel[3] =   const_cpuid[1] &  const_cpuid[0] ;
3517
 
3518
 
3519
// st ack to respective stb's. will not be generated for blk init stores
3520
// as such stores have already been deallocated.
3521
 
3522
assign  cpx_local_st_ack_type =
3523
  cpx_st_ack_type & (const_cpuid[2:0] == cpx_spc_data_cx_b120to118[120:118]) ;
3524
 // & ~(cpx_spc_data_cx[`CPX_BINIT_STACK] | (|cpx_spc_data_cx[`CPX_PERR_DINV+1:`CPX_PERR_DINV])) ;
3525
 
3526
wire    squash_ack ;
3527
assign squash_ack =
3528
(cpx_spc_data_cx_b125 | (|cpx_spc_data_cx_b124to123[123+1:123])) ;
3529
 
3530
assign  cpx_st_ack_tid0 = cpx_local_st_ack_type & ~squash_ack &
3531
                        ~cpx_spc_data_cx_b135to134[135] & ~cpx_spc_data_cx_b135to134[134] ;
3532
                        //~cpx_spc_data_cx[125] ; // rmo st will not ack
3533
                        //~cpx_spc_data_cx[`CPX_WY_LO] ; // stquad1 will not ack - just invalidate.
3534
                                                      // b131 of cpx pkt used.  
3535
 
3536
assign  cpx_st_ack_tid1 = cpx_local_st_ack_type & ~squash_ack &
3537
                        ~cpx_spc_data_cx_b135to134[135] &  cpx_spc_data_cx_b135to134[134] ;
3538
                        //~cpx_spc_data_cx[125] ; // rmo st will not ack
3539
                        //~cpx_spc_data_cx[`CPX_WY_LO] ; // stquad1 will not ack - just invalidate.
3540
                                                      // b131 of cpx pkt used.
3541
 
3542
assign  cpx_st_ack_tid2 = cpx_local_st_ack_type & ~squash_ack &
3543
                         cpx_spc_data_cx_b135to134[135] & ~cpx_spc_data_cx_b135to134[134] ;
3544
                        //~cpx_spc_data_cx[125] ; // rmo st will not ack
3545
                        //~cpx_spc_data_cx[`CPX_WY_LO] ; // stquad1 will not ack - just invalidate.
3546
                                                      // b131 of cpx pkt used. 
3547
 
3548
assign  cpx_st_ack_tid3 = cpx_local_st_ack_type & ~squash_ack &
3549
                         cpx_spc_data_cx_b135to134[135] & cpx_spc_data_cx_b135to134[134] ;
3550
                        //~cpx_spc_data_cx[125] ; // rmo st will not ack
3551
                        //~cpx_spc_data_cx[`CPX_WY_LO] ; // stquad1 will not ack - just invalidate.
3552
                                                      // b131 of cpx pkt used.
3553
 
3554
// Performance Ctr Info
3555
//assign lsu_tlu_l2_dmiss[0] =  dfill_dcd_thrd[0] & dcfill_active_e & lsu_cpx_pkt_l2miss ;
3556
assign lsu_tlu_l2_dmiss[0] =  dfq_thread0 & dcfill_active_e & lsu_cpx_pkt_l2miss ;
3557
assign lsu_tlu_l2_dmiss[1] =  dfq_thread1 & dcfill_active_e & lsu_cpx_pkt_l2miss ;
3558
assign lsu_tlu_l2_dmiss[2] =  dfq_thread2 & dcfill_active_e & lsu_cpx_pkt_l2miss ;
3559
assign lsu_tlu_l2_dmiss[3] =  dfq_thread3 & dcfill_active_e & lsu_cpx_pkt_l2miss ;
3560
 
3561
//=================================================================================================
3562
//  GENERATE b[151] of DFQ WRITE DATA
3563
//=================================================================================================
3564
wire  [7:0]  cpx_inv_vld;
3565
wire  [7:0]  cpu_sel_dcd;
3566
 
3567
assign  cpx_inv_vld[0] = cpx_spc_data_cx_b88 |
3568
                         cpx_spc_data_cx_b56 |
3569
                         cpx_spc_data_cx_b32 |
3570
                         cpx_spc_data_cx_b0 ;
3571
 
3572
assign  cpx_inv_vld[1] = cpx_spc_data_cx_b91 |
3573
                         cpx_spc_data_cx_b60 |
3574
                         cpx_spc_data_cx_b35 |
3575
                         cpx_spc_data_cx_b4 ;
3576
 
3577
assign  cpx_inv_vld[2] = cpx_spc_data_cx_b94 |
3578
                         cpx_spc_data_cx_b64 |
3579
                         cpx_spc_data_cx_b38 |
3580
                         cpx_spc_data_cx_b8 ;
3581
 
3582
assign  cpx_inv_vld[3] = cpx_spc_data_cx_b97 |
3583
                         cpx_spc_data_cx_b68 |
3584
                         cpx_spc_data_cx_b41 |
3585
                         cpx_spc_data_cx_b12 ;
3586
 
3587
assign  cpx_inv_vld[4] = cpx_spc_data_cx_b100 |
3588
                         cpx_spc_data_cx_b72  |
3589
                         cpx_spc_data_cx_b44  |
3590
                         cpx_spc_data_cx_b16  ;
3591
 
3592
assign  cpx_inv_vld[5] = cpx_spc_data_cx_b103 |
3593
                         cpx_spc_data_cx_b76  |
3594
                         cpx_spc_data_cx_b47  |
3595
                         cpx_spc_data_cx_b20  ;
3596
 
3597
assign  cpx_inv_vld[6] = cpx_spc_data_cx_b106 |
3598
                         cpx_spc_data_cx_b80  |
3599
                         cpx_spc_data_cx_b50  |
3600
                         cpx_spc_data_cx_b24  ;
3601
 
3602
assign  cpx_inv_vld[7] = cpx_spc_data_cx_b109 |
3603
                         cpx_spc_data_cx_b84  |
3604
                         cpx_spc_data_cx_b53  |
3605
                         cpx_spc_data_cx_b28  ;
3606
 
3607
assign cpu_sel_dcd[7:4] =  ({4{ lsu_cpu_uhlf_sel}} & cpu_sel[3:0]);
3608
assign cpu_sel_dcd[3:0] =  ({4{~lsu_cpu_uhlf_sel}} & cpu_sel[3:0]);
3609
 
3610
assign lsu_cpx_spc_inv_vld  =  |(cpx_inv_vld[7:0] & cpu_sel_dcd[7:0]);
3611
 
3612
//=================================================================================================
3613
//  GENERATE ICACHE INVALIDATE VALID (bug:2770)
3614
//=================================================================================================
3615
 
3616
wire  [7:0]  cpx_iinv_vld;
3617
wire         cpx_spc_iinv_vld;
3618
 
3619
assign  cpx_iinv_vld[0] = cpx_spc_data_cx_b57 |
3620
                          cpx_spc_data_cx_b1  ;
3621
 
3622
assign  cpx_iinv_vld[1] = cpx_spc_data_cx_b61 |
3623
                          cpx_spc_data_cx_b5  ;
3624
 
3625
assign  cpx_iinv_vld[2] = cpx_spc_data_cx_b65 |
3626
                          cpx_spc_data_cx_b9  ;
3627
 
3628
assign  cpx_iinv_vld[3] = cpx_spc_data_cx_b69 |
3629
                          cpx_spc_data_cx_b13 ;
3630
 
3631
assign  cpx_iinv_vld[4] = cpx_spc_data_cx_b73 |
3632
                          cpx_spc_data_cx_b17 ;
3633
 
3634
assign  cpx_iinv_vld[5] = cpx_spc_data_cx_b77 |
3635
                          cpx_spc_data_cx_b21 ;
3636
 
3637
assign  cpx_iinv_vld[6] = cpx_spc_data_cx_b81 |
3638
                          cpx_spc_data_cx_b25 ;
3639
 
3640
assign  cpx_iinv_vld[7] = cpx_spc_data_cx_b85 |
3641
                          cpx_spc_data_cx_b29 ;
3642
 
3643
//bug3701 - include i$ parity error invalidate - b[124]
3644
assign cpx_spc_iinv_vld  =  |( (cpx_iinv_vld[7:0] | {8{cpx_spc_data_cx_b124to123[123+1]}}) & cpu_sel_dcd[7:0] )  ;
3645
 
3646
 
3647
// dfq_rd_advance - local st ack not qualified w/ ifu_lsu_ibuf_busy
3648
// qualify ifu_busy w/ local_st_ack=1 and iinv=1
3649
 
3650
assign lsu_cpx_stack_icfill_vld  =
3651
                  ( cpx_local_st_ack_type & cpx_spc_iinv_vld) |        //if local st_ack=1, b[128]=iinv
3652
                  (~cpx_local_st_ack_type & cpx_spc_data_cx_b128) ;    //if local st_ack=0, b[128]=cpx_data[128]
3653
 
3654
//=================================================================================================
3655
//  MISC QDP2 MUX SELECTS
3656
//=================================================================================================
3657
 
3658
//assign  lsu_dcfill_mx_sel_e[0]  =  lsu_dc_iob_access_e;
3659
//assign  lsu_dcfill_mx_sel_e[1]  =  lsu_bist_wvld_e | lsu_bist_rvld_e;
3660
//assign  lsu_dcfill_mx_sel_e[2]  =  lsu_diagnstc_wr_src_sel_e;
3661
//assign  lsu_dcfill_mx_sel_e[3]  =  ~|lsu_dcfill_mx_sel_e[2:0];
3662
 
3663
//assign  lsu_dcfill_addr_mx_sel_e  =  ~|lsu_dcfill_mx_sel_e[1:0];
3664
 
3665
//assign  lsu_dcfill_data_mx_sel_e  =  lsu_dc_iob_access_e | lsu_bist_wvld_e;
3666
 
3667
assign lsu_cpx_thrdid[0]  =  ~cpx_spc_data_cx_b135to134[135] & ~cpx_spc_data_cx_b135to134[134] ;
3668
assign lsu_cpx_thrdid[1]  =  ~cpx_spc_data_cx_b135to134[135] &  cpx_spc_data_cx_b135to134[134] ;
3669
assign lsu_cpx_thrdid[2]  =   cpx_spc_data_cx_b135to134[135] & ~cpx_spc_data_cx_b135to134[134] ;
3670
assign lsu_cpx_thrdid[3]  =   cpx_spc_data_cx_b135to134[135] &  cpx_spc_data_cx_b135to134[134] ;
3671
 
3672
// modify cpx packet only if dcache update from stb has to be made. 
3673
// lsu_cpx_spc_inv_vld = 1 => invalidate dcache for atomic- b[129] and bst- b[125]
3674
//                            update dcache for other requests
3675
//
3676
// i.e. cpx_pkt==st_ack and local and dcfill_vld=1; if dcfill_vld==0, ifill info
3677
// has to be left as is. hence no pkt modification
3678
 
3679
assign lsu_cpx_stack_dcfill_vld  =
3680
                       (cpx_local_st_ack_type & ~(cpx_spc_data_cx_b129 | cpx_spc_data_cx_b125))  &
3681
                       lsu_cpx_spc_inv_vld ;
3682
 
3683
//timing fix: 6/16/03 - fix for ifill_pkt_vld - use b130 if store_ack_dcfill_vld=1
3684
//bug3582 - b[130] for store ack is a dont-care i.e. capture b[130] only if packet type is not store ack
3685
assign lsu_cpx_stack_dcfill_vld_b130  =  // if lsu_cpx_stack_dcfill_vld=1 b[130]=lsu_cpx_stack_dcfill_vld
3686
                                         // if cpx_st_ack=0 b[130]=cpx_data[130]
3687
                                       lsu_cpx_stack_dcfill_vld |
3688
                                       (~cpx_st_ack_type & cpx_spc_data_cx_b130) ;
3689
endmodule

powered by: WebSVN 2.1.0

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