inorder: cleanup virtual functions

remove the annotation 'virtual' from  function declaration that isnt being derived from
This commit is contained in:
Korey Sewell 2010-06-24 15:34:19 -04:00
parent f95430d97e
commit 71b67d408b
16 changed files with 131 additions and 140 deletions

View file

@ -222,10 +222,10 @@ class InOrderCPU : public BaseCPU
vpe = 0; vpe = 0;
} }
/** Processes a resource event. */ /** Processes a CPU event. */
virtual void process(); void process();
/** Returns the description of the resource event. */ /** Returns the description of the CPU event. */
const char *description(); const char *description();
/** Schedule Event */ /** Schedule Event */

View file

@ -106,9 +106,7 @@ class PipelineStage
void regStats(); void regStats();
/** Sets CPU pointer. */ /** Sets CPU pointer. */
virtual void setCPU(InOrderCPU *cpu_ptr); void setCPU(InOrderCPU *cpu_ptr);
virtual void scheduleStageStart(int delay, ThreadID tid) { }
/** Sets the main backwards communication time buffer pointer. */ /** Sets the main backwards communication time buffer pointer. */
void setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr); void setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr);
@ -145,7 +143,7 @@ class PipelineStage
/** Ticks stage, processing all input signals and executing as many /** Ticks stage, processing all input signals and executing as many
* instructions as possible. * instructions as possible.
*/ */
virtual void tick(); void tick();
/** Set a resource stall in the pipeline-stage */ /** Set a resource stall in the pipeline-stage */
void setResStall(ResReqPtr res_req, ThreadID tid); void setResStall(ResReqPtr res_req, ThreadID tid);
@ -154,7 +152,7 @@ class PipelineStage
void unsetResStall(ResReqPtr res_req, ThreadID tid); void unsetResStall(ResReqPtr res_req, ThreadID tid);
/** Remove all stall signals for a particular thread; */ /** Remove all stall signals for a particular thread; */
virtual void removeStalls(ThreadID tid); void removeStalls(ThreadID tid);
/** Is there room in the stage buffer? */ /** Is there room in the stage buffer? */
int stageBufferAvail(); int stageBufferAvail();
@ -168,7 +166,7 @@ class PipelineStage
* change (ie switching from from blocking to unblocking). * change (ie switching from from blocking to unblocking).
* @param tid Thread id to stage instructions from. * @param tid Thread id to stage instructions from.
*/ */
virtual void processThread(bool &status_change, ThreadID tid); void processThread(bool &status_change, ThreadID tid);
/** Processes instructions from fetch and passes them on to rename. /** Processes instructions from fetch and passes them on to rename.
* Decoding of instructions actually happens when they are created in * Decoding of instructions actually happens when they are created in
@ -178,13 +176,13 @@ class PipelineStage
virtual void processInsts(ThreadID tid); virtual void processInsts(ThreadID tid);
/** Process all resources on an instruction's resource schedule */ /** Process all resources on an instruction's resource schedule */
virtual bool processInstSchedule(DynInstPtr inst, int &reqs_processed); bool processInstSchedule(DynInstPtr inst, int &reqs_processed);
/** Is there room in the next stage buffer for this instruction? */ /** Is there room in the next stage buffer for this instruction? */
virtual bool canSendInstToStage(unsigned stage_num); bool canSendInstToStage(unsigned stage_num);
/** Send an instruction to the next stage buffer */ /** Send an instruction to the next stage buffer */
virtual bool sendInstToNextStage(DynInstPtr inst); bool sendInstToNextStage(DynInstPtr inst);
/** Inserts a thread's instructions into the skid buffer, to be staged /** Inserts a thread's instructions into the skid buffer, to be staged
* once stage unblocks. * once stage unblocks.
@ -198,7 +196,7 @@ class PipelineStage
bool skidsEmpty(); bool skidsEmpty();
/** Updates overall stage status based on all of the threads' statuses. */ /** Updates overall stage status based on all of the threads' statuses. */
virtual void updateStatus(); void updateStatus();
/** Separates instructions from fetch into individual lists of instructions /** Separates instructions from fetch into individual lists of instructions
* sorted by thread. * sorted by thread.
@ -206,13 +204,13 @@ class PipelineStage
void sortInsts(); void sortInsts();
/** Reads all stall signals from the backwards communication timebuffer. */ /** Reads all stall signals from the backwards communication timebuffer. */
virtual void readStallSignals(ThreadID tid); void readStallSignals(ThreadID tid);
/** Checks all input signals and updates stage's status appropriately. */ /** Checks all input signals and updates stage's status appropriately. */
virtual bool checkSignalsAndUpdate(ThreadID tid); bool checkSignalsAndUpdate(ThreadID tid);
/** Checks all stall signals, and returns if any are true. */ /** Checks all stall signals, and returns if any are true. */
virtual bool checkStall(ThreadID tid) const; bool checkStall(ThreadID tid) const;
/** Returns if there any instructions from the previous stage /** Returns if there any instructions from the previous stage
* on this cycle. * on this cycle.
@ -223,7 +221,7 @@ class PipelineStage
* become blocked. * become blocked.
* @return Returns true if there is a status change. * @return Returns true if there is a status change.
*/ */
virtual bool block(ThreadID tid); bool block(ThreadID tid);
void blockDueToBuffer(ThreadID tid); void blockDueToBuffer(ThreadID tid);
@ -231,21 +229,21 @@ class PipelineStage
* signals back that stage has unblocked. * signals back that stage has unblocked.
* @return Returns true if there is a status change. * @return Returns true if there is a status change.
*/ */
virtual bool unblock(ThreadID tid); bool unblock(ThreadID tid);
public: public:
virtual void activateThread(ThreadID tid); void activateThread(ThreadID tid);
/** Squashes if there is a PC-relative branch that was predicted /** Squashes if there is a PC-relative branch that was predicted
* incorrectly. Sends squash information back to fetch. * incorrectly. Sends squash information back to fetch.
*/ */
virtual void squashDueToBranch(DynInstPtr &inst, ThreadID tid); void squashDueToBranch(DynInstPtr &inst, ThreadID tid);
virtual void squashDueToMemStall(InstSeqNum seq_num, ThreadID tid); virtual void squashDueToMemStall(InstSeqNum seq_num, ThreadID tid);
/** Squash instructions from stage buffer */ /** Squash instructions from stage buffer */
virtual void squashPrevStageInsts(InstSeqNum squash_seq_num, ThreadID tid); void squashPrevStageInsts(InstSeqNum squash_seq_num, ThreadID tid);
/** Squashes due to commit signalling a squash. Changes status to /** Squashes due to commit signalling a squash. Changes status to
* squashing and clears block/unblock signals as needed. * squashing and clears block/unblock signals as needed.

View file

@ -95,8 +95,6 @@ namespace ThePipeline {
idx(_idx), priority(_priority) idx(_idx), priority(_priority)
{ } { }
virtual ~ScheduleEntry(){}
// Stage number to perform this service. // Stage number to perform this service.
int stageNum; int stageNum;

View file

@ -132,7 +132,7 @@ class Resource {
unsigned cmd); unsigned cmd);
/** Schedule Execution of This Resource For A Given Slot*/ /** Schedule Execution of This Resource For A Given Slot*/
virtual void scheduleExecution(int slot_idx); void scheduleExecution(int slot_idx);
/** Execute the function of this resource. The Default is action /** Execute the function of this resource. The Default is action
* is to do nothing. More specific models will derive from this * is to do nothing. More specific models will derive from this
@ -195,7 +195,7 @@ class Resource {
virtual ResReqPtr findRequest(DynInstPtr inst); virtual ResReqPtr findRequest(DynInstPtr inst);
/** */ /** */
virtual void rejectRequest(DynInstPtr inst); void rejectRequest(DynInstPtr inst);
/** Request a Resource again. Some resources have to special process this /** Request a Resource again. Some resources have to special process this
* in subsequent accesses. * in subsequent accesses.

View file

@ -108,7 +108,7 @@ class ResourcePool {
} }
/** Processes a resource event. */ /** Processes a resource event. */
virtual void process(); void process();
/** Returns the description of the resource event. */ /** Returns the description of the resource event. */
const char *description(); const char *description();

