# HG changeset patch
# User Gabe Black <[email protected]>
# Date 1247029672 25200
# Node ID 390b00170a5874e09107d0b16f33ce59e1e7111d
# Parent  ba161dcdbde4ce9fc6f5e7424095a1121897e18b
ARM: Get rid of the MemAcc and EAComp static insts.

diff --git a/src/arch/arm/insts/macromem.hh b/src/arch/arm/insts/macromem.hh
--- a/src/arch/arm/insts/macromem.hh
+++ b/src/arch/arm/insts/macromem.hh
@@ -54,10 +54,6 @@
     protected:
     /// Memory request flags.  See mem_req_base.hh.
     unsigned memAccessFlags;
-    /// Pointer to EAComp object.
-    const StaticInstPtr eaCompPtr;
-    /// Pointer to MemAcc object.
-    const StaticInstPtr memAccPtr;
 
     uint32_t reglist;
     uint32_t ones;
@@ -69,12 +65,9 @@
              loadop;
 
     ArmMacroMemoryOp(const char *mnem, ExtMachInst _machInst,
-                     OpClass __opClass,
-                     StaticInstPtr _eaCompPtr = nullStaticInstPtr,
-                     StaticInstPtr _memAccPtr = nullStaticInstPtr)
+                     OpClass __opClass)
             : PredMacroOp(mnem, _machInst, __opClass),
                           memAccessFlags(0),
-                          eaCompPtr(_eaCompPtr), memAccPtr(_memAccPtr),
                           reglist(machInst.regList), ones(0),
                           puswl(machInst.puswl),
                           prepost(machInst.puswl.prepost),
diff --git a/src/arch/arm/insts/mem.hh b/src/arch/arm/insts/mem.hh
--- a/src/arch/arm/insts/mem.hh
+++ b/src/arch/arm/insts/mem.hh
@@ -42,10 +42,6 @@
 
     /// Memory request flags.  See mem_req_base.hh.
     unsigned memAccessFlags;
-    /// Pointer to EAComp object.
-    const StaticInstPtr eaCompPtr;
-    /// Pointer to MemAcc object.
-    const StaticInstPtr memAccPtr;
 
     /// Displacement for EA calculation (signed).
     int32_t disp;
@@ -56,12 +52,9 @@
             shift;
 
     /// Constructor
-    Memory(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
-           StaticInstPtr _eaCompPtr = nullStaticInstPtr,
-           StaticInstPtr _memAccPtr = nullStaticInstPtr)
+    Memory(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
         : PredOp(mnem, _machInst, __opClass),
                  memAccessFlags(0),
-                 eaCompPtr(_eaCompPtr), memAccPtr(_memAccPtr),
                  disp(machInst.immed11_0),
                  disp8(machInst.immed7_0 << 2),
                  up(machInst.puswl.up),
@@ -72,11 +65,6 @@
 
     std::string
     generateDisassembly(Addr pc, const SymbolTable *symtab) const;
-
-  public:
-
-    const StaticInstPtr &eaCompInst() const { return eaCompPtr; }
-    const StaticInstPtr &memAccInst() const { return memAccPtr; }
 };
 
  /**
@@ -87,10 +75,8 @@
 {
   protected:
     /// Constructor
-    MemoryNoDisp(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
-                 StaticInstPtr _eaCompPtr = nullStaticInstPtr,
-                 StaticInstPtr _memAccPtr = nullStaticInstPtr)
-        : Memory(mnem, _machInst, __opClass, _eaCompPtr, _memAccPtr)
+    MemoryNoDisp(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
+        : Memory(mnem, _machInst, __opClass)
     {
     }
 
diff --git a/src/arch/arm/isa/formats/mem.isa b/src/arch/arm/isa/formats/mem.isa
--- a/src/arch/arm/isa/formats/mem.isa
+++ b/src/arch/arm/isa/formats/mem.isa
@@ -39,32 +39,6 @@
      */
     class %(class_name)s : public %(base_class)s
     {
-      protected:
-
-        /**
-         * "Fake" effective address computation class for "%(mnemonic)s".
-         */
-        class EAComp : public %(base_class)s
-        {
-          public:
-            /// Constructor
-            EAComp(ExtMachInst machInst);
-
-            %(BasicExecDeclare)s
-        };
-
-        /**
-         * "Fake" memory access instruction class for "%(mnemonic)s".
-         */
-        class MemAcc : public %(base_class)s
-        {
-          public:
-            /// Constructor
-            MemAcc(ExtMachInst machInst);
-
-            %(BasicExecDeclare)s
-        };
-
       public:
 
         /// Constructor.
@@ -89,83 +63,11 @@
 }};
 
 
