Make OzoneCPU work again in SE/FS.
authorKevin Lim <ktlim@umich.edu>
Sun, 25 Jun 2006 04:22:41 +0000 (00:22 -0400)
committerKevin Lim <ktlim@umich.edu>
Sun, 25 Jun 2006 04:22:41 +0000 (00:22 -0400)
src/cpu/ozone/cpu.hh:
    Fixes to get OzoneCPU working in SE/FS again.
src/cpu/ozone/cpu_impl.hh:
    Be sure to set up ports properly.
src/cpu/ozone/front_end.hh:
    Allow port to be created without specifying its name at the beginning.
src/cpu/ozone/front_end_impl.hh:
    Setup port properly, also only use checker if it's enabled.
src/cpu/ozone/lw_back_end_impl.hh:
    Be sure to initialize variables.
src/cpu/ozone/lw_lsq.hh:
    Handle locked flag for UP systems.
src/cpu/ozone/lw_lsq_impl.hh:
    Initialize all variables.
src/python/m5/objects/OzoneCPU.py:
    Fix up config.

--HG--
extra : convert_revision : c99e7bf82fc0dd1099c7a82eaebd58ab6017764d

src/cpu/ozone/cpu.hh
src/cpu/ozone/cpu_impl.hh
src/cpu/ozone/front_end.hh
src/cpu/ozone/front_end_impl.hh
src/cpu/ozone/lw_back_end_impl.hh
src/cpu/ozone/lw_lsq.hh
src/cpu/ozone/lw_lsq_impl.hh
src/python/m5/objects/OzoneCPU.py

index cacc84786a6e946ee61ee6a9490eebe30c3f3cf2..f726ac99b4a380214ec8b83a5ad70881cb90e54b 100644 (file)
@@ -214,12 +214,11 @@ class OzoneCPU : public BaseCPU
 
         uint64_t readNextNPC()
         {
-            panic("Alpha has no NextNPC!");
             return 0;
         }
 
         void setNextNPC(uint64_t val)
-        { panic("Alpha has no NextNPC!"); }
+        { }
 
       public:
         // ISA stuff:
index 2b25ad124dff419525c16fa003966f3a204a644a..2cdc8a3da9ea8016f273c97055b0f22cd31844fc 100644 (file)
@@ -201,7 +201,35 @@ OzoneCPU<Impl>::OzoneCPU(Params *p)
     backEnd->renameTable.copyFrom(thread.renameTable);
 
 #if !FULL_SYSTEM
-//    pTable = p->pTable;
+    /* Use this port to for syscall emulation writes to memory. */
+    Port *mem_port;
+    TranslatingPort *trans_port;
+    trans_port = new TranslatingPort(csprintf("%s-%d-funcport",
+                                              name(), 0),
+                                     p->workload[0]->pTable,
+                                     false);
+    mem_port = p->mem->getPort("functional");
+    mem_port->setPeer(trans_port);
+    trans_port->setPeer(mem_port);
+    thread.setMemPort(trans_port);
+#else
+    Port *mem_port;
+    FunctionalPort *phys_port;
+    VirtualPort *virt_port;
+    phys_port = new FunctionalPort(csprintf("%s-%d-funcport",
+                                            name(), 0));
+    mem_port = system->physmem->getPort("functional");
+    mem_port->setPeer(phys_port);
+    phys_port->setPeer(mem_port);
+
+    virt_port = new VirtualPort(csprintf("%s-%d-vport",
+                                         name(), 0));
+    mem_port = system->physmem->getPort("functional");
+    mem_port->setPeer(virt_port);
+    virt_port->setPeer(mem_port);
+
+    thread.setPhysPort(phys_port);
+    thread.setVirtPort(virt_port);
 #endif
 
     lockFlag = 0;
index af310efc323c10680ea8ef94833ff19f5d6809f2..181609098c5da8dc26a2fa6bfc8da98d95a824ec 100644 (file)
@@ -43,7 +43,7 @@
 #include "sim/stats.hh"
 
 class ThreadContext;
-class MemInterface;
+class MemObject;
 template <class>
 class OzoneThreadState;
 class PageTable;
@@ -75,7 +75,7 @@ class FrontEnd
       public:
         /** Default constructor. */
         IcachePort(FrontEnd<Impl> *_fe)
-            : Port(_fe->name() + "-iport"), fe(_fe)
+            : fe(_fe)
         { }
 
       protected:
@@ -105,8 +105,7 @@ class FrontEnd
 
     std::string name() const;
 
-    void setCPU(CPUType *cpu_ptr)
-    { cpu = cpu_ptr; }
+    void setCPU(CPUType *cpu_ptr);
 
     void setBackEnd(BackEnd *back_end_ptr)
     { backEnd = back_end_ptr; }
@@ -206,6 +205,8 @@ class FrontEnd
 
     IcachePort icachePort;
 
+    MemObject *mem;
+
     RequestPtr memReq;
 
     /** Mask to get a cache block's address. */
