base.cc (12122:20512f6810d7) base.cc (12127:4207df055b0d)
1/*
2 * Copyright (c) 2011-2012,2016 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

243 "per thread (%i)\n",
244 name(), interrupts.size(), numThreads);
245 for (ThreadID tid = 0; tid < numThreads; tid++)
246 interrupts[tid]->setCPU(this);
247 }
248
249 if (FullSystem) {
250 if (params()->profile)
1/*
2 * Copyright (c) 2011-2012,2016 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

243 "per thread (%i)\n",
244 name(), interrupts.size(), numThreads);
245 for (ThreadID tid = 0; tid < numThreads; tid++)
246 interrupts[tid]->setCPU(this);
247 }
248
249 if (FullSystem) {
250 if (params()->profile)
251 profileEvent = new ProfileEvent(this, params()->profile);
251 profileEvent = new EventFunctionWrapper(
252 [this]{ processProfileEvent(); },
253 name());
252 }
253 tracer = params()->tracer;
254
255 if (params()->isa.size() != numThreads) {
256 fatal("Number of ISAs (%i) assigned to the CPU does not equal number "
257 "of threads (%i).\n", params()->isa.size(), numThreads);
258 }
259}

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

653 tc.getDTBPtr()->flushAll();
654 if (checker) {
655 checker->getITBPtr()->flushAll();
656 checker->getDTBPtr()->flushAll();
657 }
658 }
659}
660
254 }
255 tracer = params()->tracer;
256
257 if (params()->isa.size() != numThreads) {
258 fatal("Number of ISAs (%i) assigned to the CPU does not equal number "
259 "of threads (%i).\n", params()->isa.size(), numThreads);
260 }
261}

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

655 tc.getDTBPtr()->flushAll();
656 if (checker) {
657 checker->getITBPtr()->flushAll();
658 checker->getDTBPtr()->flushAll();
659 }
660 }
661}
662
661
662BaseCPU::ProfileEvent::ProfileEvent(BaseCPU *_cpu, Tick _interval)
663 : cpu(_cpu), interval(_interval)
664{ }
665
666void
663void
667BaseCPU::ProfileEvent::process()
664BaseCPU::processProfileEvent()
668{
665{
669 ThreadID size = cpu->threadContexts.size();
670 for (ThreadID i = 0; i < size; ++i) {
671 ThreadContext *tc = cpu->threadContexts[i];
672 tc->profileSample();
673 }
666 ThreadID size = threadContexts.size();
674
667
675 cpu->schedule(this, curTick() + interval);
668 for (ThreadID i = 0; i < size; ++i)
669 threadContexts[i]->profileSample();
670
671 schedule(profileEvent, curTick() + params()->profile);
676}
677
678void
679BaseCPU::serialize(CheckpointOut &cp) const
680{
681 SERIALIZE_SCALAR(instCnt);
682
683 if (!_switchedOut) {

--- 108 unchanged lines hidden ---
672}
673
674void
675BaseCPU::serialize(CheckpointOut &cp) const
676{
677 SERIALIZE_SCALAR(instCnt);
678
679 if (!_switchedOut) {

--- 108 unchanged lines hidden ---