cpu.cc (5100:7a0180040755) cpu.cc (5314:e902f12a3af1)
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
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 std;
56using namespace TheISA;
57
58BaseO3CPU::BaseO3CPU(Params *params)
59 : BaseCPU(params), cpu_id(0)
60{
61}
62
63void

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

516
517 commit.setThreads(thread);
518}
519
520template <class Impl>
521void
522FullO3CPU<Impl>::activateThread(unsigned tid)
523{
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{
524 list<unsigned>::iterator isActive = find(
525 activeThreads.begin(), activeThreads.end(), tid);
523 std::list<unsigned>::iterator isActive =
524 std::find(activeThreads.begin(), activeThreads.end(), tid);
526
527 DPRINTF(O3CPU, "[tid:%i]: Calling activate thread.\n", tid);
528
529 if (isActive == activeThreads.end()) {
530 DPRINTF(O3CPU, "[tid:%i]: Adding to active threads list\n",
531 tid);
532
533 activeThreads.push_back(tid);
534 }
535}
536
537template <class Impl>
538void
539FullO3CPU<Impl>::deactivateThread(unsigned tid)
540{
541 //Remove From Active List, if Active
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
542 list::iterator thread_it =
543 find(activeThreads.begin(), activeThreads.end(), tid);
541 std::list<unsigned>::iterator thread_it =
542 std::find(activeThreads.begin(), activeThreads.end(), tid);
544
545 DPRINTF(O3CPU, "[tid:%i]: Calling deactivate thread.\n", tid);
546
547 if (thread_it != activeThreads.end()) {
548 DPRINTF(O3CPU,"[tid:%i]: Removing from active threads list\n",
549 tid);
550 activeThreads.erase(thread_it);
551 }

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

954 commit.takeOverFrom();
955
956 assert(!tickEvent.scheduled());
957
958 // @todo: Figure out how to properly select the tid to put onto
959 // the active threads list.
960 int tid = 0;
961
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
962 list<unsigned>::iterator isActive = find(
963 activeThreads.begin(), activeThreads.end(), tid);
961 std::list<unsigned>::iterator isActive =
962 std::find(activeThreads.begin(), activeThreads.end(), tid);
964
965 if (isActive == activeThreads.end()) {
966 //May Need to Re-code this if the delay variable is the delay
967 //needed for thread to activate
968 DPRINTF(O3CPU, "Adding Thread %i to active threads list\n",
969 tid);
970
971 activeThreads.push_back(tid);

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

1449template <class Impl>
1450void
1451FullO3CPU<Impl>::updateThreadPriority()
1452{
1453 if (activeThreads.size() > 1)
1454 {
1455 //DEFAULT TO ROUND ROBIN SCHEME
1456 //e.g. Move highest priority to end of thread list
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
1457 list::iterator list_begin = activeThreads.begin();
1458 list::iterator list_end = activeThreads.end();
1456 std::list<unsigned>::iterator list_begin = activeThreads.begin();
1457 std::list<unsigned>::iterator list_end = activeThreads.end();
1459
1460 unsigned high_thread = *list_begin;
1461
1462 activeThreads.erase(list_begin);
1463
1464 activeThreads.push_back(high_thread);
1465 }
1466}
1467
1468// Forward declaration of FullO3CPU.
1469template class FullO3CPU<O3CPUImpl>;
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>;