base.cc (10786:ee82c2c30421) base.cc (10905:a6ca6831e775)
1/*
2 * Copyright (c) 2011-2012 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

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

635 ThreadContext *tc = cpu->threadContexts[i];
636 tc->profileSample();
637 }
638
639 cpu->schedule(this, curTick() + interval);
640}
641
642void
1/*
2 * Copyright (c) 2011-2012 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

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

635 ThreadContext *tc = cpu->threadContexts[i];
636 tc->profileSample();
637 }
638
639 cpu->schedule(this, curTick() + interval);
640}
641
642void
643BaseCPU::serialize(std::ostream &os)
643BaseCPU::serialize(CheckpointOut &cp) const
644{
645 SERIALIZE_SCALAR(instCnt);
646
647 if (!_switchedOut) {
648 /* Unlike _pid, _taskId is not serialized, as they are dynamically
649 * assigned unique ids that are only meaningful for the duration of
650 * a specific run. We will need to serialize the entire taskMap in
651 * system. */
652 SERIALIZE_SCALAR(_pid);
653
644{
645 SERIALIZE_SCALAR(instCnt);
646
647 if (!_switchedOut) {
648 /* Unlike _pid, _taskId is not serialized, as they are dynamically
649 * assigned unique ids that are only meaningful for the duration of
650 * a specific run. We will need to serialize the entire taskMap in
651 * system. */
652 SERIALIZE_SCALAR(_pid);
653
654 interrupts->serialize(os);
654 interrupts->serialize(cp);
655
656 // Serialize the threads, this is done by the CPU implementation.
657 for (ThreadID i = 0; i < numThreads; ++i) {
655
656 // Serialize the threads, this is done by the CPU implementation.
657 for (ThreadID i = 0; i < numThreads; ++i) {
658 nameOut(os, csprintf("%s.xc.%i", name(), i));
659 serializeThread(os, i);
658 ScopedCheckpointSection sec(cp, csprintf("xc.%i", i));
659 serializeThread(cp, i);
660 }
661 }
662}
663
664void
660 }
661 }
662}
663
664void
665BaseCPU::unserialize(Checkpoint *cp, const std::string &section)
665BaseCPU::unserialize(CheckpointIn &cp)
666{
667 UNSERIALIZE_SCALAR(instCnt);
668
669 if (!_switchedOut) {
670 UNSERIALIZE_SCALAR(_pid);
666{
667 UNSERIALIZE_SCALAR(instCnt);
668
669 if (!_switchedOut) {
670 UNSERIALIZE_SCALAR(_pid);
671 interrupts->unserialize(cp, section);
671 interrupts->unserialize(cp);
672
673 // Unserialize the threads, this is done by the CPU implementation.
672
673 // Unserialize the threads, this is done by the CPU implementation.
674 for (ThreadID i = 0; i < numThreads; ++i)
675 unserializeThread(cp, csprintf("%s.xc.%i", section, i), i);
674 for (ThreadID i = 0; i < numThreads; ++i) {
675 ScopedCheckpointSection sec(cp, csprintf("xc.%i", i));
676 unserializeThread(cp, i);
677 }
676 }
677}
678
679void
680BaseCPU::scheduleInstStop(ThreadID tid, Counter insts, const char *cause)
681{
682 const Tick now(comInstEventQueue[tid]->getCurTick());
683 Event *event(new LocalSimLoopExitEvent(cause, 0));

--- 59 unchanged lines hidden ---
678 }
679}
680
681void
682BaseCPU::scheduleInstStop(ThreadID tid, Counter insts, const char *cause)
683{
684 const Tick now(comInstEventQueue[tid]->getCurTick());
685 Event *event(new LocalSimLoopExitEvent(cause, 0));

--- 59 unchanged lines hidden ---