View file

@ -49,7 +49,6 @@ class AGENUnit : public Resource {
public: public:
AGENUnit(std::string res_name, int res_id, int res_width, AGENUnit(std::string res_name, int res_id, int res_width,
int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params); int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params);
virtual ~AGENUnit() {}
enum Command { enum Command {
GenerateAddr GenerateAddr

View file

@ -56,14 +56,14 @@ class BranchPredictor : public Resource {
BranchPredictor(std::string res_name, int res_id, int res_width, BranchPredictor(std::string res_name, int res_id, int res_width,
int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params); int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params);
virtual void regStats(); void regStats();
virtual void execute(int slot_num); void execute(int slot_num);
virtual void squash(DynInstPtr inst, int stage_num, void squash(DynInstPtr inst, int stage_num,
InstSeqNum squash_seq_num, ThreadID tid); InstSeqNum squash_seq_num, ThreadID tid);
virtual void instGraduated(InstSeqNum seq_num, ThreadID tid); void instGraduated(InstSeqNum seq_num, ThreadID tid);
protected: protected:
/** List of instructions this resource is currently /** List of instructions this resource is currently

View file

@ -101,30 +101,30 @@ class CacheUnit : public Resource
protected: protected:
/** Atomic version of receive. Panics. */ /** Atomic version of receive. Panics. */
virtual Tick recvAtomic(PacketPtr pkt); Tick recvAtomic(PacketPtr pkt);
/** Functional version of receive. Panics. */ /** Functional version of receive. Panics. */
virtual void recvFunctional(PacketPtr pkt); void recvFunctional(PacketPtr pkt);
/** Receives status change. Other than range changing, panics. */ /** Receives status change. Other than range changing, panics. */
virtual void recvStatusChange(Status status); void recvStatusChange(Status status);
/** Returns the address ranges of this device. */ /** Returns the address ranges of this device. */
virtual void getDeviceAddressRanges(AddrRangeList &resp, void getDeviceAddressRanges(AddrRangeList &resp,
AddrRangeList &snoop) AddrRangeList &snoop)
{ resp.clear(); snoop.clear(); } { resp.clear(); snoop.clear(); }
/** Timing version of receive. Handles setting fetch to the /** Timing version of receive. Handles setting fetch to the
* proper status to start fetching. */ * proper status to start fetching. */
virtual bool recvTiming(PacketPtr pkt); bool recvTiming(PacketPtr pkt);
/** Handles doing a retry of a failed fetch. */ /** Handles doing a retry of a failed fetch. */
virtual void recvRetry(); void recvRetry();
}; };
void init(); void init();
virtual ResourceRequest* getRequest(DynInstPtr _inst, int stage_num, ResourceRequest* getRequest(DynInstPtr _inst, int stage_num,
int res_idx, int slot_num, int res_idx, int slot_num,
unsigned cmd); unsigned cmd);
@ -238,7 +238,7 @@ class CacheUnitEvent : public ResourceEvent {
virtual ~CacheUnitEvent() {} virtual ~CacheUnitEvent() {}
/** Processes a resource event. */ /** Processes a resource event. */
virtual void process(); void process();
}; };
class CacheRequest : public ResourceRequest class CacheRequest : public ResourceRequest

View file

@ -49,13 +49,12 @@ class DecodeUnit : public Resource {
public: public:
DecodeUnit(std::string res_name, int res_id, int res_width, DecodeUnit(std::string res_name, int res_id, int res_width,
int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params); int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params);
virtual ~DecodeUnit() {}
enum Command { enum Command {
DecodeInst DecodeInst
}; };
virtual void execute(int slot_num); void execute(int slot_num);
void squash(DynInstPtr inst, int stage_num, InstSeqNum squash_seq_num, void squash(DynInstPtr inst, int stage_num, InstSeqNum squash_seq_num,
ThreadID tid); ThreadID tid);

View file

@ -54,13 +54,13 @@ class ExecutionUnit : public Resource {
int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params); int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params);
public: public:
virtual void regStats(); void regStats();
/** Execute the function of this resource. The Default is action /** Execute the function of this resource. The Default is action
* is to do nothing. More specific models will derive from this * is to do nothing. More specific models will derive from this
* class and define their own execute function. * class and define their own execute function.
*/ */
virtual void execute(int slot_num); void execute(int slot_num);
protected: protected:
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////

View file

@ -54,13 +54,13 @@ class FetchSeqUnit : public Resource {
public: public:
FetchSeqUnit(std::string res_name, int res_id, int res_width, FetchSeqUnit(std::string res_name, int res_id, int res_width,
int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params); int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params);
virtual ~FetchSeqUnit(); ~FetchSeqUnit();
virtual void init(); void init();
virtual void activateThread(ThreadID tid); void activateThread(ThreadID tid);
virtual void deactivateThread(ThreadID tid); void deactivateThread(ThreadID tid);
virtual void suspendThread(ThreadID tid); void suspendThread(ThreadID tid);
virtual void execute(int slot_num); void execute(int slot_num);
void updateAfterContextSwitch(DynInstPtr inst, ThreadID tid); void updateAfterContextSwitch(DynInstPtr inst, ThreadID tid);
@ -68,7 +68,7 @@ class FetchSeqUnit : public Resource {
* looks in the global communication buffer to get squash * looks in the global communication buffer to get squash
* info * info
*/ */
virtual void squash(DynInstPtr inst, int squash_stage, void squash(DynInstPtr inst, int squash_stage,
InstSeqNum squash_seq_num, ThreadID tid); InstSeqNum squash_seq_num, ThreadID tid);
@ -110,10 +110,10 @@ class FetchSeqUnit : public Resource {
public: public:
/** Constructs a resource event. */ /** Constructs a resource event. */
FetchSeqEvent(); FetchSeqEvent();
virtual ~FetchSeqEvent() {} ~FetchSeqEvent() {}
/** Processes a resource event. */ /** Processes a resource event. */
virtual void process(); void process();
}; };
}; };

