CPU: Make physPort and getPhysPort available in SE mode.

This commit is contained in:
Gabe Black
2011-10-16 02:59:53 -07:00
parent 85ca77d114
commit e8e9f97312
9 changed files with 36 additions and 35 deletions

View File

@@ -97,8 +97,6 @@ class CheckerThreadContext : public ThreadContext
TheISA::Kernel::Statistics *getKernelStats()
{ return actualTC->getKernelStats(); }
FunctionalPort *getPhysPort() { return actualTC->getPhysPort(); }
VirtualPort *getVirtPort()
{ return actualTC->getVirtPort(); }
#else
@@ -107,6 +105,8 @@ class CheckerThreadContext : public ThreadContext
Process *getProcessPtr() { return actualTC->getProcessPtr(); }
#endif
FunctionalPort *getPhysPort() { return actualTC->getPhysPort(); }
Status status() const { return actualTC->status(); }
void setStatus(Status new_status)

View File

@@ -118,8 +118,6 @@ class InOrderThreadContext : public ThreadContext
TheISA::Kernel::Statistics *getKernelStats()
{ return thread->kernelStats; }
FunctionalPort *getPhysPort() { return thread->getPhysPort(); }
VirtualPort *getVirtPort();
void connectMemPorts(ThreadContext *tc)
@@ -153,6 +151,8 @@ class InOrderThreadContext : public ThreadContext
Process *getProcessPtr() { return thread->getProcessPtr(); }
#endif
FunctionalPort *getPhysPort() { return thread->getPhysPort(); }
/** Returns this thread's status. */
Status status() const { return thread->status(); }

View File

@@ -97,8 +97,6 @@ class O3ThreadContext : public ThreadContext
virtual TheISA::Kernel::Statistics *getKernelStats()
{ return thread->kernelStats; }
virtual FunctionalPort *getPhysPort() { return thread->getPhysPort(); }
virtual VirtualPort *getVirtPort();
virtual void connectMemPorts(ThreadContext *tc) { thread->connectMemPorts(tc); }
@@ -108,6 +106,9 @@ class O3ThreadContext : public ThreadContext
/** Returns a pointer to this thread's process. */
virtual Process *getProcessPtr() { return thread->getProcessPtr(); }
#endif
virtual FunctionalPort *getPhysPort() { return thread->getPhysPort(); }
/** Returns this thread's status. */
virtual Status status() const { return thread->status(); }

View File

@@ -124,8 +124,6 @@ class OzoneCPU : public BaseCPU
TheISA::Kernel::Statistics *getKernelStats()
{ return thread->getKernelStats(); }
FunctionalPort *getPhysPort() { return thread->getPhysPort(); }
VirtualPort *getVirtPort()
{ return thread->getVirtPort(); }
#else
@@ -134,6 +132,8 @@ class OzoneCPU : public BaseCPU
Process *getProcessPtr() { return thread->getProcessPtr(); }
#endif
FunctionalPort *getPhysPort() { return thread->getPhysPort(); }
Status status() const { return thread->status(); }
void setStatus(Status new_status);

View File