-def template EACompConstructor {{
-    inline %(class_name)s::EAComp::EAComp(ExtMachInst machInst)
-        : %(base_class)s("%(mnemonic)s (EAComp)", machInst, IntAluOp)
+def template LoadStoreConstructor {{
+    inline %(class_name)s::%(class_name)s(ExtMachInst machInst)
+         : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s)
     {
         %(constructor)s;
-    }
-}};
-
-
-def template MemAccConstructor {{
-    inline %(class_name)s::MemAcc::MemAcc(ExtMachInst machInst)
-        : %(base_class)s("%(mnemonic)s (MemAcc)", machInst, %(op_class)s)
-    {
-        %(constructor)s;
-    }
-}};
-
-
-def template LoadStoreConstructor {{
-    inline %(class_name)s::%(class_name)s(ExtMachInst machInst)
-         : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s,
-                          new EAComp(machInst), new MemAcc(machInst))
-    {
-        %(constructor)s;
-    }
-}};
-
-
-def template EACompExecute {{
-    Fault
-    %(class_name)s::EAComp::execute(%(CPU_exec_context)s *xc,
-                                   Trace::InstRecord *traceData) const
-    {
-        Addr EA;
-        Fault fault = NoFault;
-
-        %(op_decl)s;
-        %(op_rd)s;
-        %(ea_code)s;
-
-        if (%(predicate_test)s)
-        {
-            if (fault == NoFault) {
-                %(op_wb)s;
-                xc->setEA(EA);
-            }
-        }
-
-        return fault;
-    }
-}};
-
-def template LoadMemAccExecute {{
-    Fault
-    %(class_name)s::MemAcc::execute(%(CPU_exec_context)s *xc,
-                                   Trace::InstRecord *traceData) const
-    {
-        Addr EA;
-        Fault fault = NoFault;
-
-        %(op_decl)s;
-        %(op_rd)s;
-        EA = xc->getEA();
-
-        if (%(predicate_test)s)
-        {
-            if (fault == NoFault) {
-                fault = xc->read(EA, (uint%(mem_acc_size)d_t&)Mem, 
memAccessFlags);
-                %(memacc_code)s;
-            }
-
-            if (fault == NoFault) {
-                %(op_wb)s;
-            }
-        }
-
-        return fault;
     }
 }};
 
