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; --- 144 unchanged lines hidden (view full) --- 153 154 globalSeqNum(1), 155 156#if FULL_SYSTEM 157 system(params->system), 158 physmem(system->physmem), 159#endif // FULL_SYSTEM 160 mem(params->mem), |
161 drainCount(0), |
162 deferRegistration(params->deferRegistration), 163 numThreads(number_of_threads) 164{ 165 _status = Idle; 166 167 checker = NULL; 168 169 if (params->checker) { --- 538 unchanged lines hidden (view full) --- 708 activeThreads.erase(isActive); 709 710 removeThread(tid); 711 } 712*/ 713} 714 715template <class Impl> |
716bool 717FullO3CPU<Impl>::drain(Event *drain_event) |
718{ |
719 drainCount = 0; 720 drainEvent = drain_event; 721 fetch.drain(); 722 decode.drain(); 723 rename.drain(); 724 iew.drain(); 725 commit.drain(); |
726 727 // Wake the CPU and record activity so everything can drain out if 728 // the CPU is currently idle. 729 wakeCPU(); 730 activityRec.activity(); |
731 732 return false; |
733} 734 735template <class Impl> 736void |
737FullO3CPU<Impl>::resume() |
738{ |
739 if (_status == SwitchedOut) 740 return; 741 fetch.resume(); 742 decode.resume(); 743 rename.resume(); 744 iew.resume(); 745 commit.resume(); |
746 |
747 if (!tickEvent.scheduled()) 748 tickEvent.schedule(curTick); 749 _status = Running; 750} |
751 |
752template <class Impl> 753void 754FullO3CPU<Impl>::signalDrained() 755{ 756 if (++drainCount == NumStages) { |
757 if (tickEvent.scheduled()) 758 tickEvent.squash(); |
759 _status = Drained; 760 drainEvent->process(); |
761 } |
762 assert(drainCount <= 5); |
763} 764 765template <class Impl> 766void |
767FullO3CPU<Impl>::switchOut() 768{ 769 fetch.switchOut(); 770 rename.switchOut(); 771 commit.switchOut(); 772 instList.clear(); 773 while (!removeList.empty()) { 774 removeList.pop(); 775 } 776 777 _status = SwitchedOut; 778#if USE_CHECKER 779 if (checker) 780 checker->switchOut(); 781#endif 782} 783 784template <class Impl> 785void |
786FullO3CPU<Impl>::takeOverFrom(BaseCPU *oldCPU) 787{ 788 // Flush out any old data from the time buffers. 789 for (int i = 0; i < 10; ++i) { 790 timeBuffer.advance(); 791 fetchQueue.advance(); 792 decodeQueue.advance(); 793 renameQueue.advance(); --- 497 unchanged lines hidden --- |