41 #ifndef __SIM_PSEUDO_INST_HH__ 42 #define __SIM_PSEUDO_INST_HH__ 44 #include <gem5/asm/generic/m5ops.h> 48 #include "arch/pseudo_inst.hh" 49 #include "arch/utility.hh" 51 #include "debug/PseudoInst.hh" 83 func =
bits(offset, 15, 8);
95 uint64_t offset,
Addr filenameAddr);
127 template <
typename ABI,
bool store_ret>
137 invokeSimcall<ABI>(tc,
arm);
141 invokeSimcall<ABI>(tc,
quiesce);
144 case M5OP_QUIESCE_NS:
148 case M5OP_QUIESCE_CYCLE:
152 case M5OP_QUIESCE_TIME:
153 result = invokeSimcall<ABI, store_ret>(tc,
quiesceTime);
157 result = invokeSimcall<ABI, store_ret>(tc,
rpns);
161 invokeSimcall<ABI>(tc,
wakeCPU);
165 invokeSimcall<ABI>(tc,
m5exit);
169 invokeSimcall<ABI>(tc,
m5fail);
172 case M5OP_INIT_PARAM:
173 result = invokeSimcall<ABI, store_ret>(tc,
initParam);
176 case M5OP_LOAD_SYMBOL:
180 case M5OP_RESET_STATS:
184 case M5OP_DUMP_STATS:
188 case M5OP_DUMP_RESET_STATS:
192 case M5OP_CHECKPOINT:
196 case M5OP_WRITE_FILE:
197 result = invokeSimcall<ABI, store_ret>(tc,
writefile);
201 result = invokeSimcall<ABI, store_ret>(tc,
readfile);
204 case M5OP_DEBUG_BREAK:
208 case M5OP_SWITCH_CPU:
212 case M5OP_ADD_SYMBOL:
217 panic(
"M5 panic instruction called at %s\n", tc->pcState());
219 case M5OP_WORK_BEGIN:
224 invokeSimcall<ABI>(tc,
workend);
232 warn(
"Unimplemented m5 op (%#x)\n", func);
236 case M5OP_SE_SYSCALL:
240 case M5OP_SE_PAGE_FAULT:
245 case M5OP_DIST_TOGGLE_SYNC:
250 warn(
"Unhandled m5 op: %#x\n", func);
255 template <
typename ABI,
bool store_ret=false>
259 return pseudoInstWork<ABI, store_ret>(tc, func, result);
262 template <
typename ABI,
bool store_ret=true>
267 return pseudoInstWork<ABI, store_ret>(tc, func, result);
272 #endif // __SIM_PSEUDO_INST_HH__ #define panic(...)
This implements a cprintf based panic() function.
void m5fail(ThreadContext *tc, Tick delay, uint64_t code)
void m5PageFault(ThreadContext *tc)
void quiesceNs(ThreadContext *tc, uint64_t ns)
bool pseudoInstWork(ThreadContext *tc, uint8_t func, uint64_t &result)
Execute a decoded M5 pseudo instruction.
void arm(ThreadContext *tc)
static void decodeAddrOffset(Addr offset, uint8_t &func)
void dumpresetstats(ThreadContext *tc, Tick delay, Tick period)
uint64_t quiesceTime(ThreadContext *tc)
void quiesceSkip(ThreadContext *tc)
void m5checkpoint(ThreadContext *tc, Tick delay, Tick period)
uint64_t writefile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset, Addr filename_addr)
void quiesceCycles(ThreadContext *tc, uint64_t cycles)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
void togglesync(ThreadContext *tc)
uint64_t initParam(ThreadContext *tc, uint64_t key_str1, uint64_t key_str2)
void quiesce(ThreadContext *tc)
uint64_t Tick
Tick count type.
uint64_t getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
void switchcpu(ThreadContext *tc)
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void debugbreak(ThreadContext *tc)
void workbegin(ThreadContext *tc, uint64_t workid, uint64_t threadid)
void resetstats(ThreadContext *tc, Tick delay, Tick period)
uint64_t readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
void wakeCPU(ThreadContext *tc, uint64_t cpuid)
void dumpstats(ThreadContext *tc, Tick delay, Tick period)
void m5exit(ThreadContext *tc, Tick delay)
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it...
void addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr)
void loadsymbol(ThreadContext *tc)
void workend(ThreadContext *tc, uint64_t workid, uint64_t threadid)
void m5Syscall(ThreadContext *tc)
bool pseudoInst(ThreadContext *tc, uint8_t func)
uint64_t rpns(ThreadContext *tc)