CPU: Prepare CPU models for the new in-order CPU model.
authorKorey Sewell <ksewell@umich.edu>
Tue, 10 Feb 2009 23:49:29 +0000 (15:49 -0800)
committerKorey Sewell <ksewell@umich.edu>
Tue, 10 Feb 2009 23:49:29 +0000 (15:49 -0800)
Some new functions and forward declarations are necessary to make things work

src/cpu/SConscript
src/cpu/o3/ras.hh
src/cpu/static_inst.hh

index f210cec9b7a67f5b98d4455f4846d54b042a1a34..eee8edca433cfad3202ece6859e487c6ee90b1d4 100644 (file)
@@ -48,12 +48,14 @@ execfile(models_db.srcnode().abspath)
 
 # Template for execute() signature.
 exec_sig_template = '''
-virtual Fault execute(%s *xc, Trace::InstRecord *traceData) const = 0;
-virtual Fault initiateAcc(%s *xc, Trace::InstRecord *traceData) const
+virtual Fault execute(%(type)s *xc, Trace::InstRecord *traceData) const = 0;
+virtual Fault initiateAcc(%(type)s *xc, Trace::InstRecord *traceData) const
 { panic("initiateAcc not defined!"); M5_DUMMY_RETURN };
-virtual Fault completeAcc(Packet *pkt, %s *xc,
+virtual Fault completeAcc(Packet *pkt, %(type)s *xc,
                           Trace::InstRecord *traceData) const
 { panic("completeAcc not defined!"); M5_DUMMY_RETURN };
+virtual int memAccSize(%(type)s *xc)
+{ panic("memAccSize not defined!"); M5_DUMMY_RETURN };
 '''
 
 mem_ini_sig_template = '''
@@ -82,7 +84,7 @@ def gen_cpu_exec_signatures(target, source, env):
 '''
     for cpu in temp_cpu_list:
         xc_type = CpuModel.dict[cpu].strings['CPU_exec_context']
-        print >> f, exec_sig_template % (xc_type, xc_type, xc_type)
+        print >> f, exec_sig_template % { 'type' : xc_type }
     print >> f, '''
 #endif  // __CPU_STATIC_INST_EXEC_SIGS_HH__
 '''
index 97846ed1666a1449f3e964829365efb1c6514565..f0621c5b56ac9af997838b83a53f113d638dec84 100644 (file)
@@ -71,6 +71,9 @@ class ReturnAddrStack
      */
     void restore(unsigned top_entry_idx, const Addr &restored_target);
 
+     bool empty() { return usedEntries == 0; }
+
+     bool full() { return usedEntries == numEntries; }
   private:
     /** Increments the top of stack index. */
     inline void incrTos()
index 032a304ad8aee9f6748a95da0a800593d0d87990..f28b53ccf8458e3c5e0055b24a5ff93aa734e4cb 100644 (file)
@@ -56,9 +56,8 @@ class Packet;
 class O3CPUImpl;
 template <class Impl> class BaseO3DynInst;
 typedef BaseO3DynInst<O3CPUImpl> O3DynInst;
-
-template <class Impl>
-class OzoneDynInst;
+template <class Impl> class OzoneDynInst;
+class InOrderDynInst;
 
 class CheckerCPU;
 class FastCPU;
@@ -434,6 +433,12 @@ class StaticInst : public StaticInstBase
      */
     bool hasBranchTarget(Addr pc, ThreadContext *tc, Addr &tgt) const;
 
+    virtual Request::Flags memAccFlags()
+    {
+        panic("StaticInst::memAccFlags called on non-memory instruction");
+        return 0;
+    };
+
     /**
      * Return string representation of disassembled instruction.
      * The default version of this function will call the internal