cpu: Fix rename mis-handling serializing instructions when resource constrained
[gem5.git] / src / cpu / thread_state.hh
index 972ca895d2eac1cba310509b4fb27a91e8d6f9ce..d8dccc4aee9f3b2eb734be3cecd149cb9ab5da8c 100644 (file)
@@ -45,12 +45,10 @@ class ProfileNode;
 namespace TheISA {
     namespace Kernel {
         class Statistics;
-    };
-};
+    }
+}
 
 class Checkpoint;
-class Port;
-class TranslatingPort;
 
 /**
  *  Struct for holding general thread state that is needed across CPU
@@ -63,7 +61,7 @@ struct ThreadState {
 
     ThreadState(BaseCPU *cpu, ThreadID _tid, Process *_process);
 
-    ~ThreadState();
+    virtual ~ThreadState();
 
     void serialize(std::ostream &os);
 
@@ -83,11 +81,13 @@ struct ThreadState {
 
     Tick readLastSuspend() { return lastSuspend; }
 
-    void connectPhysPort();
-
-    void connectVirtPort(ThreadContext *tc);
-
-    void connectMemPorts(ThreadContext *tc);
+    /**
+     * Initialise the physical and virtual port proxies and tie them to
+     * the data port of the CPU.
+     *
+     * @param tc ThreadContext for the virtual-to-physical translation
+     */
+    void initMemProxies(ThreadContext *tc);
 
     void dumpFuncProfile();
 
@@ -99,17 +99,13 @@ struct ThreadState {
 
     TheISA::Kernel::Statistics *getKernelStats() { return kernelStats; }
 
-    Process *getProcessPtr() { return process; }
-
-    TranslatingPort *getMemPort();
+    PortProxy &getPhysProxy();
 
-    void setMemPort(TranslatingPort *_port) { port = _port; }
+    FSTranslatingPortProxy &getVirtProxy();
 
-    VirtualPort *getVirtPort() { return virtPort; }
-
-    FunctionalPort *getPhysPort() { return physPort; }
+    Process *getProcessPtr() { return process; }
 
-    void setPhysPort(FunctionalPort *port) { physPort = port; }
+    SETranslatingPortProxy &getMemProxy();
 
     /** Reads the number of instructions functionally executed and
      * committed.
@@ -128,14 +124,15 @@ struct ThreadState {
     void setStatus(Status new_status) { _status = new_status; }
 
   public:
-    /** Connects port to the functional port of the memory object
-     * below the CPU. */
-    void connectToMemFunc(Port *port);
 
     /** Number of instructions committed. */
     Counter numInst;
     /** Stat for number instructions committed. */
     Stats::Scalar numInsts;
+    /** Number of ops (including micro ops) committed. */
+    Counter numOp;
+    /** Stat for number ops (including micro ops) committed. */
+    Stats::Scalar numOps;
     /** Stat for number of memory references. */
     Stats::Scalar numMemRefs;
 
@@ -177,15 +174,14 @@ struct ThreadState {
   protected:
     Process *process;
 
-    TranslatingPort *port;
-
-    /** A functional port, outgoing only, for functional accesse to virtual
-     * addresses. */
-    VirtualPort *virtPort;
-
-    /** A functional port outgoing only for functional accesses to physical
+    /** A port proxy outgoing only for functional accesses to physical
      * addresses.*/
-    FunctionalPort *physPort;
+    PortProxy *physProxy;
+
+    /** A translating port proxy, outgoing only, for functional
+     * accesse to virtual addresses. */
+    FSTranslatingPortProxy *virtProxy;
+    SETranslatingPortProxy *proxy;
 
   public:
     /*