index b1bc325c7392644b2d2e5146419a7d3facc376ad..40042489da9b5b0268909df7afededee77b571c5 100644 (file)
@@ -28,6 +28,8 @@
  * Authors: Kevin Lim
  */
 
+#include "config/use_checker.hh"
+
 #include "arch/faults.hh"
 #include "arch/isa_traits.hh"
 #include "base/statistics.hh"
 #include "mem/packet.hh"
 #include "mem/request.hh"
 
+#if USE_CHECKER
+#include "cpu/checker/cpu.hh"
+#endif
+
 using namespace TheISA;
 
 template<class Impl>
@@ -83,6 +89,7 @@ template <class Impl>
 FrontEnd<Impl>::FrontEnd(Params *params)
     : branchPred(params),
       icachePort(this),
+      mem(params->mem),
       instBufferSize(0),
       maxInstBufferSize(params->maxInstBufferSize),
       width(params->frontEndWidth),
@@ -123,6 +130,25 @@ FrontEnd<Impl>::name() const
     return cpu->name() + ".frontend";
 }
 
+template <class Impl>
+void
+FrontEnd<Impl>::setCPU(CPUType *cpu_ptr)
+{
+    cpu = cpu_ptr;
+
+    icachePort.setName(this->name() + "-iport");
+
+    Port *mem_dport = mem->getPort("");
+    icachePort.setPeer(mem_dport);
+    mem_dport->setPeer(&icachePort);
+
+#if USE_CHECKER
+    if (cpu->checker) {
+        cpu->checker->setIcachePort(&icachePort);
+    }
+#endif
+}
+
 template <class Impl>
 void
 FrontEnd<Impl>::setCommBuffer(TimeBuffer<CommStruct> *_comm)
index dcd7a0d7edcd9a38b7cc7cf6b0abb8778e161539..a73d3ee6ee9c53a045d92ea3dcd04ef58829f237 100644 (file)
@@ -142,7 +142,7 @@ LWBackEnd<Impl>::replayMemInst(DynInstPtr &inst)
 template <class Impl>
 LWBackEnd<Impl>::LWBackEnd(Params *params)
     : d2i(5, 5), i2e(5, 5), e2c(5, 5), numInstsToWB(5, 5),
-      trapSquash(false), tcSquash(false),
+      trapSquash(false), tcSquash(false), LSQ(params),
       width(params->backEndWidth), exactFullStall(true)
 {
     numROBEntries = params->numROBEntries;
@@ -169,6 +169,7 @@ LWBackEnd<Impl>::LWBackEnd(Params *params)
     LSQ.init(params, params->LQEntries, params->SQEntries, 0);
 
     dispatchStatus = Running;
+    commitStatus = Running;
 }
 
 template <class Impl>
index e0c1901345dd08407f339331463bfa2f17c754d6..c749e3aeea438eb2c70dfdb8469df92392613ae0 100644 (file)
@@ -654,6 +654,10 @@ OzoneLWLSQ<Impl>::read(RequestPtr req, T &data, int load_idx)
         return NoFault;
     }
 
+    if (req->getFlags() & LOCKED) {
+        cpu->lockFlag = true;
+    }
+
     if (data_pkt->result != Packet::Success) {
         DPRINTF(OzoneLSQ, "OzoneLSQ: D-cache miss!\n");
         DPRINTF(Activity, "Activity: ld accessing mem miss [sn:%lli]\n",
index effb21728c0205d5fe2fb38472e722dcab69dcba..a65a2a4d37e285aa0f578a4fbe93ac5ae79289c3 100644 (file)
@@ -131,8 +131,8 @@ OzoneLWLSQ<Impl>::completeDataAccess(PacketPtr pkt)
 
 template <class Impl>
 OzoneLWLSQ<Impl>::OzoneLWLSQ()
-    : loads(0), stores(0), storesToWB(0), stalled(false), isLoadBlocked(false),
-      loadBlockedHandled(false)
+    : switchedOut(false), loads(0), stores(0), storesToWB(0), stalled(false),
+      isStoreBlocked(false), isLoadBlocked(false), loadBlockedHandled(false)
 {
 }
 
@@ -153,6 +153,8 @@ OzoneLWLSQ<Impl>::init(Params *params, unsigned maxLQEntries,
         SQIndices.push(i);
     }
 
+    mem = params->mem;
+
     usedPorts = 0;
     cachePorts = params->cachePorts;
 
index f2d9aea849f5a0fd99ad8867a035fb01a695fe9a..8aff89203fc76fee44646d264d6c034331e7b549 100644 (file)
@@ -7,9 +7,6 @@ class DerivOzoneCPU(BaseCPU):
 
     numThreads = Param.Unsigned("number of HW thread contexts")
 
-    if not build_env['FULL_SYSTEM']:
-        mem = Param.FunctionalMemory(NULL, "memory")
-
     checker = Param.BaseCPU("Checker CPU")
 
     width = Param.Unsigned("Width")