@@ -117,8 +117,8 @@ SimpleThread::SimpleThread()
SimpleThread::~SimpleThread()
{
#if FULL_SYSTEM
delete physPort;
#if FULL_SYSTEM
delete virtPort;
#endif
delete tc;

View File

@@ -208,8 +208,6 @@ class SimpleThread : public ThreadState
System *getSystemPtr() { return system; }
#if FULL_SYSTEM
FunctionalPort *getPhysPort() { return physPort; }
/** Return a virtual port. This port cannot be cached locally in an object.
* After a CPU switch it may point to the wrong memory object which could
* mean stale data.
@@ -217,6 +215,8 @@ class SimpleThread : public ThreadState
VirtualPort *getVirtPort() { return virtPort; }
#endif
FunctionalPort *getPhysPort() { return physPort; }
Status status() const { return _status; }
void setStatus(Status newStatus) { _status = newStatus; }

View File

@@ -128,8 +128,6 @@ class ThreadContext
#if FULL_SYSTEM
virtual TheISA::Kernel::Statistics *getKernelStats() = 0;
virtual FunctionalPort *getPhysPort() = 0;
virtual VirtualPort *getVirtPort() = 0;
virtual void connectMemPorts(ThreadContext *tc) = 0;
@@ -139,6 +137,8 @@ class ThreadContext
virtual Process *getProcessPtr() = 0;
#endif
virtual FunctionalPort *getPhysPort() = 0;
virtual Status status() const = 0;
virtual void setStatus(Status new_status) = 0;
@@ -298,8 +298,6 @@ class ProxyThreadContext : public ThreadContext
TheISA::Kernel::Statistics *getKernelStats()
{ return actualTC->getKernelStats(); }
FunctionalPort *getPhysPort() { return actualTC->getPhysPort(); }
VirtualPort *getVirtPort() { return actualTC->getVirtPort(); }
void connectMemPorts(ThreadContext *tc) { actualTC->connectMemPorts(tc); }
@@ -309,6 +307,8 @@ class ProxyThreadContext : public ThreadContext
Process *getProcessPtr() { return actualTC->getProcessPtr(); }
#endif
FunctionalPort *getPhysPort() { return actualTC->getPhysPort(); }
Status status() const { return actualTC->status(); }
void setStatus(Status new_status) { actualTC->setStatus(new_status); }

View File

@@ -51,11 +51,11 @@ ThreadState::ThreadState(BaseCPU *cpu, ThreadID _tid, Process *_process)
baseCpu(cpu), _threadId(_tid), lastActivate(0), lastSuspend(0),
#if FULL_SYSTEM
profile(NULL), profileNode(NULL), profilePC(0), quiesceEvent(NULL),
kernelStats(NULL), physPort(NULL), virtPort(NULL),
kernelStats(NULL), virtPort(NULL),
#else
port(NULL), process(_process),
#endif
funcExeInst(0), storeCondFailures(0)
physPort(NULL), funcExeInst(0), storeCondFailures(0)
{
}
@@ -104,14 +104,6 @@ ThreadState::unserialize(Checkpoint *cp, const std::string &section)
#endif
}
#if FULL_SYSTEM
void
ThreadState::connectMemPorts(ThreadContext *tc)
{
connectPhysPort();
connectVirtPort(tc);
}
void
ThreadState::connectPhysPort()
{
@@ -126,6 +118,14 @@ ThreadState::connectPhysPort()
connectToMemFunc(physPort);
}
#if FULL_SYSTEM
void
ThreadState::connectMemPorts(ThreadContext *tc)
{
connectPhysPort();
connectVirtPort(tc);
}
void
ThreadState::connectVirtPort(ThreadContext *tc)
{

View File

@@ -92,11 +92,11 @@ struct ThreadState {
Tick readLastSuspend() { return lastSuspend; }
void connectPhysPort();
#if FULL_SYSTEM
void connectMemPorts(ThreadContext *tc);
void connectPhysPort();
void connectVirtPort(ThreadContext *tc);
void dumpFuncProfile();
@@ -109,10 +109,6 @@ struct ThreadState {
TheISA::Kernel::Statistics *getKernelStats() { return kernelStats; }
FunctionalPort *getPhysPort() { return physPort; }
void setPhysPort(FunctionalPort *port) { physPort = port; }
VirtualPort *getVirtPort() { return virtPort; }
#else
Process *getProcessPtr() { return process; }
@@ -122,6 +118,10 @@ struct ThreadState {
void setMemPort(TranslatingPort *_port) { port = _port; }
#endif
FunctionalPort *getPhysPort() { return physPort; }
void setPhysPort(FunctionalPort *port) { physPort = port; }
/** Reads the number of instructions functionally executed and
* committed.
*/
@@ -186,10 +186,6 @@ struct ThreadState {
TheISA::Kernel::Statistics *kernelStats;
protected:
/** A functional port outgoing only for functional accesses to physical
* addresses.*/
FunctionalPort *physPort;
/** A functional port, outgoing only, for functional accesse to virtual
* addresses. */
VirtualPort *virtPort;
@@ -199,6 +195,10 @@ struct ThreadState {
Process *process;
#endif
/** A functional port outgoing only for functional accesses to physical
* addresses.*/
FunctionalPort *physPort;
public:
/*
* number of executed instructions, for matching with syscall trace