cpu.cc (2852:7fc1b748dd81) | cpu.cc (2863:2592e056dc5c) |
---|---|
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; --- 698 unchanged lines hidden (view full) --- 707*/ 708} 709 710template <class Impl> 711bool 712FullO3CPU<Impl>::drain(Event *drain_event) 713{ 714 drainCount = 0; | 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; --- 698 unchanged lines hidden (view full) --- 707*/ 708} 709 710template <class Impl> 711bool 712FullO3CPU<Impl>::drain(Event *drain_event) 713{ 714 drainCount = 0; |
715 drainEvent = drain_event; | |
716 fetch.drain(); 717 decode.drain(); 718 rename.drain(); 719 iew.drain(); 720 commit.drain(); | 715 fetch.drain(); 716 decode.drain(); 717 rename.drain(); 718 iew.drain(); 719 commit.drain(); |
720 // A bit of a hack...set the drainEvent after all the drain() 721 // calls have been made, that way if all of the stages drain 722 // immediately, the signalDrained() function knows not to call 723 // process on the drain event. 724 drainEvent = drain_event; |
|
721 722 // Wake the CPU and record activity so everything can drain out if | 725 726 // Wake the CPU and record activity so everything can drain out if |
723 // the CPU is currently idle. 724 wakeCPU(); 725 activityRec.activity(); | 727 // the CPU was not able to immediately drain. 728 if (_status != Drained) { 729 wakeCPU(); 730 activityRec.activity(); |
726 | 731 |
727 return false; | 732 return false; 733 } else { 734 return true; 735 } |
728} 729 730template <class Impl> 731void 732FullO3CPU<Impl>::resume() 733{ 734 if (_status == SwitchedOut) 735 return; --- 10 unchanged lines hidden (view full) --- 746 747template <class Impl> 748void 749FullO3CPU<Impl>::signalDrained() 750{ 751 if (++drainCount == NumStages) { 752 if (tickEvent.scheduled()) 753 tickEvent.squash(); | 736} 737 738template <class Impl> 739void 740FullO3CPU<Impl>::resume() 741{ 742 if (_status == SwitchedOut) 743 return; --- 10 unchanged lines hidden (view full) --- 754 755template <class Impl> 756void 757FullO3CPU<Impl>::signalDrained() 758{ 759 if (++drainCount == NumStages) { 760 if (tickEvent.scheduled()) 761 tickEvent.squash(); |
762 |
|
754 _status = Drained; | 763 _status = Drained; |
755 drainEvent->process(); | 764 765 if (drainEvent) { 766 drainEvent->process(); 767 drainEvent = NULL; 768 } |
756 } 757 assert(drainCount <= 5); 758} 759 760template <class Impl> 761void 762FullO3CPU<Impl>::switchOut() 763{ --- 522 unchanged lines hidden --- | 769 } 770 assert(drainCount <= 5); 771} 772 773template <class Impl> 774void 775FullO3CPU<Impl>::switchOut() 776{ --- 522 unchanged lines hidden --- |