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(); 731 std::list<unsigned>::iterator end = activeThreads->end(); |
732 |
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{ |
788 std::list<unsigned>::iterator threads = activeThreads->begin(); 789 std::list<unsigned>::iterator end = activeThreads->end(); |
790 bool status_change = false; 791 792 wroteToTimeBuffer = false; 793 |
794 while (threads != end) { |
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 { |
1317 std::list<unsigned>::iterator thread = activeThreads->begin(); 1318 assert(thread != activeThreads->end()); 1319 int tid = *thread; |
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 |
1369 std::list<unsigned>::iterator threads = activeThreads->begin(); 1370 std::list<unsigned>::iterator end = activeThreads->end(); |
1371 |
1372 while (threads != end) { |
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(); |
1402 |
1403 while (threads != end) { |
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{ |
1429 std::list<unsigned>::iterator thread = activeThreads->begin(); 1430 assert(thread != activeThreads->end()); 1431 unsigned tid = *thread; 1432 |
1433 panic("Branch Count Fetch policy unimplemented\n"); |
1434 return 0 * tid; |
1435} |