cpu.cc (8795:0909f8ed7aa0) | cpu.cc (8796:a2ae5c378d0a) |
---|---|
1/* 2 * Copyright (c) 2004-2006 The Regents of The University of Michigan 3 * Copyright (c) 2011 Regents of the University of California 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 424 unchanged lines hidden (view full) --- 433 .prereq(timesIdled); 434 435 idleCycles 436 .name(name() + ".idleCycles") 437 .desc("Total number of cycles that the CPU has spent unscheduled due " 438 "to idling") 439 .prereq(idleCycles); 440 | 1/* 2 * Copyright (c) 2004-2006 The Regents of The University of Michigan 3 * Copyright (c) 2011 Regents of the University of California 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 424 unchanged lines hidden (view full) --- 433 .prereq(timesIdled); 434 435 idleCycles 436 .name(name() + ".idleCycles") 437 .desc("Total number of cycles that the CPU has spent unscheduled due " 438 "to idling") 439 .prereq(idleCycles); 440 |
441 quiesceCycles 442 .name(name() + ".quiesceCycles") 443 .desc("Total number of cycles that CPU has spent quiesced or waiting " 444 "for an interrupt") 445 .prereq(quiesceCycles); 446 |
|
441 // Number of Instructions simulated 442 // -------------------------------- 443 // Should probably be in Base CPU but need templated 444 // MaxThreads so put in here instead 445 committedInsts 446 .init(numThreads) 447 .name(name() + ".committedInsts") 448 .desc("Number of Instructions Simulated"); --- 228 unchanged lines hidden (view full) --- 677 if (lastActivatedCycle < curTick()) { 678 scheduleTickEvent(delay); 679 680 // Be sure to signal that there's some activity so the CPU doesn't 681 // deschedule itself. 682 activityRec.activity(); 683 fetch.wakeFromQuiesce(); 684 | 447 // Number of Instructions simulated 448 // -------------------------------- 449 // Should probably be in Base CPU but need templated 450 // MaxThreads so put in here instead 451 committedInsts 452 .init(numThreads) 453 .name(name() + ".committedInsts") 454 .desc("Number of Instructions Simulated"); --- 228 unchanged lines hidden (view full) --- 683 if (lastActivatedCycle < curTick()) { 684 scheduleTickEvent(delay); 685 686 // Be sure to signal that there's some activity so the CPU doesn't 687 // deschedule itself. 688 activityRec.activity(); 689 fetch.wakeFromQuiesce(); 690 |
691 quiesceCycles += tickToCycles((curTick() - 1) - lastRunningCycle); 692 |
|
685 lastActivatedCycle = curTick(); 686 687 _status = Running; 688 } 689} 690 691template <class Impl> 692bool --- 18 unchanged lines hidden (view full) --- 711FullO3CPU<Impl>::suspendContext(ThreadID tid) 712{ 713 DPRINTF(O3CPU,"[tid: %i]: Suspending Thread Context.\n", tid); 714 bool deallocated = deallocateContext(tid, false, 1); 715 // If this was the last thread then unschedule the tick event. 716 if ((activeThreads.size() == 1 && !deallocated) || 717 activeThreads.size() == 0) 718 unscheduleTickEvent(); | 693 lastActivatedCycle = curTick(); 694 695 _status = Running; 696 } 697} 698 699template <class Impl> 700bool --- 18 unchanged lines hidden (view full) --- 719FullO3CPU<Impl>::suspendContext(ThreadID tid) 720{ 721 DPRINTF(O3CPU,"[tid: %i]: Suspending Thread Context.\n", tid); 722 bool deallocated = deallocateContext(tid, false, 1); 723 // If this was the last thread then unschedule the tick event. 724 if ((activeThreads.size() == 1 && !deallocated) || 725 activeThreads.size() == 0) 726 unscheduleTickEvent(); |
727 728 DPRINTF(Quiesce, "Suspending Context\n"); 729 lastRunningCycle = curTick(); |
|
719 _status = Idle; 720} 721 722template <class Impl> 723void 724FullO3CPU<Impl>::haltContext(ThreadID tid) 725{ 726 //For now, this is the same as deallocate --- 461 unchanged lines hidden (view full) --- 1188 ThreadContext *tc = threadContexts[i]; 1189 if (tc->status() == ThreadContext::Active && _status != Running) { 1190 _status = Running; 1191 reschedule(tickEvent, nextCycle(), true); 1192 } 1193 } 1194 if (!tickEvent.scheduled()) 1195 schedule(tickEvent, nextCycle()); | 730 _status = Idle; 731} 732 733template <class Impl> 734void 735FullO3CPU<Impl>::haltContext(ThreadID tid) 736{ 737 //For now, this is the same as deallocate --- 461 unchanged lines hidden (view full) --- 1199 ThreadContext *tc = threadContexts[i]; 1200 if (tc->status() == ThreadContext::Active && _status != Running) { 1201 _status = Running; 1202 reschedule(tickEvent, nextCycle(), true); 1203 } 1204 } 1205 if (!tickEvent.scheduled()) 1206 schedule(tickEvent, nextCycle()); |
1207 1208 lastRunningCycle = curTick(); |
|
1196} 1197 1198template <class Impl> 1199TheISA::MiscReg 1200FullO3CPU<Impl>::readMiscRegNoEffect(int misc_reg, ThreadID tid) 1201{ 1202 return this->isa[tid].readMiscRegNoEffect(misc_reg); 1203} --- 449 unchanged lines hidden --- | 1209} 1210 1211template <class Impl> 1212TheISA::MiscReg 1213FullO3CPU<Impl>::readMiscRegNoEffect(int misc_reg, ThreadID tid) 1214{ 1215 return this->isa[tid].readMiscRegNoEffect(misc_reg); 1216} --- 449 unchanged lines hidden --- |