CPU: Get rid of the now unnecessary getInst/setInst family of functions.

This code is no longer needed because of the preceeding change which adds a
StaticInstPtr parameter to the fault's invoke method, obviating the only use
for this pair of functions.
This commit is contained in:
Gabe Black 2010-09-13 21:58:34 -07:00
parent 6833ca7eed
commit 8f3fbd2d13
16 changed files with 0 additions and 79 deletions

View file

@ -209,10 +209,6 @@ Checker<DynInstPtr>::verify(DynInstPtr &completed_inst)
thread->getTC()));
#endif
#if FULL_SYSTEM
thread->setInst(machInst);
#endif // FULL_SYSTEM
fault = inst->getFault();
}

View file

@ -153,9 +153,6 @@ class CheckerThreadContext : public ThreadContext
int threadId() { return actualTC->threadId(); }
// @todo: Do I need this?
MachInst getInst() { return actualTC->getInst(); }
// @todo: Do I need this?
void copyArchRegs(ThreadContext *tc)
{

View file

@ -171,12 +171,6 @@ InOrderThreadContext::unserialize(Checkpoint *cp, const std::string &section)
panic("unserialize unimplemented");
}
TheISA::MachInst
InOrderThreadContext:: getInst()
{
return thread->getInst();
}
void
InOrderThreadContext::copyArchRegs(ThreadContext *src_tc)

View file

@ -177,11 +177,6 @@ class InOrderThreadContext : public ThreadContext
/** Returns this thread's ID number. */
int getThreadNum() { return thread->readTid(); }
/** Returns the instruction this thread is currently committing.
* Only used when an instruction faults.
*/
TheISA::MachInst getInst();
/** Copies the architectural registers from another TC into this TC. */
void copyArchRegs(ThreadContext *src_tc);

View file

@ -1033,12 +1033,6 @@ DefaultCommit<Impl>::commitHead(DynInstPtr &head_inst, unsigned inst_num)
}
#endif
// DTB will sometimes need the machine instruction for when
// faults happen. So we will set it here, prior to the DTB
// possibly needing it for its fault.
thread[tid]->setInst(
static_cast<TheISA::MachInst>(head_inst->staticInst->machInst));
if (inst_fault != NoFault) {
DPRINTF(Commit, "Inst [sn:%lli] PC %#x has a fault\n",
head_inst->seqNum, head_inst->readPC());

View file

@ -151,10 +151,6 @@ class O3ThreadContext : public ThreadContext
/** Samples the function profiling information. */
virtual void profileSample();
#endif
/** Returns the instruction this thread is currently committing.
* Only used when an instruction faults.
*/
virtual TheISA::MachInst getInst();
/** Copies the architectural registers from another TC into this TC. */
virtual void copyArchRegs(ThreadContext *tc);

View file

@ -215,13 +215,6 @@ O3ThreadContext<Impl>::profileSample()
}
#endif
template <class Impl>
TheISA::MachInst
O3ThreadContext<Impl>:: getInst()
{
return thread->getInst();
}
template <class Impl>
void
O3ThreadContext<Impl>::copyArchRegs(ThreadContext *tc)

View file

@ -171,9 +171,6 @@ class OzoneCPU : public BaseCPU
int threadId();
// Also somewhat obnoxious. Really only used for the TLB fault.
TheISA::MachInst getInst();
void copyArchRegs(ThreadContext *tc);
void clearArchRegs();

View file

@ -771,7 +771,6 @@ OzoneCPU<Impl>::OzoneTC::takeOverFrom(ThreadContext *old_context)
setCpuId(old_context->cpuId());
setContextId(old_context->contextId());
thread->setInst(old_context->getInst());
#if !FULL_SYSTEM
setFuncExeInst(old_context->readFuncExeInst());
#else
@ -862,13 +861,6 @@ OzoneCPU<Impl>::OzoneTC::threadId()
return thread->threadId();
}
template <class Impl>
TheISA::MachInst
OzoneCPU<Impl>::OzoneTC::getInst()
{
return thread->getInst();
}
template <class Impl>
void
OzoneCPU<Impl>::OzoneTC::copyArchRegs(ThreadContext *tc)

