More progress toward compiling... partly by
authorSteve Reinhardt <stever@eecs.umich.edu>
Wed, 15 Feb 2006 22:52:49 +0000 (17:52 -0500)
committerSteve Reinhardt <stever@eecs.umich.edu>
Wed, 15 Feb 2006 22:52:49 +0000 (17:52 -0500)
fixing things, partly by ignoring CPU models
that don't currently compile.

SConscript:
    Split sources for fast, simple, and o3 CPU models into
    separate source lists.  For now none of these are included
    in the base source list, so you won't get any CPU models
    at all... but we still can't compile the other stuff so
    it's not an issue.

    Also get rid of obsolete encumbered/mem file.
base/loader/aout_object.cc:
base/loader/aout_object.hh:
base/loader/ecoff_object.cc:
base/loader/ecoff_object.hh:
base/loader/elf_object.cc:
base/loader/elf_object.hh:
base/loader/object_file.hh:
cpu/exec_context.cc:
sim/process.cc:
sim/system.cc:
sim/system.hh:
    FunctionalMemory -> Memory
cpu/pc_event.hh:
    Get rid of unused badpc.
cpu/simple/cpu.cc:
cpu/simple/cpu.hh:
    Move Port functions into .cc file.
mem/port.hh:
    Make recvAddressRangesQuery panic by default instead
    of being abstract... do CPUs need to implement this?
mem/request.hh:
    Add prefetch flags.
sim/syscall_emul.hh:
    Start to fix...

--HG--
extra : convert_revision : ece53b3855f20916caaa381598ac37e8c7adfba7

18 files changed:
SConscript
base/loader/aout_object.cc
base/loader/aout_object.hh
base/loader/ecoff_object.cc
base/loader/ecoff_object.hh
base/loader/elf_object.cc
base/loader/elf_object.hh
base/loader/object_file.hh
cpu/exec_context.cc
cpu/pc_event.hh
cpu/simple/cpu.cc
cpu/simple/cpu.hh
mem/port.hh
mem/request.hh
sim/process.cc
sim/syscall_emul.hh
sim/system.cc
sim/system.hh

