Deleted Added
sdiff udiff text old ( 8232:b28d06a175be ) new ( 8276:66bb0d8ae8bf )
full compact
1/*
2 * Copyright (c) 2010 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

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

720 // We must have just got suspended by a PC event
721 if (_status == Idle)
722 return;
723
724 TheISA::PCState pcState = thread->pcState();
725 bool needToFetch = !isRomMicroPC(pcState.microPC()) && !curMacroStaticInst;
726
727 if (needToFetch) {
728 Request *ifetch_req = new Request();
729 ifetch_req->setThreadContext(_cpuId, /* thread ID */ 0);
730 setupFetchRequest(ifetch_req);
731 thread->itb->translateTiming(ifetch_req, tc, &fetchTranslation,
732 BaseTLB::Execute);
733 } else {
734 _status = IcacheWaitResponse;
735 completeIfetch(NULL);

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

766 numCycles += tickToCycles(curTick() - previousTick);
767 previousTick = curTick();
768}
769
770
771void
772TimingSimpleCPU::advanceInst(Fault fault)
773{
774 if (fault != NoFault || !stayAtPC)
775 advancePC(fault);
776
777 if (_status == Running) {
778 // kick off fetch of next instruction... callback from icache
779 // response will cause that instruction to be executed,
780 // keeping the CPU running.
781 fetch();
782 }
783}
784
785
786void
787TimingSimpleCPU::completeIfetch(PacketPtr pkt)
788{
789 DPRINTF(SimpleCPU, "Complete ICache Fetch\n");
790
791 // received a response from the icache: execute the received
792 // instruction
793
794 assert(!pkt || !pkt->isError());
795 assert(_status == IcacheWaitResponse);
796
797 _status = Running;
798

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

873 Tick next_tick = cpu->nextCycle(curTick());
874
875 if (next_tick == curTick())
876 cpu->completeIfetch(pkt);
877 else
878 tickEvent.schedule(pkt, next_tick);
879
880 return true;
881 }
882 else if (pkt->wasNacked()) {
883 assert(cpu->_status == IcacheWaitResponse);
884 pkt->reinitNacked();
885 if (!sendTiming(pkt)) {
886 cpu->_status = IcacheRetry;
887 cpu->ifetch_pkt = pkt;
888 }
889 }
890 //Snooping a Coherence Request, do nothing

--- 236 unchanged lines hidden ---