}
void
-Stage2LookUp::finish(Fault _fault, RequestPtr req,
+Stage2LookUp::finish(const Fault &_fault, RequestPtr req,
ThreadContext *tc, BaseTLB::Mode mode)
{
fault = _fault;
void markDelayed() {}
- void finish(Fault fault, RequestPtr req, ThreadContext *tc,
+ void finish(const Fault &fault, RequestPtr req, ThreadContext *tc,
BaseTLB::Mode mode);
};
}
void
-Stage2MMU::Stage2Translation::finish(Fault _fault, RequestPtr req, ThreadContext *tc,
- BaseTLB::Mode mode)
+Stage2MMU::Stage2Translation::finish(const Fault &_fault, RequestPtr req,
+ ThreadContext *tc, BaseTLB::Mode mode)
{
fault = _fault;
markDelayed() {}
void
- finish(Fault fault, RequestPtr req, ThreadContext *tc,
+ finish(const Fault &fault, RequestPtr req, ThreadContext *tc,
BaseTLB::Mode mode);
void setVirt(Addr vaddr, int size, Request::Flags flags, int masterId)
void switchOut();
void takeOverFrom(BaseCPU *oldCPU);
- void advancePC(Fault fault);
+ void advancePC(const Fault &fault);
void verify(DynInstPtr &inst);
template <class Impl>
void
-Checker<Impl>::advancePC(Fault fault)
+Checker<Impl>::advancePC(const Fault &fault)
{
if (fault != NoFault) {
curMacroStaticInst = StaticInst::nullStaticInstPtr;
}
InOrderCPU::CPUEvent::CPUEvent(InOrderCPU *_cpu, CPUEventType e_type,
- Fault fault, ThreadID _tid, DynInstPtr inst,
- CPUEventPri event_pri)
+ const Fault &fault, ThreadID _tid,
+ DynInstPtr inst, CPUEventPri event_pri)
: Event(event_pri), cpu(_cpu)
{
setEvent(e_type, fault, _tid, inst);
}
void
-InOrderCPU::processInterrupts(Fault interrupt)
+InOrderCPU::processInterrupts(const Fault &interrupt)
{
// Check for interrupts here. For now can copy the code that
// exists within isa_fullsys_traits.hh. Also assume that thread 0
}
void
-InOrderCPU::trapContext(Fault fault, ThreadID tid, DynInstPtr inst,
+InOrderCPU::trapContext(const Fault &fault, ThreadID tid, DynInstPtr inst,
Cycles delay)
{
scheduleCpuEvent(Trap, fault, tid, inst, delay);
}
void
-InOrderCPU::trap(Fault fault, ThreadID tid, DynInstPtr inst)
+InOrderCPU::trap(const Fault &fault, ThreadID tid, DynInstPtr inst)
{
fault->invoke(tcBase(tid), inst->staticInst);
removePipelineStalls(tid);
}
void
-InOrderCPU::scheduleCpuEvent(CPUEventType c_event, Fault fault,
+InOrderCPU::scheduleCpuEvent(CPUEventType c_event, const Fault &fault,
ThreadID tid, DynInstPtr inst,
Cycles delay, CPUEventPri event_pri)
{
}
void
-InOrderCPU::syscallContext(Fault fault, ThreadID tid, DynInstPtr inst,
+InOrderCPU::syscallContext(const Fault &fault, ThreadID tid, DynInstPtr inst,
Cycles delay)
{
// Syscall must be non-speculative, so squash from last stage
public:
/** Constructs a CPU event. */
- CPUEvent(InOrderCPU *_cpu, CPUEventType e_type, Fault fault,
+ CPUEvent(InOrderCPU *_cpu, CPUEventType e_type, const Fault &fault,
ThreadID _tid, DynInstPtr inst, CPUEventPri event_pri);
/** Set Type of Event To Be Scheduled */
- void setEvent(CPUEventType e_type, Fault _fault, ThreadID _tid,
+ void setEvent(CPUEventType e_type, const Fault &_fault, ThreadID _tid,
DynInstPtr _inst)
{
fault = _fault;
};
/** Schedule a CPU Event */
- void scheduleCpuEvent(CPUEventType cpu_event, Fault fault, ThreadID tid,
+ void scheduleCpuEvent(CPUEventType cpu_event, const Fault &fault,
+ ThreadID tid,
DynInstPtr inst, Cycles delay = Cycles(0),
CPUEventPri event_pri = InOrderCPU_Pri);
Fault getInterrupts();
/** Processes any an interrupt fault. */
- void processInterrupts(Fault interrupt);
+ void processInterrupts(const Fault &interrupt);
/** Halts the CPU. */
void halt() { panic("Halt not implemented!\n"); }
bool validDataAddr(Addr addr) { return true; }
/** Schedule a syscall on the CPU */
- void syscallContext(Fault fault, ThreadID tid, DynInstPtr inst,
+ void syscallContext(const Fault &fault, ThreadID tid, DynInstPtr inst,
Cycles delay = Cycles(0));
/** Executes a syscall.*/
void syscall(int64_t callnum, ThreadID tid);
/** Schedule a trap on the CPU */
- void trapContext(Fault fault, ThreadID tid, DynInstPtr inst,
+ void trapContext(const Fault &fault, ThreadID tid, DynInstPtr inst,
Cycles delay = Cycles(0));
/** Perform trap to Handle Given Fault */
- void trap(Fault fault, ThreadID tid, DynInstPtr inst);
+ void trap(const Fault &fault, ThreadID tid, DynInstPtr inst);
/** Schedule thread activation on the CPU */
void activateContext(ThreadID tid, Cycles delay = Cycles(0));
void
-InOrderDynInst::trap(Fault fault)
+InOrderDynInst::trap(const Fault &fault)
{
this->cpu->trap(fault, this->threadNumber, this);
}
/** Calls hardware return from error interrupt. */
Fault hwrei();
/** Traps to handle specified fault. */
- void trap(Fault fault);
+ void trap(const Fault &fault);
bool simPalCheck(int palFunc);
short syscallNum;
virtual void instGraduated(InstSeqNum seq_num, ThreadID tid) { }
/** Post-processsing for Trap Generated from this instruction */
- virtual void trap(Fault fault, ThreadID tid, DynInstPtr inst) { }
+ virtual void trap(const Fault &fault, ThreadID tid, DynInstPtr inst) { }
/** Request usage of this resource. Returns a ResourceRequest object
* with all the necessary resource information
}
void
-ResourcePool::trap(Fault fault, ThreadID tid, DynInstPtr inst)
+ResourcePool::trap(const Fault &fault, ThreadID tid, DynInstPtr inst)
{
DPRINTF(Resource, "[tid:%i] Broadcasting Trap to all "
"resources.\n", tid);
void instGraduated(InstSeqNum seq_num, ThreadID tid);
/** Broadcast trap to all resources */
- void trap(Fault fault, ThreadID tid, DynInstPtr inst);
+ void trap(const Fault &fault, ThreadID tid, DynInstPtr inst);
/** The number of instructions available that a resource can
* can still process.
}
void
-CacheUnit::trap(Fault fault, ThreadID tid, DynInstPtr inst)
+CacheUnit::trap(const Fault &fault, ThreadID tid, DynInstPtr inst)
{
tlbBlocked[tid] = false;
}
bool processSquash(CacheReqPacket *cache_pkt);
- void trap(Fault fault, ThreadID tid, DynInstPtr inst);
+ void trap(const Fault &fault, ThreadID tid, DynInstPtr inst);
void recvRetry();
}
void
-FetchSeqUnit::trap(Fault fault, ThreadID tid, DynInstPtr inst)
+FetchSeqUnit::trap(const Fault &fault, ThreadID tid, DynInstPtr inst)
{
pcValid[tid] = true;
pc[tid] = cpu->pcState(tid);
InstSeqNum squash_seq_num, ThreadID tid);
/** Update to correct PC from a trap */
- void trap(Fault fault, ThreadID tid, DynInstPtr inst);
+ void trap(const Fault &fault, ThreadID tid, DynInstPtr inst);
protected:
unsigned instSize;
}
void
-FetchUnit::trap(Fault fault, ThreadID tid, DynInstPtr inst)
+FetchUnit::trap(const Fault &fault, ThreadID tid, DynInstPtr inst)
{
//@todo: per thread?
decoder[tid]->reset();
/** Executes one of the commands from the "Command" enum */
void execute(int slot_num);
- void trap(Fault fault, ThreadID tid, DynInstPtr inst);
+ void trap(const Fault &fault, ThreadID tid, DynInstPtr inst);
TheISA::Decoder *decoder[ThePipeline::MaxThreads];
}
void
-Fetch1::FetchRequest::finish(
- Fault fault_, RequestPtr request_, ThreadContext *tc, BaseTLB::Mode mode)
+Fetch1::FetchRequest::finish(const Fault &fault_, RequestPtr request_,
+ ThreadContext *tc, BaseTLB::Mode mode)
{
fault = fault_;
/** Interface for ITLB responses. Populates self and then passes
* the request on to the ports' handleTLBResponse member
* function */
- void finish(Fault fault_, RequestPtr request_, ThreadContext *tc,
- BaseTLB::Mode mode);
+ void finish(const Fault &fault_, RequestPtr request_,
+ ThreadContext *tc, BaseTLB::Mode mode);
public:
FetchRequest(Fetch1 &fetch_, InstId id_, TheISA::PCState pc_) :
}
void
-LSQ::SingleDataRequest::finish(Fault fault_, RequestPtr request_,
- ThreadContext *tc, BaseTLB::Mode mode)
+LSQ::SingleDataRequest::finish(const Fault &fault_, RequestPtr request_,
+ ThreadContext *tc, BaseTLB::Mode mode)
{
fault = fault_;
}
void
-LSQ::SplitDataRequest::finish(Fault fault_, RequestPtr request_,
- ThreadContext *tc, BaseTLB::Mode mode)
+LSQ::SplitDataRequest::finish(const Fault &fault_, RequestPtr request_,
+ ThreadContext *tc, BaseTLB::Mode mode)
{
fault = fault_;
{
protected:
/** TLB interace */
- void finish(Fault fault_, RequestPtr request_, ThreadContext *tc,
- BaseTLB::Mode mode)
+ void finish(const Fault &fault_, RequestPtr request_,
+ ThreadContext *tc, BaseTLB::Mode mode)
{ }
public:
{
protected:
/** TLB interace */
- void finish(Fault fault_, RequestPtr request_, ThreadContext *tc,
- BaseTLB::Mode mode);
+ void finish(const Fault &fault_, RequestPtr request_,
+ ThreadContext *tc, BaseTLB::Mode mode);
/** Has my only packet been sent to the memory system but has not
* yet been responded to */
protected:
/** TLB response interface */
- void finish(Fault fault_, RequestPtr request_, ThreadContext *tc,
- BaseTLB::Mode mode);
+ void finish(const Fault &fault_, RequestPtr request_,
+ ThreadContext *tc, BaseTLB::Mode mode);
public:
SplitDataRequest(LSQ &port_, MinorDynInstPtr inst_,
template <class Impl>
void
-FullO3CPU<Impl>::processInterrupts(Fault interrupt)
+FullO3CPU<Impl>::processInterrupts(const Fault &interrupt)
{
// Check for interrupts here. For now can copy the code that
// exists within isa_fullsys_traits.hh. Also assume that thread 0
template <class Impl>
void
-FullO3CPU<Impl>::trap(Fault fault, ThreadID tid, StaticInstPtr inst)
+FullO3CPU<Impl>::trap(const Fault &fault, ThreadID tid, StaticInstPtr inst)
{
// Pass the thread's TC into the invoke method.
fault->invoke(this->threadContexts[tid], inst);
{ return globalSeqNum++; }
/** Traps to handle given fault. */
- void trap(Fault fault, ThreadID tid, StaticInstPtr inst);
+ void trap(const Fault &fault, ThreadID tid, StaticInstPtr inst);
/** HW return from error interrupt. */
Fault hwrei(ThreadID tid);
Fault getInterrupts();
/** Processes any an interrupt fault. */
- void processInterrupts(Fault interrupt);
+ void processInterrupts(const Fault &interrupt);
/** Halts the CPU. */
void halt() { panic("Halt not implemented!\n"); }
/** Calls hardware return from error interrupt. */
Fault hwrei();
/** Traps to handle specified fault. */
- void trap(Fault fault);
+ void trap(const Fault &fault);
bool simPalCheck(int palFunc);
/** Emulates a syscall. */
template <class Impl>
void
-BaseO3DynInst<Impl>::trap(Fault fault)
+BaseO3DynInst<Impl>::trap(const Fault &fault)
{
this->cpu->trap(fault, this->threadNumber, this->staticInst);
}
{}
void
- finish(Fault fault, RequestPtr req, ThreadContext *tc,
+ finish(const Fault &fault, RequestPtr req, ThreadContext *tc,
BaseTLB::Mode mode)
{
assert(mode == BaseTLB::Execute);
* @return Any fault that occured.
*/
bool fetchCacheLine(Addr vaddr, ThreadID tid, Addr pc);
- void finishTranslation(Fault fault, RequestPtr mem_req);
+ void finishTranslation(const Fault &fault, RequestPtr mem_req);
/** Check if an interrupt is pending and that we need to handle
template <class Impl>
void
-DefaultFetch<Impl>::finishTranslation(Fault fault, RequestPtr mem_req)
+DefaultFetch<Impl>::finishTranslation(const Fault &fault, RequestPtr mem_req)
{
ThreadID tid = mem_req->threadId();
Addr fetchBufferBlockPC = mem_req->getVaddr();
template <class Impl>
void
-OzoneDynInst<Impl>::trap(Fault fault)
+OzoneDynInst<Impl>::trap(const Fault &fault)
{
fault->invoke(this->thread->getTC());
}
}
void
-BaseSimpleCPU::advancePC(Fault fault)
+BaseSimpleCPU::advancePC(const Fault &fault)
{
const bool branching(thread->pcState().branching());
void setupFetchRequest(Request *req);
void preExecute();
void postExecute();
- void advancePC(Fault fault);
+ void advancePC(const Fault &fault);
virtual void deallocateContext(ThreadID thread_num);
virtual void haltContext(ThreadID thread_num);
}
void
-TimingSimpleCPU::translationFault(Fault fault)
+TimingSimpleCPU::translationFault(const Fault &fault)
{
// fault may be NoFault in cases where a fault is suppressed,
// for instance prefetches.
void
-TimingSimpleCPU::sendFetch(Fault fault, RequestPtr req, ThreadContext *tc)
+TimingSimpleCPU::sendFetch(const Fault &fault, RequestPtr req,
+ ThreadContext *tc)
{
if (fault == NoFault) {
DPRINTF(SimpleCPU, "Sending fetch for addr %#x(pa: %#x)\n",
void
-TimingSimpleCPU::advanceInst(Fault fault)
+TimingSimpleCPU::advanceInst(const Fault &fault)
{
if (_status == Faulting)
return;
}
void
- finish(Fault fault, RequestPtr req, ThreadContext *tc,
+ finish(const Fault &fault, RequestPtr req, ThreadContext *tc,
BaseTLB::Mode mode)
{
cpu->sendFetch(fault, req, tc);
void sendSplitData(RequestPtr req1, RequestPtr req2, RequestPtr req,
uint8_t *data, bool read);
- void translationFault(Fault fault);
+ void translationFault(const Fault &fault);
void buildPacket(PacketPtr &pkt, RequestPtr req, bool read);
void buildSplitPacket(PacketPtr &pkt1, PacketPtr &pkt2,
Addr addr, unsigned flags, uint64_t *res);
void fetch();
- void sendFetch(Fault fault, RequestPtr req, ThreadContext *tc);
+ void sendFetch(const Fault &fault, RequestPtr req, ThreadContext *tc);
void completeIfetch(PacketPtr );
void completeDataAccess(PacketPtr pkt);
- void advanceInst(Fault fault);
+ void advanceInst(const Fault &fault);
/** This function is used by the page table walker to determine if it could
* translate the a pending request or if the underlying request has been
* request to make it easier to access them later on.
*/
bool
- finish(Fault fault, int index)
+ finish(const Fault &fault, int index)
{
assert(outstanding);
faults[index] = fault;
* translation is complete if the state says so.
*/
void
- finish(Fault fault, RequestPtr req, ThreadContext *tc,
+ finish(const Fault &fault, RequestPtr req, ThreadContext *tc,
BaseTLB::Mode mode)
{
assert(state);
* be responsible for cleaning itself up which will happen in this
* function. Once it's called, the object is no longer valid.
*/
- virtual void finish(Fault fault, RequestPtr req, ThreadContext *tc,
- Mode mode) = 0;
+ virtual void finish(const Fault &fault, RequestPtr req,
+ ThreadContext *tc, Mode mode) = 0;
/** This function is used by the page table walker to determine if it
* should translate the a pending request or if the underlying request