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; --- 38 unchanged lines hidden (view full) --- 47#else 48#include "sim/process.hh" 49#endif 50 51#if USE_CHECKER 52#include "cpu/checker/cpu.hh" 53#endif 54 |
55using namespace TheISA; 56 57BaseO3CPU::BaseO3CPU(Params *params) 58 : BaseCPU(params), cpu_id(0) 59{ 60} 61 62void --- 452 unchanged lines hidden (view full) --- 515 516 commit.setThreads(thread); 517} 518 519template <class Impl> 520void 521FullO3CPU<Impl>::activateThread(unsigned tid) 522{ |
523 std::list<unsigned>::iterator isActive = 524 std::find(activeThreads.begin(), activeThreads.end(), tid); |
525 526 DPRINTF(O3CPU, "[tid:%i]: Calling activate thread.\n", tid); 527 528 if (isActive == activeThreads.end()) { 529 DPRINTF(O3CPU, "[tid:%i]: Adding to active threads list\n", 530 tid); 531 532 activeThreads.push_back(tid); 533 } 534} 535 536template <class Impl> 537void 538FullO3CPU<Impl>::deactivateThread(unsigned tid) 539{ 540 //Remove From Active List, if Active |
541 std::list<unsigned>::iterator thread_it = 542 std::find(activeThreads.begin(), activeThreads.end(), tid); |
543 544 DPRINTF(O3CPU, "[tid:%i]: Calling deactivate thread.\n", tid); 545 546 if (thread_it != activeThreads.end()) { 547 DPRINTF(O3CPU,"[tid:%i]: Removing from active threads list\n", 548 tid); 549 activeThreads.erase(thread_it); 550 } --- 402 unchanged lines hidden (view full) --- 953 commit.takeOverFrom(); 954 955 assert(!tickEvent.scheduled()); 956 957 // @todo: Figure out how to properly select the tid to put onto 958 // the active threads list. 959 int tid = 0; 960 |
961 std::list<unsigned>::iterator isActive = 962 std::find(activeThreads.begin(), activeThreads.end(), tid); |
963 964 if (isActive == activeThreads.end()) { 965 //May Need to Re-code this if the delay variable is the delay 966 //needed for thread to activate 967 DPRINTF(O3CPU, "Adding Thread %i to active threads list\n", 968 tid); 969 970 activeThreads.push_back(tid); --- 477 unchanged lines hidden (view full) --- 1448template <class Impl> 1449void 1450FullO3CPU<Impl>::updateThreadPriority() 1451{ 1452 if (activeThreads.size() > 1) 1453 { 1454 //DEFAULT TO ROUND ROBIN SCHEME 1455 //e.g. Move highest priority to end of thread list |
1456 std::list<unsigned>::iterator list_begin = activeThreads.begin(); 1457 std::list<unsigned>::iterator list_end = activeThreads.end(); |
1458 1459 unsigned high_thread = *list_begin; 1460 1461 activeThreads.erase(list_begin); 1462 1463 activeThreads.push_back(high_thread); 1464 } 1465} 1466 1467// Forward declaration of FullO3CPU. 1468template class FullO3CPU<O3CPUImpl>; |