1/* 2 * Copyright 2014 Google, Inc. 3 * Copyright (c) 2010-2013,2015,2017 ARM Limited 4 * All rights reserved 5 * 6 * The license below extends only to copyright in the software and shall 7 * not be construed as granting a license to any other intellectual 8 * property including but not limited to intellectual property relating --- 666 unchanged lines hidden (view full) --- 675TimingSimpleCPU::advanceInst(const Fault &fault) 676{ 677 SimpleExecContext &t_info = *threadInfo[curThread]; 678 679 if (_status == Faulting) 680 return; 681 682 if (fault != NoFault) { |
683 DPRINTF(SimpleCPU, "Fault occured. Handling the fault\n"); |
684 685 advancePC(fault); 686 |
687 // A syscall fault could suspend this CPU (e.g., futex_wait) 688 // If the _status is not Idle, schedule an event to fetch the next 689 // instruction after 'stall' ticks. 690 // If the cpu has been suspended (i.e., _status == Idle), another 691 // cpu will wake this cpu up later. 692 if (_status != Idle) { 693 DPRINTF(SimpleCPU, "Scheduling fetch event after the Fault\n"); |
694 |
695 Tick stall = dynamic_pointer_cast<SyscallRetryFault>(fault) ? 696 clockEdge(syscallRetryLatency) : clockEdge(); 697 reschedule(fetchEvent, stall, true); 698 _status = Faulting; 699 } |
700 |
701 return; 702 } 703 |
704 if (!t_info.stayAtPC) 705 advancePC(fault); 706 707 if (tryCompleteDrain()) |
708 return; |
709 710 if (_status == BaseSimpleCPU::Running) { 711 // kick off fetch of next instruction... callback from icache 712 // response will cause that instruction to be executed, 713 // keeping the CPU running. 714 fetch(); 715 } 716} --- 312 unchanged lines hidden --- |