changeset 0996451df6de in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=0996451df6de
description:
        CPU: Make physPort and getPhysPort available in SE mode.

diffstat:

 src/cpu/checker/thread_context.hh |   4 ++--
 src/cpu/inorder/thread_context.hh |   4 ++--
 src/cpu/o3/thread_context.hh      |   5 +++--
 src/cpu/ozone/cpu.hh              |   4 ++--
 src/cpu/simple_thread.cc          |   2 +-
 src/cpu/simple_thread.hh          |   4 ++--
 src/cpu/thread_context.hh         |   8 ++++----
 src/cpu/thread_state.cc           |  20 ++++++++++----------
 src/cpu/thread_state.hh           |  20 ++++++++++----------
 9 files changed, 36 insertions(+), 35 deletions(-)

diffs (266 lines):

diff -r 8369dcf5b3a8 -r 0996451df6de src/cpu/checker/thread_context.hh
--- a/src/cpu/checker/thread_context.hh Thu Oct 13 02:26:21 2011 -0700
+++ b/src/cpu/checker/thread_context.hh Sun Oct 16 02:59:53 2011 -0700
@@ -97,8 +97,6 @@
     TheISA::Kernel::Statistics *getKernelStats()
     { return actualTC->getKernelStats(); }
 
-    FunctionalPort *getPhysPort() { return actualTC->getPhysPort(); }
-
     VirtualPort *getVirtPort()
     { return actualTC->getVirtPort(); }
 #else
@@ -107,6 +105,8 @@
     Process *getProcessPtr() { return actualTC->getProcessPtr(); }
 #endif
 
+    FunctionalPort *getPhysPort() { return actualTC->getPhysPort(); }
+
     Status status() const { return actualTC->status(); }
 
     void setStatus(Status new_status)
diff -r 8369dcf5b3a8 -r 0996451df6de src/cpu/inorder/thread_context.hh
--- a/src/cpu/inorder/thread_context.hh Thu Oct 13 02:26:21 2011 -0700
+++ b/src/cpu/inorder/thread_context.hh Sun Oct 16 02:59:53 2011 -0700
@@ -118,8 +118,6 @@
     TheISA::Kernel::Statistics *getKernelStats()
     { return thread->kernelStats; }
 
-    FunctionalPort *getPhysPort() { return thread->getPhysPort(); }
-
     VirtualPort *getVirtPort();
 
     void connectMemPorts(ThreadContext *tc)
@@ -153,6 +151,8 @@
     Process *getProcessPtr() { return thread->getProcessPtr(); }
 #endif
 
+    FunctionalPort *getPhysPort() { return thread->getPhysPort(); }
+
     /** Returns this thread's status. */
     Status status() const { return thread->status(); }
 
diff -r 8369dcf5b3a8 -r 0996451df6de src/cpu/o3/thread_context.hh
--- a/src/cpu/o3/thread_context.hh      Thu Oct 13 02:26:21 2011 -0700
+++ b/src/cpu/o3/thread_context.hh      Sun Oct 16 02:59:53 2011 -0700
@@ -97,8 +97,6 @@
     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 @@
     /** 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(); }
 
diff -r 8369dcf5b3a8 -r 0996451df6de src/cpu/ozone/cpu.hh
--- a/src/cpu/ozone/cpu.hh      Thu Oct 13 02:26:21 2011 -0700
+++ b/src/cpu/ozone/cpu.hh      Sun Oct 16 02:59:53 2011 -0700
@@ -124,8 +124,6 @@
         TheISA::Kernel::Statistics *getKernelStats()
         { return thread->getKernelStats(); }
 
-        FunctionalPort *getPhysPort() { return thread->getPhysPort(); }
-
         VirtualPort *getVirtPort()
         { return thread->getVirtPort(); }
 #else
@@ -134,6 +132,8 @@
         Process *getProcessPtr() { return thread->getProcessPtr(); }
 #endif
 
+        FunctionalPort *getPhysPort() { return thread->getPhysPort(); }
+
         Status status() const { return thread->status(); }
 
         void setStatus(Status new_status);
diff -r 8369dcf5b3a8 -r 0996451df6de src/cpu/simple_thread.cc
--- a/src/cpu/simple_thread.cc  Thu Oct 13 02:26:21 2011 -0700
+++ b/src/cpu/simple_thread.cc  Sun Oct 16 02:59:53 2011 -0700
@@ -117,8 +117,8 @@
 
 SimpleThread::~SimpleThread()
 {
+    delete physPort;
 #if FULL_SYSTEM
-    delete physPort;
     delete virtPort;
 #endif
     delete tc;
diff -r 8369dcf5b3a8 -r 0996451df6de src/cpu/simple_thread.hh
--- a/src/cpu/simple_thread.hh  Thu Oct 13 02:26:21 2011 -0700
+++ b/src/cpu/simple_thread.hh  Sun Oct 16 02:59:53 2011 -0700
@@ -208,8 +208,6 @@
     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 @@
     VirtualPort *getVirtPort() { return virtPort; }
 #endif
 
+    FunctionalPort *getPhysPort() { return physPort; }
+
     Status status() const { return _status; }
 
     void setStatus(Status newStatus) { _status = newStatus; }
diff -r 8369dcf5b3a8 -r 0996451df6de src/cpu/thread_context.hh
--- a/src/cpu/thread_context.hh Thu Oct 13 02:26:21 2011 -0700
+++ b/src/cpu/thread_context.hh Sun Oct 16 02:59:53 2011 -0700
@@ -128,8 +128,6 @@
 #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 @@
     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 @@
     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 @@
     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); }
diff -r 8369dcf5b3a8 -r 0996451df6de src/cpu/thread_state.cc
--- a/src/cpu/thread_state.cc   Thu Oct 13 02:26:21 2011 -0700
+++ b/src/cpu/thread_state.cc   Sun Oct 16 02:59:53 2011 -0700
@@ -51,11 +51,11 @@
       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 @@
 #endif
 }
 
-#if FULL_SYSTEM
-void
-ThreadState::connectMemPorts(ThreadContext *tc)
-{
-    connectPhysPort();
-    connectVirtPort(tc);
-}
-
 void
 ThreadState::connectPhysPort()
 {
@@ -126,6 +118,14 @@
     connectToMemFunc(physPort);
 }
 
+#if FULL_SYSTEM
+void
+ThreadState::connectMemPorts(ThreadContext *tc)
+{
+    connectPhysPort();
+    connectVirtPort(tc);
+}
+
 void
 ThreadState::connectVirtPort(ThreadContext *tc)
 {
diff -r 8369dcf5b3a8 -r 0996451df6de src/cpu/thread_state.hh
--- a/src/cpu/thread_state.hh   Thu Oct 13 02:26:21 2011 -0700
+++ b/src/cpu/thread_state.hh   Sun Oct 16 02:59:53 2011 -0700
@@ -92,11 +92,11 @@
 
     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 @@
 
     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 @@
     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 @@
 
     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 @@
     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
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to