ARM: Add m5ops and related support for workbegin() and workend() to ARM ISA.
authorGedare Bloom <gedare@gwmail.gwu.edu>
Fri, 17 Jun 2011 17:20:10 +0000 (12:20 -0500)
committerGedare Bloom <gedare@gwmail.gwu.edu>
Fri, 17 Jun 2011 17:20:10 +0000 (12:20 -0500)
configs/example/fs.py
src/arch/arm/isa/formats/m5ops.isa
src/arch/arm/isa/insts/m5ops.isa
util/m5/m5op.h
util/m5/m5op_arm.S

index 420cf1f8bc3fe3dda938374712d3ed290c8ed3dc..b8f50fc90becb48fffc4d11be4f4a35a704b53be 100644 (file)
@@ -137,6 +137,7 @@ elif buildEnv['TARGET_ISA'] == "arm":
     test_sys = makeArmSystem(test_mem_mode,
             options.machine_type, bm[0],
             bare_metal=options.bare_metal)
+    setWorkCountOptions(test_sys, options)
 else:
     fatal("incapable of building non-alpha or non-sparc full system!")
 
index 2f5fe2c3a728b49ad4a3f8fd9bc5cff678c80852..f532d828baa61ef8708fc8fcf128611d022cbc7f 100644 (file)
@@ -72,6 +72,8 @@ def format M5ops() {{
             case 0x53: return new M5addsymbol(machInst);
 #endif
             case 0x54: return new M5panic(machInst);
+            case 0x5a: return new M5workbegin(machInst);
+            case 0x5b: return new M5workend(machInst);
         }
    }
    '''
index b48e72b8a269052273c90fd5f401a32a8928398e..9bd1f4f01c7266151fa524c190f2c26ece04c91a 100644 (file)
@@ -313,4 +313,30 @@ let {{
     decoder_output += BasicConstructor.subst(m5panicIop)
     exec_output += PredOpExecute.subst(m5panicIop)
 
+    m5workbeginCode = '''PseudoInst::workbegin(
+                          xc->tcBase(),
+                          join32to64(R1, R0),
+                          join32to64(R3, R2)
+                      );'''
+    m5workbeginIop = InstObjParams("m5workbegin", "M5workbegin", "PredOp",
+                     { "code": m5workbeginCode,
+                       "predicate_test": predicateTest },
+                       ["IsNonSpeculative"])
+    header_output += BasicDeclare.subst(m5workbeginIop)
+    decoder_output += BasicConstructor.subst(m5workbeginIop)
+    exec_output += PredOpExecute.subst(m5workbeginIop)
+
+    m5workendCode = '''PseudoInst::workend(
+                        xc->tcBase(),
+                        join32to64(R1, R0),
+                        join32to64(R3, R2)
+                    );'''
+    m5workendIop = InstObjParams("m5workend", "M5workend", "PredOp",
+                     { "code": m5workendCode,
+                       "predicate_test": predicateTest },
+                       ["IsNonSpeculative"])
+    header_output += BasicDeclare.subst(m5workendIop)
+    decoder_output += BasicConstructor.subst(m5workendIop)
+    exec_output += PredOpExecute.subst(m5workendIop)
+
 }};
index b8f13da354cfe40db3455c656e5e0434386cee58..38815e3c30e26edf87adfad506124f3a49fd36bc 100644 (file)
@@ -53,6 +53,8 @@ void m5_debugbreak(void);
 void m5_switchcpu(void);
 void m5_addsymbol(uint64_t addr, char *symbol);
 void m5_panic(void);
+void m5_work_begin(uint64_t workid, uint64_t threadid);
+void m5_work_end(uint64_t workid, uint64_t threadid);
 
 // These operations are for critical path annotation
 void m5a_bsm(char *sm, const void *id, int flags);
index e3c6509e287aaa63a0d0b6eeae6793cf2d1ca10c..b1fb9adc74069ad47b0cb71101681fa01639d2e9 100644 (file)
@@ -84,6 +84,8 @@ func:
 #define SWITCHCPU INST(m5_op, 0, 0, switchcpu_func)
 #define ADDSYMBOL(r1,r2) INST(m5_op, r1, r2, addsymbol_func)
 #define PANIC INST(m5_op, 0, 0, panic_func)
+#define WORK_BEGIN(r1,r2) INST(m5_op, r1, r2, work_begin_func)
+#define WORK_END(r1,r2) INST(m5_op, r1, r2, work_end_func)
 
 #define AN_BSM INST(m5_op, an_bsm, 0, annotate_func)
 #define AN_ESM INST(m5_op, an_esm, 0, annotate_func)
@@ -123,6 +125,8 @@ SIMPLE_OP(m5_debugbreak, DEBUGBREAK)
 SIMPLE_OP(m5_switchcpu, SWITCHCPU)
 SIMPLE_OP(m5_addsymbol, ADDSYMBOL(0, 1))
 SIMPLE_OP(m5_panic, PANIC)
+SIMPLE_OP(m5_work_begin, WORK_BEGIN(0,1))
+SIMPLE_OP(m5_work_end, WORK_END(0,1))
 
 SIMPLE_OP(m5a_bsm, AN_BSM)
 SIMPLE_OP(m5a_esm, AN_ESM)