fetch_impl.hh (3968:0a08763926a1) fetch_impl.hh (3970:d54945bab95d)
1/*
2 * Copyright (c) 2004-2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 713 unchanged lines hidden (view full) ---

722 return ret_val;
723}
724
725template<class Impl>
726typename DefaultFetch<Impl>::FetchStatus
727DefaultFetch<Impl>::updateFetchStatus()
728{
729 //Check Running
1/*
2 * Copyright (c) 2004-2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 713 unchanged lines hidden (view full) ---

722 return ret_val;
723}
724
725template<class Impl>
726typename DefaultFetch<Impl>::FetchStatus
727DefaultFetch<Impl>::updateFetchStatus()
728{
729 //Check Running
730 std::list<unsigned>::iterator threads = (*activeThreads).begin();
730 std::list<unsigned>::iterator threads = activeThreads->begin();
731 std::list<unsigned>::iterator end = activeThreads->end();
731
732
732 while (threads != (*activeThreads).end()) {
733
733 while (threads != end) {
734 unsigned tid = *threads++;
735
736 if (fetchStatus[tid] == Running ||
737 fetchStatus[tid] == Squashing ||
738 fetchStatus[tid] == IcacheAccessComplete) {
739
740 if (_status == Inactive) {
741 DPRINTF(Activity, "[tid:%i]: Activating stage.\n",tid);

--- 38 unchanged lines hidden (view full) ---

780 cpu->removeInstsNotInROB(tid, true, 0);
781#endif
782}
783
784template <class Impl>
785void
786DefaultFetch<Impl>::tick()
787{
734 unsigned tid = *threads++;
735
736 if (fetchStatus[tid] == Running ||
737 fetchStatus[tid] == Squashing ||
738 fetchStatus[tid] == IcacheAccessComplete) {
739
740 if (_status == Inactive) {
741 DPRINTF(Activity, "[tid:%i]: Activating stage.\n",tid);

--- 38 unchanged lines hidden (view full) ---

780 cpu->removeInstsNotInROB(tid, true, 0);
781#endif
782}
783
784template <class Impl>
785void
786DefaultFetch<Impl>::tick()
787{
788 std::list<unsigned>::iterator threads = (*activeThreads).begin();
788 std::list<unsigned>::iterator threads = activeThreads->begin();
789 std::list<unsigned>::iterator end = activeThreads->end();
789 bool status_change = false;
790
791 wroteToTimeBuffer = false;
792
790 bool status_change = false;
791
792 wroteToTimeBuffer = false;
793
793 while (threads != (*activeThreads).end()) {
794 while (threads != end) {
794 unsigned tid = *threads++;
795
796 // Check the signals for each thread to determine the proper status
797 // for each thread.
798 bool updated_status = checkSignalsAndUpdate(tid);
799 status_change = status_change || updated_status;
800 }
801

--- 506 unchanged lines hidden (view full) ---

1308
1309 case Branch:
1310 return branchCount();
1311
1312 default:
1313 return -1;
1314 }
1315 } else {
795 unsigned tid = *threads++;
796
797 // Check the signals for each thread to determine the proper status
798 // for each thread.
799 bool updated_status = checkSignalsAndUpdate(tid);
800 status_change = status_change || updated_status;
801 }
802

--- 506 unchanged lines hidden (view full) ---

1309
1310 case Branch:
1311 return branchCount();
1312
1313 default:
1314 return -1;
1315 }
1316 } else {
1316 int tid = *((*activeThreads).begin());
1317 std::list<unsigned>::iterator thread = activeThreads->begin();
1318 assert(thread != activeThreads->end());
1319 int tid = *thread;
1317
1318 if (fetchStatus[tid] == Running ||
1319 fetchStatus[tid] == IcacheAccessComplete ||
1320 fetchStatus[tid] == Idle) {
1321 return tid;
1322 } else {
1323 return -1;
1324 }

--- 33 unchanged lines hidden (view full) ---

1358}
1359
1360template<class Impl>
1361int
1362DefaultFetch<Impl>::iqCount()
1363{
1364 std::priority_queue<unsigned> PQ;
1365
1320
1321 if (fetchStatus[tid] == Running ||
1322 fetchStatus[tid] == IcacheAccessComplete ||
1323 fetchStatus[tid] == Idle) {
1324 return tid;
1325 } else {
1326 return -1;
1327 }

--- 33 unchanged lines hidden (view full) ---

1361}
1362
1363template<class Impl>
1364int
1365DefaultFetch<Impl>::iqCount()
1366{
1367 std::priority_queue<unsigned> PQ;
1368
1366 std::list<unsigned>::iterator threads = (*activeThreads).begin();
1369 std::list<unsigned>::iterator threads = activeThreads->begin();
1370 std::list<unsigned>::iterator end = activeThreads->end();
1367
1371
1368 while (threads != (*activeThreads).end()) {
1372 while (threads != end) {
1369 unsigned tid = *threads++;
1370
1371 PQ.push(fromIEW->iewInfo[tid].iqCount);
1372 }
1373
1374 while (!PQ.empty()) {
1375
1376 unsigned high_pri = PQ.top();

--- 11 unchanged lines hidden (view full) ---

1388}
1389
1390template<class Impl>
1391int
1392DefaultFetch<Impl>::lsqCount()
1393{
1394 std::priority_queue<unsigned> PQ;
1395
1373 unsigned tid = *threads++;
1374
1375 PQ.push(fromIEW->iewInfo[tid].iqCount);
1376 }
1377
1378 while (!PQ.empty()) {
1379
1380 unsigned high_pri = PQ.top();

--- 11 unchanged lines hidden (view full) ---

1392}
1393
1394template<class Impl>
1395int
1396DefaultFetch<Impl>::lsqCount()
1397{
1398 std::priority_queue<unsigned> PQ;
1399
1400 std::list<unsigned>::iterator threads = activeThreads->begin();
1401 std::list<unsigned>::iterator end = activeThreads->end();
1396
1402
1397 std::list<unsigned>::iterator threads = (*activeThreads).begin();
1398
1399 while (threads != (*activeThreads).end()) {
1403 while (threads != end) {
1400 unsigned tid = *threads++;
1401
1402 PQ.push(fromIEW->iewInfo[tid].ldstqCount);
1403 }
1404
1405 while (!PQ.empty()) {
1406
1407 unsigned high_pri = PQ.top();

--- 9 unchanged lines hidden (view full) ---

1417
1418 return -1;
1419}
1420
1421template<class Impl>
1422int
1423DefaultFetch<Impl>::branchCount()
1424{
1404 unsigned tid = *threads++;
1405
1406 PQ.push(fromIEW->iewInfo[tid].ldstqCount);
1407 }
1408
1409 while (!PQ.empty()) {
1410
1411 unsigned high_pri = PQ.top();

--- 9 unchanged lines hidden (view full) ---

1421
1422 return -1;
1423}
1424
1425template<class Impl>
1426int
1427DefaultFetch<Impl>::branchCount()
1428{
1425 std::list<unsigned>::iterator threads = (*activeThreads).begin();
1429 std::list<unsigned>::iterator thread = activeThreads->begin();
1430 assert(thread != activeThreads->end());
1431 unsigned tid = *thread;
1432
1426 panic("Branch Count Fetch policy unimplemented\n");
1433 panic("Branch Count Fetch policy unimplemented\n");
1427 return *threads;
1434 return 0 * tid;
1428}
1435}