View file

@ -304,12 +304,6 @@ InorderBackEnd<Impl>::executeInsts()
thread->inSyscall = true;
// Hack for now; DTB will sometimes need the machine instruction
// for when faults happen. So we will set it here, prior to the
// DTB possibly needing it for this translation.
thread->setInst(
static_cast<TheISA::MachInst>(inst->staticInst->machInst));
// Consider holding onto the trap and waiting until the trap event
// happens for this to be executed.
inst_fault->invoke(xc);

View file

@ -1171,9 +1171,6 @@ LWBackEnd<Impl>::commitInst(int inst_num)
}
#endif
thread->setInst(
static_cast<TheISA::MachInst>(inst->staticInst->machInst));
handleFault(inst_fault);
return false;
}

View file

@ -456,10 +456,6 @@ BaseSimpleCPU::preExecute()
DPRINTF(Decode,"Decode: Decoded %s instruction: 0x%x\n",
curStaticInst->getName(), curStaticInst->machInst);
#endif // TRACING_ON
#if FULL_SYSTEM
thread->setInst(inst);
#endif // FULL_SYSTEM
}
}

View file

@ -181,7 +181,6 @@ SimpleThread::copyState(ThreadContext *oldContext)
#if !FULL_SYSTEM
funcExeInst = oldContext->readFuncExeInst();
#endif
inst = oldContext->getInst();
_threadId = oldContext->threadId();
_contextId = oldContext->contextId();

View file

@ -171,10 +171,6 @@ class ThreadContext
virtual void profileSample() = 0;
#endif
// Also somewhat obnoxious. Really only used for the TLB fault.
// However, may be quite useful in SPARC.
virtual TheISA::MachInst getInst() = 0;
virtual void copyArchRegs(ThreadContext *tc) = 0;
virtual void clearArchRegs() = 0;
@ -352,8 +348,6 @@ class ProxyThreadContext : public ThreadContext
void profileClear() { return actualTC->profileClear(); }
void profileSample() { return actualTC->profileSample(); }
#endif
// @todo: Do I need this?
MachInst getInst() { return actualTC->getInst(); }
// @todo: Do I need this?
void copyArchRegs(ThreadContext *tc) { actualTC->copyArchRegs(tc); }

View file

@ -75,7 +75,6 @@ ThreadState::serialize(std::ostream &os)
SERIALIZE_ENUM(_status);
// thread_num and cpu_id are deterministic from the config
SERIALIZE_SCALAR(funcExeInst);
SERIALIZE_SCALAR(inst);
#if FULL_SYSTEM
Tick quiesceEndTick = 0;
@ -94,7 +93,6 @@ ThreadState::unserialize(Checkpoint *cp, const std::string &section)
UNSERIALIZE_ENUM(_status);
// thread_num and cpu_id are deterministic from the config
UNSERIALIZE_SCALAR(funcExeInst);
UNSERIALIZE_SCALAR(inst);
#if FULL_SYSTEM
Tick quiesceEndTick;

View file

@ -122,12 +122,6 @@ struct ThreadState {
void setMemPort(TranslatingPort *_port) { port = _port; }
#endif
/** Sets the current instruction being committed. */
void setInst(TheISA::MachInst _inst) { inst = _inst; }
/** Returns the current instruction being committed. */
TheISA::MachInst getInst() { return inst; }
/** Reads the number of instructions functionally executed and
* committed.
*/
@ -205,11 +199,6 @@ struct ThreadState {
Process *process;
#endif
/** Current instruction the thread is committing. Only set and
* used for DTB faults currently.
*/
TheISA::MachInst inst;
public:
/**
* Temporary storage to pass the source address from copy_load to