timing.cc (12749:223c83ed9979) | timing.cc (12769:f9c0d0a09dac) |
---|---|
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) { | 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, scheduling fetch event\n"); | 683 DPRINTF(SimpleCPU, "Fault occured. Handling the fault\n"); |
684 685 advancePC(fault); 686 | 684 685 advancePC(fault); 686 |
687 Tick stall = dynamic_pointer_cast<SyscallRetryFault>(fault) ? 688 clockEdge(syscallRetryLatency) : clockEdge(); | 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"); |
689 | 694 |
690 reschedule(fetchEvent, stall, true); | 695 Tick stall = dynamic_pointer_cast<SyscallRetryFault>(fault) ? 696 clockEdge(syscallRetryLatency) : clockEdge(); 697 reschedule(fetchEvent, stall, true); 698 _status = Faulting; 699 } |
691 | 700 |
692 _status = Faulting; | |
693 return; 694 } 695 | 701 return; 702 } 703 |
696 | |
697 if (!t_info.stayAtPC) 698 advancePC(fault); 699 700 if (tryCompleteDrain()) | 704 if (!t_info.stayAtPC) 705 advancePC(fault); 706 707 if (tryCompleteDrain()) |
701 return; | 708 return; |
702 703 if (_status == BaseSimpleCPU::Running) { 704 // kick off fetch of next instruction... callback from icache 705 // response will cause that instruction to be executed, 706 // keeping the CPU running. 707 fetch(); 708 } 709} --- 312 unchanged lines hidden --- | 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 --- |