namespace TheISA {
namespace Kernel {
class Statistics;
- };
-};
+ }
+}
class Checkpoint;
-class Port;
-class TranslatingPort;
/**
* Struct for holding general thread state that is needed across CPU
ThreadState(BaseCPU *cpu, ThreadID _tid, Process *_process);
- ~ThreadState();
+ virtual ~ThreadState();
void serialize(std::ostream &os);
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();
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.
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;
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:
/*