View file

@ -53,9 +53,8 @@ class GraduationUnit : public Resource {
GraduationUnit(std::string res_name, int res_id, int res_width, GraduationUnit(std::string res_name, int res_id, int res_width,
int res_latency, InOrderCPU *_cpu, int res_latency, InOrderCPU *_cpu,
ThePipeline::Params *params); ThePipeline::Params *params);
virtual ~GraduationUnit() {}
virtual void execute(int slot_num); void execute(int slot_num);
protected: protected:
Tick lastCycleGrad; Tick lastCycleGrad;

View file

@ -57,21 +57,20 @@ class InstBuffer : public Resource {
public: public:
InstBuffer(std::string res_name, int res_id, int res_width, InstBuffer(std::string res_name, int res_id, int res_width,
int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params); int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params);
virtual ~InstBuffer() {}
virtual void regStats(); void regStats();
virtual void execute(int slot_num); void execute(int slot_num);
virtual void insert(DynInstPtr inst); void insert(DynInstPtr inst);
virtual void remove(DynInstPtr inst); void remove(DynInstPtr inst);
virtual void pop(ThreadID tid); void pop(ThreadID tid);
virtual DynInstPtr top(ThreadID tid); DynInstPtr top(ThreadID tid);
virtual void squash(DynInstPtr inst, int stage_num, void squash(DynInstPtr inst, int stage_num,
InstSeqNum squash_seq_num, ThreadID tid); InstSeqNum squash_seq_num, ThreadID tid);
protected: protected:
/** List of instructions this resource is currently /** List of instructions this resource is currently

View file

@ -63,24 +63,24 @@ class MultDivUnit : public Resource {
/** Override default Resource getSlot(). Will only getSlot if /** Override default Resource getSlot(). Will only getSlot if
* valid mult/div sequence is being maintained * valid mult/div sequence is being maintained
*/ */
virtual int getSlot(DynInstPtr inst); int getSlot(DynInstPtr inst);
virtual int findSlot(DynInstPtr inst); int findSlot(DynInstPtr inst);
virtual void freeSlot(int slot_idx); void freeSlot(int slot_idx);
virtual void init(); void init();
/** Get Operand Size For A Division Operation */ /** Get Operand Size For A Division Operation */
int getDivOpSize(DynInstPtr inst); int getDivOpSize(DynInstPtr inst);
/** Override default Resource execute */ /** Override default Resource execute */
virtual void execute(int slot_num); void execute(int slot_num);
void exeMulDiv(int slot_num); void exeMulDiv(int slot_num);
/** Register extra resource stats */ /** Register extra resource stats */
virtual void regStats(); void regStats();
void requestAgain(DynInstPtr inst, bool &try_request); void requestAgain(DynInstPtr inst, bool &try_request);
@ -130,10 +130,10 @@ class MDUEvent : public ResourceEvent
{ {
public: public:
MDUEvent(); MDUEvent();
virtual ~MDUEvent() { } ~MDUEvent() { }
virtual void process(); void process();
}; };

View file

@ -55,17 +55,16 @@ class UseDefUnit : public Resource {
public: public:
UseDefUnit(std::string res_name, int res_id, int res_width, UseDefUnit(std::string res_name, int res_id, int res_width,
int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params); int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params);
virtual ~UseDefUnit() {}
virtual ResourceRequest* getRequest(DynInstPtr _inst, int stage_num, ResourceRequest* getRequest(DynInstPtr _inst, int stage_num,
int res_idx, int slot_num, int res_idx, int slot_num,
unsigned cmd); unsigned cmd);
virtual ResReqPtr findRequest(DynInstPtr inst); ResReqPtr findRequest(DynInstPtr inst);
virtual void execute(int slot_num); void execute(int slot_num);
virtual void squash(DynInstPtr inst, int stage_num, void squash(DynInstPtr inst, int stage_num,
InstSeqNum squash_seq_num, ThreadID tid); InstSeqNum squash_seq_num, ThreadID tid);
void updateAfterContextSwitch(DynInstPtr inst, ThreadID tid); void updateAfterContextSwitch(DynInstPtr inst, ThreadID tid);

View file

@ -75,193 +75,193 @@ class InOrderThreadContext : public ThreadContext
System *getSystemPtr() { return cpu->system; } System *getSystemPtr() { return cpu->system; }
/** Returns a pointer to this CPU. */ /** Returns a pointer to this CPU. */
virtual BaseCPU *getCpuPtr() { return cpu; } BaseCPU *getCpuPtr() { return cpu; }
/** Returns a pointer to this CPU. */ /** Returns a pointer to this CPU. */
virtual std::string getCpuName() { return cpu->name(); } std::string getCpuName() { return cpu->name(); }
/** Reads this CPU's ID. */ /** Reads this CPU's ID. */
virtual int cpuId() { return cpu->cpuId(); } int cpuId() { return cpu->cpuId(); }
virtual int contextId() { return thread->contextId(); } int contextId() { return thread->contextId(); }
virtual void setContextId(int id) { thread->setContextId(id); } void setContextId(int id) { thread->setContextId(id); }
/** Returns this thread's ID number. */ /** Returns this thread's ID number. */
virtual int threadId() { return thread->threadId(); } int threadId() { return thread->threadId(); }
virtual void setThreadId(int id) { return thread->setThreadId(id); } void setThreadId(int id) { return thread->setThreadId(id); }
virtual uint64_t readMicroPC() uint64_t readMicroPC()
{ return 0; } { return 0; }
virtual void setMicroPC(uint64_t val) { }; void setMicroPC(uint64_t val) { };
virtual uint64_t readNextMicroPC() uint64_t readNextMicroPC()
{ return 0; } { return 0; }
virtual void setNextMicroPC(uint64_t val) { }; void setNextMicroPC(uint64_t val) { };
#if FULL_SYSTEM #if FULL_SYSTEM
/** Returns a pointer to physical memory. */ /** Returns a pointer to physical memory. */
virtual PhysicalMemory *getPhysMemPtr() PhysicalMemory *getPhysMemPtr()
{ assert(0); return 0; /*return cpu->physmem;*/ } { assert(0); return 0; /*return cpu->physmem;*/ }
/** Returns a pointer to this thread's kernel statistics. */ /** Returns a pointer to this thread's kernel statistics. */
virtual TheISA::Kernel::Statistics *getKernelStats() TheISA::Kernel::Statistics *getKernelStats()
{ return thread->kernelStats; } { return thread->kernelStats; }
virtual FunctionalPort *getPhysPort() { return thread->getPhysPort(); } FunctionalPort *getPhysPort() { return thread->getPhysPort(); }
virtual VirtualPort *getVirtPort(); VirtualPort *getVirtPort();
virtual void connectMemPorts(ThreadContext *tc) void connectMemPorts(ThreadContext *tc)
{ thread->connectMemPorts(tc); } { thread->connectMemPorts(tc); }
/** Dumps the function profiling information. /** Dumps the function profiling information.
* @todo: Implement. * @todo: Implement.
*/ */
virtual void dumpFuncProfile(); void dumpFuncProfile();
/** Reads the last tick that this thread was activated on. */ /** Reads the last tick that this thread was activated on. */
virtual Tick readLastActivate(); Tick readLastActivate();
/** Reads the last tick that this thread was suspended on. */ /** Reads the last tick that this thread was suspended on. */
virtual Tick readLastSuspend(); Tick readLastSuspend();
/** Clears the function profiling information. */ /** Clears the function profiling information. */
virtual void profileClear(); void profileClear();
/** Samples the function profiling information. */ /** Samples the function profiling information. */
virtual void profileSample(); void profileSample();
/** Returns pointer to the quiesce event. */ /** Returns pointer to the quiesce event. */
virtual EndQuiesceEvent *getQuiesceEvent() EndQuiesceEvent *getQuiesceEvent()
{ {
return this->thread->quiesceEvent; return this->thread->quiesceEvent;
} }
#else #else
virtual TranslatingPort *getMemPort() { return thread->getMemPort(); } TranslatingPort *getMemPort() { return thread->getMemPort(); }
/** Returns a pointer to this thread's process. */ /** Returns a pointer to this thread's process. */
virtual Process *getProcessPtr() { return thread->getProcessPtr(); } Process *getProcessPtr() { return thread->getProcessPtr(); }
#endif #endif
/** Returns this thread's status. */ /** Returns this thread's status. */
virtual Status status() const { return thread->status(); } Status status() const { return thread->status(); }
/** Sets this thread's status. */ /** Sets this thread's status. */
virtual void setStatus(Status new_status) void setStatus(Status new_status)
{ thread->setStatus(new_status); } { thread->setStatus(new_status); }
/** Set the status to Active. Optional delay indicates number of /** Set the status to Active. Optional delay indicates number of
* cycles to wait before beginning execution. */ * cycles to wait before beginning execution. */
virtual void activate(int delay = 1); void activate(int delay = 1);
/** Set the status to Suspended. */ /** Set the status to Suspended. */
virtual void suspend(int delay = 0); void suspend(int delay = 0);
/** Set the status to Halted. */ /** Set the status to Halted. */
virtual void halt(int delay = 0); void halt(int delay = 0);
/** Takes over execution of a thread from another CPU. */ /** Takes over execution of a thread from another CPU. */
virtual void takeOverFrom(ThreadContext *old_context); void takeOverFrom(ThreadContext *old_context);
/** Registers statistics associated with this TC. */ /** Registers statistics associated with this TC. */
virtual void regStats(const std::string &name); void regStats(const std::string &name);
/** Serializes state. */ /** Serializes state. */
virtual void serialize(std::ostream &os); void serialize(std::ostream &os);
/** Unserializes state. */ /** Unserializes state. */
virtual void unserialize(Checkpoint *cp, const std::string &section); void unserialize(Checkpoint *cp, const std::string &section);
/** Returns this thread's ID number. */ /** Returns this thread's ID number. */
virtual int getThreadNum() { return thread->readTid(); } int getThreadNum() { return thread->readTid(); }
/** Returns the instruction this thread is currently committing. /** Returns the instruction this thread is currently committing.
* Only used when an instruction faults. * Only used when an instruction faults.
*/ */
virtual TheISA::MachInst getInst(); TheISA::MachInst getInst();
/** Copies the architectural registers from another TC into this TC. */ /** Copies the architectural registers from another TC into this TC. */
virtual void copyArchRegs(ThreadContext *src_tc); void copyArchRegs(ThreadContext *src_tc);
/** Resets all architectural registers to 0. */ /** Resets all architectural registers to 0. */
virtual void clearArchRegs(); void clearArchRegs();
/** Reads an integer register. */ /** Reads an integer register. */
virtual uint64_t readIntReg(int reg_idx); uint64_t readIntReg(int reg_idx);
virtual FloatReg readFloatReg(int reg_idx); FloatReg readFloatReg(int reg_idx);
virtual FloatRegBits readFloatRegBits(int reg_idx); FloatRegBits readFloatRegBits(int reg_idx);
virtual uint64_t readRegOtherThread(int misc_reg, ThreadID tid); uint64_t readRegOtherThread(int misc_reg, ThreadID tid);
/** Sets an integer register to a value. */ /** Sets an integer register to a value. */
virtual void setIntReg(int reg_idx, uint64_t val); void setIntReg(int reg_idx, uint64_t val);
virtual void setFloatReg(int reg_idx, FloatReg val); void setFloatReg(int reg_idx, FloatReg val);
virtual void setFloatRegBits(int reg_idx, FloatRegBits val); void setFloatRegBits(int reg_idx, FloatRegBits val);
virtual void setRegOtherThread(int misc_reg, void setRegOtherThread(int misc_reg,
const MiscReg &val, const MiscReg &val,
ThreadID tid); ThreadID tid);
/** Reads this thread's PC. */ /** Reads this thread's PC. */
virtual uint64_t readPC() uint64_t readPC()
{ return cpu->readPC(thread->readTid()); } { return cpu->readPC(thread->readTid()); }
/** Sets this thread's PC. */ /** Sets this thread's PC. */
virtual void setPC(uint64_t val); void setPC(uint64_t val);
/** Reads this thread's next PC. */ /** Reads this thread's next PC. */
virtual uint64_t readNextPC() uint64_t readNextPC()
{ return cpu->readNextPC(thread->readTid()); } { return cpu->readNextPC(thread->readTid()); }
/** Sets this thread's next PC. */ /** Sets this thread's next PC. */
virtual void setNextPC(uint64_t val); void setNextPC(uint64_t val);
virtual uint64_t readNextNPC() uint64_t readNextNPC()
{ return cpu->readNextNPC(thread->readTid()); } { return cpu->readNextNPC(thread->readTid()); }
virtual void setNextNPC(uint64_t val); void setNextNPC(uint64_t val);
/** Reads a miscellaneous register. */ /** Reads a miscellaneous register. */
virtual MiscReg readMiscRegNoEffect(int misc_reg) MiscReg readMiscRegNoEffect(int misc_reg)
{ return cpu->readMiscRegNoEffect(misc_reg, thread->readTid()); } { return cpu->readMiscRegNoEffect(misc_reg, thread->readTid()); }
/** Reads a misc. register, including any side-effects the /** Reads a misc. register, including any side-effects the
* read might have as defined by the architecture. */ * read might have as defined by the architecture. */
virtual MiscReg readMiscReg(int misc_reg) MiscReg readMiscReg(int misc_reg)
{ return cpu->readMiscReg(misc_reg, thread->readTid()); } { return cpu->readMiscReg(misc_reg, thread->readTid()); }
/** Sets a misc. register. */ /** Sets a misc. register. */
virtual void setMiscRegNoEffect(int misc_reg, const MiscReg &val); void setMiscRegNoEffect(int misc_reg, const MiscReg &val);
/** Sets a misc. register, including any side-effects the /** Sets a misc. register, including any side-effects the
* write might have as defined by the architecture. */ * write might have as defined by the architecture. */
virtual void setMiscReg(int misc_reg, const MiscReg &val); void setMiscReg(int misc_reg, const MiscReg &val);
virtual int flattenIntIndex(int reg) int flattenIntIndex(int reg)
{ return cpu->isa[thread->readTid()].flattenIntIndex(reg); } { return cpu->isa[thread->readTid()].flattenIntIndex(reg); }
virtual int flattenFloatIndex(int reg) int flattenFloatIndex(int reg)
{ return cpu->isa[thread->readTid()].flattenFloatIndex(reg); } { return cpu->isa[thread->readTid()].flattenFloatIndex(reg); }
virtual void activateContext(int delay) void activateContext(int delay)
{ cpu->activateContext(thread->readTid(), delay); } { cpu->activateContext(thread->readTid(), delay); }
virtual void deallocateContext() void deallocateContext()
{ cpu->deallocateContext(thread->readTid()); } { cpu->deallocateContext(thread->readTid()); }
/** Returns the number of consecutive store conditional failures. */ /** Returns the number of consecutive store conditional failures. */
// @todo: Figure out where these store cond failures should go. // @todo: Figure out where these store cond failures should go.
virtual unsigned readStCondFailures() unsigned readStCondFailures()
{ return thread->storeCondFailures; } { return thread->storeCondFailures; }
/** Sets the number of consecutive store conditional failures. */ /** Sets the number of consecutive store conditional failures. */
virtual void setStCondFailures(unsigned sc_failures) void setStCondFailures(unsigned sc_failures)
{ thread->storeCondFailures = sc_failures; } { thread->storeCondFailures = sc_failures; }
// Only really makes sense for old CPU model. Lots of code // Only really makes sense for old CPU model. Lots of code
@ -270,18 +270,18 @@ class InOrderThreadContext : public ThreadContext
/** Checks if the thread is misspeculating. Because it is /** Checks if the thread is misspeculating. Because it is
* very difficult to determine if the thread is * very difficult to determine if the thread is
* misspeculating, this is set as false. */ * misspeculating, this is set as false. */
virtual bool misspeculating() { return false; } bool misspeculating() { return false; }
#if !FULL_SYSTEM #if !FULL_SYSTEM
/** Executes a syscall in SE mode. */ /** Executes a syscall in SE mode. */
virtual void syscall(int64_t callnum) void syscall(int64_t callnum)
{ return cpu->syscall(callnum, thread->readTid()); } { return cpu->syscall(callnum, thread->readTid()); }
#endif #endif
/** Reads the funcExeInst counter. */ /** Reads the funcExeInst counter. */
virtual Counter readFuncExeInst() { return thread->funcExeInst; } Counter readFuncExeInst() { return thread->funcExeInst; }
virtual void changeRegFileContext(unsigned param, void changeRegFileContext(unsigned param,
unsigned val) unsigned val)
{ panic("Not supported!"); } { panic("Not supported!"); }
}; };