@@ -238,37 +140,6 @@
 
             if (fault == NoFault) {
                 %(memacc_code)s;
-            }
-
-            if (fault == NoFault) {
-                %(op_wb)s;
-            }
-        }
-
-        return fault;
-    }
-}};
-
-
-def template StoreMemAccExecute {{
-    Fault
-    %(class_name)s::MemAcc::execute(%(CPU_exec_context)s *xc,
-                                   Trace::InstRecord *traceData) const
-    {
-        Addr EA;
-        Fault fault = NoFault;
-
-        %(op_decl)s;
-        %(op_rd)s;
-
-        if (%(predicate_test)s)
-        {
-            EA = xc->getEA();
-
-            if (fault == NoFault) {
-                fault = xc->write((uint%(mem_acc_size)d_t&)Mem, EA,
-                                  memAccessFlags, NULL);
-                if (traceData) { traceData->setData(Mem); }
             }
 
             if (fault == NoFault) {
@@ -385,73 +256,6 @@
         }
 
         return fault;
-    }
-}};
-
-
-def template MiscMemAccExecute {{
-    Fault %(class_name)s::MemAcc::execute(%(CPU_exec_context)s *xc,
-                                          Trace::InstRecord *traceData) const
-    {
-        Addr EA;
-        Fault fault = NoFault;
-
-        %(op_decl)s;
-        %(op_rd)s;
-
-        if (%(predicate_test)s)
-        {
-            EA = xc->getEA();
-
-            if (fault == NoFault) {
-                %(memacc_code)s;
-            }
-        }
-
-        return NoFault;
-    }
-}};
-
-def template MiscExecute {{
-    Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
-                                  Trace::InstRecord *traceData) const
-    {
-        Addr EA;
-        Fault fault = NoFault;
-
-        %(op_decl)s;
-        %(op_rd)s;
-        %(ea_code)s;
-
-        if (%(predicate_test)s)
-        {
-            if (fault == NoFault) {
-                %(memacc_code)s;
-            }
-        }
-
-        return NoFault;
-    }
-}};
-
-def template MiscInitiateAcc {{
-    Fault %(class_name)s::initiateAcc(%(CPU_exec_context)s *xc,
-                                      Trace::InstRecord *traceData) const
-    {
-        panic("Misc instruction does not support split access method!");
-        return NoFault;
-    }
-}};
-
-
-def template MiscCompleteAcc {{
-    Fault %(class_name)s::completeAcc(PacketPtr pkt,
-                                      %(CPU_exec_context)s *xc,
-                                      Trace::InstRecord *traceData) const
-    {
-        panic("Misc instruction does not support split access method!");
-
-        return NoFault;
     }
 }};
 
diff --git a/src/arch/arm/isa/formats/util.isa 
b/src/arch/arm/isa/formats/util.isa
--- a/src/arch/arm/isa/formats/util.isa
+++ b/src/arch/arm/isa/formats/util.isa
@@ -44,31 +44,11 @@
     mem_flags = makeList(mem_flags)
     inst_flags = makeList(inst_flags)
 
-    # add hook to get effective addresses into execution trace output.
-    ea_code += '\nif (traceData) { traceData->setAddr(EA); }\n'
-
-    # Some CPU models execute the memory operation as an atomic unit,
-    # while others want to separate them into an effective address
-    # computation and a memory access operation.  As a result, we need
-    # to generate three StaticInst objects.  Note that the latter two
-    # are nested inside the larger "atomic" one.
-
-    # Generate InstObjParams for each of the three objects.  Note that
-    # they differ only in the set of code objects contained (which in
-    # turn affects the object's overall operand list).
     iop = InstObjParams(name, Name, base_class,
                         {'ea_code': ea_code,
                          'memacc_code': memacc_code,
                          'predicate_test': predicateTest},
                         inst_flags)
-    ea_iop = InstObjParams(name, Name, base_class,
-                           {'ea_code': ea_code,
-                            'predicate_test': predicateTest},
-                           inst_flags)
-    memacc_iop = InstObjParams(name, Name, base_class,
-                               {'memacc_code': memacc_code,
-                                'predicate_test': predicateTest},
-                               inst_flags)
 
     if mem_flags:
         s = '\n\tmemAccessFlags = ' + string.join(mem_flags, '|') + ';'
@@ -81,20 +61,15 @@
     # corresponding Store template..
     StoreCondInitiateAcc = StoreInitiateAcc
 
-    memAccExecTemplate = eval(exec_template_base + 'MemAccExecute')
     fullExecTemplate = eval(exec_template_base + 'Execute')
     initiateAccTemplate = eval(exec_template_base + 'InitiateAcc')
     completeAccTemplate = eval(exec_template_base + 'CompleteAcc')
 
     # (header_output, decoder_output, decode_block, exec_output)
     return (LoadStoreDeclare.subst(iop),
-            EACompConstructor.subst(ea_iop)
-            + MemAccConstructor.subst(memacc_iop)
-            + LoadStoreConstructor.subst(iop),
+            LoadStoreConstructor.subst(iop),
             decode_template.subst(iop),
-            EACompExecute.subst(ea_iop)
-            + memAccExecTemplate.subst(memacc_iop)
-            + fullExecTemplate.subst(iop)
+            fullExecTemplate.subst(iop)
             + initiateAccTemplate.subst(iop)
             + completeAccTemplate.subst(iop))
 }};
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to