fetch_impl.hh (8064:5b111ae7e7d4) fetch_impl.hh (8089:4a59661d3fd1)
1/*
2 * Copyright (c) 2010 ARM Limited
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

1399
1400 return InvalidThreadID;
1401}
1402
1403template<class Impl>
1404ThreadID
1405DefaultFetch<Impl>::iqCount()
1406{
1/*
2 * Copyright (c) 2010 ARM Limited
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

1399
1400 return InvalidThreadID;
1401}
1402
1403template<class Impl>
1404ThreadID
1405DefaultFetch<Impl>::iqCount()
1406{
1407 std::priority_queue<ThreadID> PQ;
1407 std::priority_queue<unsigned> PQ;
1408 std::map<unsigned, ThreadID> threadMap;
1408
1409 list<ThreadID>::iterator threads = activeThreads->begin();
1410 list<ThreadID>::iterator end = activeThreads->end();
1411
1412 while (threads != end) {
1413 ThreadID tid = *threads++;
1409
1410 list<ThreadID>::iterator threads = activeThreads->begin();
1411 list<ThreadID>::iterator end = activeThreads->end();
1412
1413 while (threads != end) {
1414 ThreadID tid = *threads++;
1415 unsigned iqCount = fromIEW->iewInfo[tid].iqCount;
1414
1416
1415 PQ.push(fromIEW->iewInfo[tid].iqCount);
1417 PQ.push(iqCount);
1418 threadMap[iqCount] = tid;
1416 }
1417
1418 while (!PQ.empty()) {
1419 }
1420
1421 while (!PQ.empty()) {
1419 ThreadID high_pri = PQ.top();
1422 ThreadID high_pri = threadMap[PQ.top()];
1420
1421 if (fetchStatus[high_pri] == Running ||
1422 fetchStatus[high_pri] == IcacheAccessComplete ||
1423 fetchStatus[high_pri] == Idle)
1424 return high_pri;
1425 else
1426 PQ.pop();
1427
1428 }
1429
1430 return InvalidThreadID;
1431}
1432
1433template<class Impl>
1434ThreadID
1435DefaultFetch<Impl>::lsqCount()
1436{
1423
1424 if (fetchStatus[high_pri] == Running ||
1425 fetchStatus[high_pri] == IcacheAccessComplete ||
1426 fetchStatus[high_pri] == Idle)
1427 return high_pri;
1428 else
1429 PQ.pop();
1430
1431 }
1432
1433 return InvalidThreadID;
1434}
1435
1436template<class Impl>
1437ThreadID
1438DefaultFetch<Impl>::lsqCount()
1439{
1437 std::priority_queue<ThreadID> PQ;
1440 std::priority_queue<unsigned> PQ;
1441 std::map<unsigned, ThreadID> threadMap;
1438
1439 list<ThreadID>::iterator threads = activeThreads->begin();
1440 list<ThreadID>::iterator end = activeThreads->end();
1441
1442 while (threads != end) {
1443 ThreadID tid = *threads++;
1442
1443 list<ThreadID>::iterator threads = activeThreads->begin();
1444 list<ThreadID>::iterator end = activeThreads->end();
1445
1446 while (threads != end) {
1447 ThreadID tid = *threads++;
1448 unsigned ldstqCount = fromIEW->iewInfo[tid].ldstqCount;
1444
1449
1445 PQ.push(fromIEW->iewInfo[tid].ldstqCount);
1450 PQ.push(ldstqCount);
1451 threadMap[ldstqCount] = tid;
1446 }
1447
1448 while (!PQ.empty()) {
1452 }
1453
1454 while (!PQ.empty()) {
1449 ThreadID high_pri = PQ.top();
1455 ThreadID high_pri = threadMap[PQ.top()];
1450
1451 if (fetchStatus[high_pri] == Running ||
1452 fetchStatus[high_pri] == IcacheAccessComplete ||
1453 fetchStatus[high_pri] == Idle)
1454 return high_pri;
1455 else
1456 PQ.pop();
1457 }

--- 17 unchanged lines hidden ---
1456
1457 if (fetchStatus[high_pri] == Running ||
1458 fetchStatus[high_pri] == IcacheAccessComplete ||
1459 fetchStatus[high_pri] == Idle)
1460 return high_pri;
1461 else
1462 PQ.pop();
1463 }

--- 17 unchanged lines hidden ---