Deleted Added
sdiff udiff text old ( 5100:7a0180040755 ) new ( 5314:e902f12a3af1 )
full compact
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{
524 list<unsigned>::iterator isActive = find(
525 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
542 list::iterator thread_it =
543 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
962 list<unsigned>::iterator isActive = find(
963 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
1457 list::iterator list_begin = activeThreads.begin();
1458 list::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>;