index 987eccceb1419d9cce5c307f4ab66e268d3ca7a0..b4f57ddbcc64967bd5da54af10d61dbb31685f17 100644 (file)
@@ -45,9 +45,6 @@ Import('env')
 # Base sources used by all configurations.
 base_sources = Split('''
        arch/alpha/decoder.cc
-        arch/alpha/alpha_o3_exec.cc
-       arch/alpha/fast_cpu_exec.cc
-       arch/alpha/simple_cpu_exec.cc
        arch/alpha/faults.cc
        arch/alpha/isa_traits.cc
 
@@ -87,44 +84,11 @@ base_sources = Split('''
        base/stats/text.cc
 
        cpu/base.cc
-        cpu/base_dyn_inst.cc
        cpu/exec_context.cc
        cpu/exetrace.cc
        cpu/pc_event.cc
        cpu/static_inst.cc
-        cpu/o3/2bit_local_pred.cc
-        cpu/o3/alpha_dyn_inst.cc
-        cpu/o3/alpha_cpu.cc
-        cpu/o3/alpha_cpu_builder.cc
-        cpu/o3/bpred_unit.cc
-        cpu/o3/btb.cc
-        cpu/o3/commit.cc
-        cpu/o3/decode.cc
-        cpu/o3/fetch.cc
-        cpu/o3/free_list.cc
-        cpu/o3/cpu.cc
-        cpu/o3/iew.cc
-        cpu/o3/inst_queue.cc
-        cpu/o3/ldstq.cc
-        cpu/o3/mem_dep_unit.cc
-        cpu/o3/ras.cc
-        cpu/o3/rename.cc
-        cpu/o3/rename_map.cc
-        cpu/o3/rob.cc
-        cpu/o3/sat_counter.cc
-        cpu/o3/store_set.cc
-        cpu/o3/tournament_pred.cc
-       cpu/fast/cpu.cc
         cpu/sampler/sampler.cc
-        cpu/simple/cpu.cc
-        cpu/trace/reader/mem_trace_reader.cc
-        cpu/trace/reader/ibm_reader.cc
-        cpu/trace/reader/itx_reader.cc
-        cpu/trace/reader/m5_reader.cc
-        cpu/trace/opt_cpu.cc
-        cpu/trace/trace_cpu.cc
-
-       encumbered/mem/functional/main.cc
 
         mem/memory.cc
         mem/page_table.cc
@@ -153,8 +117,28 @@ base_sources = Split('''
        sim/trace_context.cc
         ''')
 
+fast_cpu_sources = Split('''
+       arch/alpha/fast_cpu_exec.cc
+       cpu/fast/cpu.cc
+        ''')
+
+simple_cpu_sources = Split('''
+       arch/alpha/simple_cpu_exec.cc
+        cpu/simple/cpu.cc
+        ''')
+
+trace_reader_sources = Split('''
+        cpu/trace/reader/mem_trace_reader.cc
+        cpu/trace/reader/ibm_reader.cc
+        cpu/trace/reader/itx_reader.cc
+        cpu/trace/reader/m5_reader.cc
+        cpu/trace/opt_cpu.cc
+        cpu/trace/trace_cpu.cc
+        ''')
+
 full_cpu_sources = Split('''
        arch/alpha/full_cpu_exec.cc
+        cpu/base_dyn_inst.cc
        encumbered/cpu/full/bpred.cc
        encumbered/cpu/full/commit.cc
        encumbered/cpu/full/cpu.cc
@@ -191,6 +175,32 @@ full_cpu_sources = Split('''
         encumbered/cpu/full/iq/standard/iq_standard.cc
         ''')
 
+o3_cpu_sources = Split('''
+        arch/alpha/alpha_o3_exec.cc
+        cpu/o3/2bit_local_pred.cc
+        cpu/o3/alpha_dyn_inst.cc
+        cpu/o3/alpha_cpu.cc
+        cpu/o3/alpha_cpu_builder.cc
+        cpu/o3/bpred_unit.cc
+        cpu/o3/btb.cc
+        cpu/o3/commit.cc
+        cpu/o3/decode.cc
+        cpu/o3/fetch.cc
+        cpu/o3/free_list.cc
+        cpu/o3/cpu.cc
+        cpu/o3/iew.cc
+        cpu/o3/inst_queue.cc
+        cpu/o3/ldstq.cc
+        cpu/o3/mem_dep_unit.cc
+        cpu/o3/ras.cc
+        cpu/o3/rename.cc
+        cpu/o3/rename_map.cc
+        cpu/o3/rob.cc
+        cpu/o3/sat_counter.cc
+        cpu/o3/store_set.cc
+        cpu/o3/tournament_pred.cc
+        ''')
+
 # MySql sources
 mysql_sources = Split('''
        base/mysql.cc
index c81f7123fe026cb095a78a0cce8762e3c09e6a6d..18a0eaa5e165a3da527450602f4e95675c3fc3bd 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "base/loader/aout_object.hh"
 
-#include "mem/functional/functional.hh"
+#include "mem/memory.hh"
 #include "base/loader/symtab.hh"
 
 #include "base/trace.hh"       // for DPRINTF
@@ -78,7 +78,7 @@ AoutObject::AoutObject(const string &_filename, int _fd,
 
 
 bool
-AoutObject::loadSections(FunctionalMemory *mem, bool loadPhys)
+AoutObject::loadSections(Memory *mem, bool loadPhys)
 {
     Addr textAddr = text.baseAddr;
     Addr dataAddr = data.baseAddr;
index 1868192b2c922df3687ab09dcc446b687e41a869..44061c660bee43a2b84cea09da919f5b3afa99f8 100644 (file)
@@ -46,8 +46,7 @@ class AoutObject : public ObjectFile
   public:
     virtual ~AoutObject() {}
 
-    virtual bool loadSections(FunctionalMemory *mem,
-                              bool loadPhys = false);
+    virtual bool loadSections(Memory *mem, bool loadPhys = false);
     virtual bool loadGlobalSymbols(SymbolTable *symtab);
     virtual bool loadLocalSymbols(SymbolTable *symtab);
 
index 353a5f3333ca122774f4402e83204febc5db8adb..7df2cfa97deef9ba7620864919e3bac849f7cf81 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "base/loader/ecoff_object.hh"
 
-#include "mem/functional/functional.hh"
+#include "mem/memory.hh"
 #include "base/loader/symtab.hh"
 
 #include "base/trace.hh"       // for DPRINTF
@@ -82,7 +82,7 @@ EcoffObject::EcoffObject(const string &_filename, int _fd,
 
 
 bool
-EcoffObject::loadSections(FunctionalMemory *mem, bool loadPhys)
+EcoffObject::loadSections(Memory *mem, bool loadPhys)
 {
     Addr textAddr = text.baseAddr;
     Addr dataAddr = data.baseAddr;
index 78aa7f3f77c567ae66ccd577188a9bc2c3e6abad..c39aa9a3a68031424d2446b7ffdd141a5ca755a2 100644 (file)
@@ -50,8 +50,7 @@ class EcoffObject : public ObjectFile
   public:
     virtual ~EcoffObject() {}
 
-    virtual bool loadSections(FunctionalMemory *mem,
-                              bool loadPhys = false);
+    virtual bool loadSections(Memory *mem, bool loadPhys = false);
     virtual bool loadGlobalSymbols(SymbolTable *symtab);
     virtual bool loadLocalSymbols(SymbolTable *symtab);
 
index b74d537af8e7f9e42920fa5b6fd58a7e17de975b..fcac6c7f8911ef2b615bf87dc8d3442bb2db36f9 100644 (file)
@@ -43,7 +43,7 @@
 
 #include "base/loader/elf_object.hh"
 
-#include "mem/functional/functional.hh"
+#include "mem/memory.hh"
 #include "base/loader/symtab.hh"
 
 #include "base/trace.hh"       // for DPRINTF
@@ -170,7 +170,7 @@ ElfObject::ElfObject(const string &_filename, int _fd,
 
 
 bool
-ElfObject::loadSections(FunctionalMemory *mem, bool loadPhys)
+ElfObject::loadSections(Memory *mem, bool loadPhys)
 {
     Addr textAddr = text.baseAddr;
     Addr dataAddr = data.baseAddr;
index 66d8b3e639e5cf51aa57197bc33c43b53c64d096..324fe953596f9de868ceeeeee3594ef7d6f96151 100644 (file)
@@ -48,8 +48,7 @@ class ElfObject : public ObjectFile
   public:
     virtual ~ElfObject() {}
 
-    virtual bool loadSections(FunctionalMemory *mem,
-                              bool loadPhys = false);
+    virtual bool loadSections(Memory *mem, bool loadPhys = false);
     virtual bool loadGlobalSymbols(SymbolTable *symtab);
     virtual bool loadLocalSymbols(SymbolTable *symtab);
 
index 26d3ef3b02f95a9f718209cf0923842029a4f293..091e5493c4ab4fe677dff3cd04e8413cda0fd5b4 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "targetarch/isa_traits.hh"    // for Addr
 
-class FunctionalMemory;
+class Memory;
 class SymbolTable;
 
 class ObjectFile
@@ -67,8 +67,7 @@ class ObjectFile
 
     void close();
 
-    virtual bool loadSections(FunctionalMemory *mem,
-                              bool loadPhys = false) = 0;
+    virtual bool loadSections(Memory *mem, bool loadPhys = false) = 0;
     virtual bool loadGlobalSymbols(SymbolTable *symtab) = 0;
     virtual bool loadLocalSymbols(SymbolTable *symtab) = 0;
 
index 037319a8f03d152653ca28086cb7ce8b489710d7..edab25d0bede42875784678335e6cc28a34c37f1 100644 (file)
@@ -51,7 +51,7 @@ using namespace std;
 #if FULL_SYSTEM
 ExecContext::ExecContext(BaseCPU *_cpu, int _thread_num, System *_sys,
                          AlphaITB *_itb, AlphaDTB *_dtb,
-                         FunctionalMemory *_mem)
+                         Memory *_mem)
     : _status(ExecContext::Unallocated), cpu(_cpu), thread_num(_thread_num),
       cpu_id(-1), mem(_mem), itb(_itb), dtb(_dtb), system(_sys),
       memctrl(_sys->memctrl), physmem(_sys->physmem),
@@ -77,7 +77,7 @@ ExecContext::ExecContext(BaseCPU *_cpu, int _thread_num, System *_sys,
 }
 #else
 ExecContext::ExecContext(BaseCPU *_cpu, int _thread_num, System *_system,
-                         FunctionalMemory *_mem, Process *_process, int _asid)
+                         Memory *_mem, Process *_process, int _asid)
     : _status(ExecContext::Unallocated),
       cpu(_cpu), thread_num(_thread_num), cpu_id(-1),
       system(_system), mem(_mem),
index 7fa3902ccd272ad017a892f3d3409f7ba6981730..585aba0f180662386779d1051bc1c80003a2c5cb 100644 (file)
 
 #include <vector>
 
-#include "mem/mem_req.hh"
-
 class ExecContext;
 class PCEventQueue;
 
 class PCEvent
 {
-  protected:
-    static const Addr badpc = MemReq::inval_addr;
-
   protected:
     std::string description;
     PCEventQueue *queue;
index 0760f978c0e1706bb69ced7cd1b3077698ea3b9d..b6823fb631801680ed03e527a9dddc5ecd518ddf 100644 (file)
@@ -102,17 +102,42 @@ SimpleCPU::CacheCompletionEvent::CacheCompletionEvent(SimpleCPU *_cpu)
 {
 }
 
-void SimpleCPU::CacheCompletionEvent::process()
+
+bool
+SimpleCPU::CpuPort::recvTiming(Packet &pkt)
 {
-    cpu->processCacheCompletion();
+    cpu->processResponse(pkt);
+    return true;
 }
 
-const char *
-SimpleCPU::CacheCompletionEvent::description()
+Tick
+SimpleCPU::CpuPort::recvAtomic(Packet &pkt)
 {
-    return "SimpleCPU cache completion event";
+    panic("CPU doesn't expect callback!");
+    return curTick;
 }
 
+void
+SimpleCPU::CpuPort::recvFunctional(Packet &pkt)
+{
+    panic("CPU doesn't expect callback!");
+}
+
+void
+SimpleCPU::CpuPort::recvStatusChange(Status status)
+{
+    cpu->recvStatusChange(status);
+}
+
+Packet *
+SimpleCPU::CpuPort::recvRetry()
+{
+    return cpu->processRetry();
+}
+
+
+
+
 SimpleCPU::SimpleCPU(Params *p)
     : BaseCPU(p), tickEvent(this, p->width), xc(NULL),
       cacheCompletionEvent(this), dcachePort(this), icachePort(this)
@@ -697,9 +722,9 @@ SimpleCPU::sendDcacheRequest()
 void
 SimpleCPU::processResponse(Packet *response)
 {
-    // For what things is the CPU the consumer of the packet it sent out?
-    // This may create a memory leak if that's the case and it's expected of the
-    // SimpleCPU to delete its own packet.
+    // For what things is the CPU the consumer of the packet it sent
+    // out?  This may create a memory leak if that's the case and it's
+    // expected of the SimpleCPU to delete its own packet.
     pkt = response;
 
     switch (status()) {
index 42fec55f11c11f77a4e6997789a05dfe770b172a..3d445b001e97dae8bd4659d61e708e185d87ed55 100644 (file)
@@ -79,19 +79,15 @@ class SimpleCPU : public BaseCPU
 
       protected:
 
-        virtual bool recvTiming(Packet &pkt)
-        { cpu->processCacheCompletion(pkt); return true; }
+        virtual bool recvTiming(Packet &pkt);
 
-        virtual Tick recvAtomic(Packet &pkt)
-        { panic("CPU doesn't expect callback!"); return curTick; }
+        virtual Tick recvAtomic(Packet &pkt);
 
-        virtual void recvFunctional(Packet &pkt)
-        { panic("CPU doesn't expect callback!"); }
+        virtual void recvFunctional(Packet &pkt);
 
-        virtual void recvStatusChange(Status status)
-        { cpu->recvStatusChange(status); }
+        virtual void recvStatusChange(Status status);
 
-        virtual Packet *recvRetry() { return cpu->processRetry(); }
+        virtual Packet *recvRetry();
     };
 
     CpuPort icachePort;
index 6b32adb578b5bf24c5058a0931a92640d068c065..4e335e17c9c58a13fbc7a49d9f126d41a518f721 100644 (file)
@@ -121,7 +121,7 @@ class Port
         need to use two different ports.
     */
     virtual void recvAddressRangesQuery(std::list<Range<Addr> > &range_list,
-                                       bool &owner) = 0;
+                                        bool &owner) { panic("??"); }
 
   public:
 
index 24296f1df95ddd31108770965437fd89de600dd9..c3c1d0fd48b3250eab9a028a6de4ee725162c920 100644 (file)
@@ -54,6 +54,10 @@ const unsigned ALTMODE               = 0x008;
 const unsigned UNCACHEABLE     = 0x010;
 /** The request should not cause a page fault. */
 const unsigned NO_FAULT         = 0x020;
+/** The request should be prefetched into the exclusive state. */
+const unsigned PF_EXCLUSIVE    = 0x100;
+/** The request should be marked as LRU. */
+const unsigned EVICT_NEXT      = 0x200;
 
 class Request
 {
index ad8cb2e963523bce4cbcee3a82974dd0e1aacefc..26d6bf7087f1dc687c841f80ac12267cbc2d2c5c 100644 (file)
@@ -42,8 +42,8 @@
 #include "encumbered/cpu/full/thread.hh"
 #include "encumbered/eio/eio.hh"
 #include "mem/page_table.hh"
-#include "mem/functional/physical.hh"
-#include "mem/functional/proxy.hh"
+#include "mem/memory.hh"
+#include "mem/proxy.hh"
 #include "sim/builder.hh"
 #include "sim/fake_syscall.hh"
 #include "sim/process.hh"
@@ -154,7 +154,7 @@ Process::startup()
     if (execContexts.empty())
         fatal("Process %s is not associated with any CPUs!\n", name());
 
-    initVirtMem = new ProxyMemory<FunctionalMemory>(system->physmem, pTable);
+    initVirtMem = new ProxyMemory<Memory>(system->physmem, pTable);
 
     // first exec context for this process... initialize & enable
     ExecContext *xc = execContexts[0];
@@ -245,7 +245,7 @@ DEFINE_SIM_OBJECT_CLASS_NAME("Process", Process)
 
 static void
 copyStringArray(vector<string> &strings, Addr array_ptr, Addr data_ptr,
-                FunctionalMemory *func)
+                Memory *func)
 {
     for (int i = 0; i < strings.size(); ++i) {
         func->prot_write(array_ptr, (uint8_t*)&data_ptr, sizeof(Addr));
index 185ada2c51bd10753cbfb4ce83a4ff1c2e217dd2..bdaae9015b360dea9c5002be38176ae752690a30 100644 (file)
@@ -43,7 +43,7 @@
 #include <sys/uio.h>
 
 #include "base/intmath.hh"     // for RoundUp
-#include "mem/functional/functional.hh"
+#include "mem/port.hh"
 #include "targetarch/isa_traits.hh"    // for Addr
 
 #include "base/trace.hh"
@@ -103,18 +103,18 @@ class BaseBufferArg {
     //
     // copy data into simulator space (read from target memory)
     //
-    virtual bool copyIn(FunctionalMemory *mem)
+    virtual bool copyIn(Port *memport)
     {
-        mem->access(Read, addr, bufPtr, size);
+        memport->readBlobFunctional(addr, bufPtr, size);
         return true;   // no EFAULT detection for now
     }
 
     //
     // copy data out of simulator space (write to target memory)
     //
-    virtual bool copyOut(FunctionalMemory *mem)
+    virtual bool copyOut(Port *memport)
     {
-        mem->access(Write, addr, bufPtr, size);
+        memport->writeBlobFunctional(addr, bufPtr, size);
         return true;   // no EFAULT detection for now
     }
 
@@ -314,7 +314,7 @@ openFunc(SyscallDesc *desc, int callnum, Process *process,
 {
     std::string path;
 
-    if (xc->mem->readString(path, xc->getSyscallArg(0)) != No_Fault)
+    if (xc->mem->readStringFunctional(path, xc->getSyscallArg(0)) != No_Fault)
         return -EFAULT;
 
     if (path == "/dev/sysdev0") {
@@ -361,7 +361,7 @@ chmodFunc(SyscallDesc *desc, int callnum, Process *process,
 {
     std::string path;
 
-    if (xc->mem->readString(path, xc->getSyscallArg(0)) != No_Fault)
+    if (xc->mem->readStringFunctional(path, xc->getSyscallArg(0)) != No_Fault)
         return -EFAULT;
 
     uint32_t mode = xc->getSyscallArg(1);
@@ -414,7 +414,7 @@ statFunc(SyscallDesc *desc, int callnum, Process *process,
 {
     std::string path;
 
-    if (xc->mem->readString(path, xc->getSyscallArg(0)) != No_Fault)
+    if (xc->mem->readStringFunctional(path, xc->getSyscallArg(0)) != No_Fault)
         return -EFAULT;
 
     struct stat hostBuf;
@@ -461,7 +461,7 @@ lstatFunc(SyscallDesc *desc, int callnum, Process *process,
 {
     std::string path;
 
-    if (xc->mem->readString(path, xc->getSyscallArg(0)) != No_Fault)
+    if (xc->mem->readStringFunctional(path, xc->getSyscallArg(0)) != No_Fault)
         return -EFAULT;
 
     struct stat hostBuf;
@@ -483,7 +483,7 @@ lstat64Func(SyscallDesc *desc, int callnum, Process *process,
 {
     std::string path;
 
-    if (xc->mem->readString(path, xc->getSyscallArg(0)) != No_Fault)
+    if (xc->mem->readStringFunctional(path, xc->getSyscallArg(0)) != No_Fault)
         return -EFAULT;
 
     struct stat64 hostBuf;
@@ -530,7 +530,7 @@ statfsFunc(SyscallDesc *desc, int callnum, Process *process,
 {
     std::string path;
 
-    if (xc->mem->readString(path, xc->getSyscallArg(0)) != No_Fault)
+    if (xc->mem->readStringFunctional(path, xc->getSyscallArg(0)) != No_Fault)
         return -EFAULT;
 
     struct statfs hostBuf;
@@ -700,7 +700,7 @@ utimesFunc(SyscallDesc *desc, int callnum, Process *process,
 {
     std::string path;
 
-    if (xc->mem->readString(path, xc->getSyscallArg(0)) != No_Fault)
+    if (xc->mem->readStringFunctional(path, xc->getSyscallArg(0)) != No_Fault)
         return -EFAULT;
 
     TypedBufferArg<typename OS::timeval [2]> tp(xc->getSyscallArg(1));
index a79038308e3ff82d595a4de82ce3948984b9383c..07eb81c718f2635e1f5c5528189bf267b6c0d884 100644 (file)
@@ -29,7 +29,7 @@
 #include "base/loader/object_file.hh"
 #include "base/loader/symtab.hh"
 #include "cpu/exec_context.hh"
-#include "mem/functional/physical.hh"
+#include "mem/memory.hh"
 #include "sim/builder.hh"
 #include "sim/system.hh"
 #include "base/trace.hh"
@@ -410,7 +410,7 @@ printSystems()
 
 BEGIN_DECLARE_SIM_OBJECT_PARAMS(System)
 
-    SimObjectParam<PhysicalMemory *> physmem;
+    SimObjectParam<Memory *> physmem;
 
 #if FULL_SYSTEM
     Param<Tick> boot_cpu_frequency;
index 6602f8582fabbc1aee8cbe711a7ba87e6566a83f..8922373cc59904b2264ad58e068a2ea4d0bf3ddf 100644 (file)
@@ -44,7 +44,7 @@ class BaseCPU;
 class ExecContext;
 class MemoryController;
 class ObjectFile;
-class PhysicalMemory;
+class Memory;
 
 #if FULL_SYSTEM
 class Platform;
@@ -56,7 +56,7 @@ namespace Kernel { class Binning; }
 class System : public SimObject
 {
   public:
-    PhysicalMemory *physmem;
+    Memory *physmem;
     PCEventQueue pcEventQueue;
 
     std::vector<ExecContext *> execContexts;
@@ -176,7 +176,7 @@ class System : public SimObject
     struct Params
     {
         std::string name;
-        PhysicalMemory *physmem;
+        Memory *physmem;
 
 #if FULL_SYSTEM
         Tick boot_cpu_frequency;