#define M5OP_AN_GETID 0x11
-#define M5OP_FOREACH \
- M5OP(arm, M5OP_ARM, 0); \
- M5OP(quiesce, M5OP_QUIESCE, 0); \
- M5OP(quiesceNs, M5OP_QUIESCE_NS, 0); \
- M5OP(quiesceCycle, M5OP_QUIESCE_CYCLE, 0); \
- M5OP(quiesceTime, M5OP_QUIESCE_TIME, 0); \
- M5OP(rpns, M5OP_RPNS, 0); \
- M5OP(wakeCPU, M5OP_WAKE_CPU, 0); \
- M5OP(m5_exit, M5OP_EXIT, 0); \
- M5OP(m5_fail, M5OP_FAIL, 0); \
- M5OP(m5_initparam, M5OP_INIT_PARAM, 0); \
- M5OP(m5_loadsymbol, M5OP_LOAD_SYMBOL, 0); \
- M5OP(m5_reset_stats, M5OP_RESET_STATS, 0); \
- M5OP(m5_dump_stats, M5OP_DUMP_STATS, 0); \
- M5OP(m5_dumpreset_stats, M5OP_DUMP_RESET_STATS, 0); \
- M5OP(m5_checkpoint, M5OP_CHECKPOINT, 0); \
- M5OP(m5_readfile, M5OP_READ_FILE, 0); \
- M5OP(m5_writefile, M5OP_WRITE_FILE, 0); \
- M5OP(m5_debugbreak, M5OP_DEBUG_BREAK, 0); \
- M5OP(m5_switchcpu, M5OP_SWITCH_CPU, 0); \
- M5OP(m5_addsymbol, M5OP_ADD_SYMBOL, 0); \
- M5OP(m5_panic, M5OP_PANIC, 0); \
- M5OP(m5_work_begin, M5OP_WORK_BEGIN, 0); \
- M5OP(m5_work_end, M5OP_WORK_END, 0); \
- M5OP(m5_togglesync, M5OP_DIST_TOGGLE_SYNC, 0);
+#define M5OP_FOREACH \
+ M5OP(m5_arm, M5OP_ARM, 0); \
+ M5OP(m5_quiesce, M5OP_QUIESCE, 0); \
+ M5OP(m5_quiesce_ns, M5OP_QUIESCE_NS, 0); \
+ M5OP(m5_quiesce_cycle, M5OP_QUIESCE_CYCLE, 0); \
+ M5OP(m5_quiesce_time, M5OP_QUIESCE_TIME, 0); \
+ M5OP(m5_rpns, M5OP_RPNS, 0); \
+ M5OP(m5_wake_cpu, M5OP_WAKE_CPU, 0); \
+ M5OP(m5_exit, M5OP_EXIT, 0); \
+ M5OP(m5_fail, M5OP_FAIL, 0); \
+ M5OP(m5_init_param, M5OP_INIT_PARAM, 0); \
+ M5OP(m5_load_symbol, M5OP_LOAD_SYMBOL, 0); \
+ M5OP(m5_reset_stats, M5OP_RESET_STATS, 0); \
+ M5OP(m5_dump_stats, M5OP_DUMP_STATS, 0); \
+ M5OP(m5_dump_reset_stats, M5OP_DUMP_RESET_STATS, 0); \
+ M5OP(m5_checkpoint, M5OP_CHECKPOINT, 0); \
+ M5OP(m5_read_file, M5OP_READ_FILE, 0); \
+ M5OP(m5_write_file, M5OP_WRITE_FILE, 0); \
+ M5OP(m5_debug_break, M5OP_DEBUG_BREAK, 0); \
+ M5OP(m5_switch_cpu, M5OP_SWITCH_CPU, 0); \
+ M5OP(m5_add_symbol, M5OP_ADD_SYMBOL, 0); \
+ M5OP(m5_panic, M5OP_PANIC, 0); \
+ M5OP(m5_work_begin, M5OP_WORK_BEGIN, 0); \
+ M5OP(m5_work_end, M5OP_WORK_END, 0); \
+ M5OP(m5_dist_togglesync, M5OP_DIST_TOGGLE_SYNC, 0);
#define M5OP_FOREACH_ANNOTATION \
M5_ANNOTATION(m5a_bsm, M5OP_AN_BSM); \
// Linux does demand paging.
memset(buf, 0, sizeof(buf));
- while ((len = m5_readfile(buf, sizeof(buf), offset)) > 0) {
+ while ((len = m5_read_file(buf, sizeof(buf), offset)) > 0) {
uint8_t *base = buf;
offset += len;
do {
memset(buf, 0, sizeof(buf));
while ((len = read(src_fid, buf, sizeof(buf))) > 0) {
- bytes += m5_writefile(buf, len, offset, filename);
+ bytes += m5_write_file(buf, len, offset, filename);
offset += len;
}
fprintf(stderr, "written %d bytes\n", bytes);
{
uint64_t ints[2];
parse_int_args(argc, argv, ints, 2);
- m5_dumpreset_stats(ints[0], ints[1]);
+ m5_dump_reset_stats(ints[0], ints[1]);
}
void
uint64_t addr = strtoul(argv[0], NULL, 0);
char *symbol = argv[1];
- m5_addsymbol(addr, symbol);
+ m5_add_symbol(addr, symbol);
}
if (argc > 0)
usage();
- m5_loadsymbol();
+ m5_load_symbol();
}
void
uint64_t key_str[2];
parse_str_args_to_regs(argc, argv, key_str, 2);
- uint64_t val = m5_initparam(key_str[0], key_str[1]);
+ uint64_t val = m5_init_param(key_str[0], key_str[1]);
printf("%"PRIu64, val);
}
if (argc != 0)
usage();
- uint64_t param = m5_initparam(0, 0);
+ uint64_t param = m5_init_param(0, 0);
// run-time, rampup-time, rampdown-time, warmup-time, connections
printf("%"PRId64" %"PRId64" %"PRId64" %"PRId64" %"PRId64,
#include <stdint.h>
-void arm(uint64_t address);
-void quiesce(void);
-void quiesceNs(uint64_t ns);
-void quiesceCycle(uint64_t cycles);
-uint64_t quiesceTime(void);
-uint64_t rpns();
-void wakeCPU(uint64_t cpuid);
+void m5_arm(uint64_t address);
+void m5_quiesce(void);
+void m5_quiesce_ns(uint64_t ns);
+void m5_quiesce_cycle(uint64_t cycles);
+uint64_t m5_quiesce_time(void);
+uint64_t m5_rpns();
+void m5_wake_cpu(uint64_t cpuid);
void m5_exit(uint64_t ns_delay);
void m5_fail(uint64_t ns_delay, uint64_t code);
-uint64_t m5_initparam(uint64_t key_str1, uint64_t key_str2);
+uint64_t m5_init_param(uint64_t key_str1, uint64_t key_str2);
void m5_checkpoint(uint64_t ns_delay, uint64_t ns_period);
void m5_reset_stats(uint64_t ns_delay, uint64_t ns_period);
void m5_dump_stats(uint64_t ns_delay, uint64_t ns_period);
-void m5_dumpreset_stats(uint64_t ns_delay, uint64_t ns_period);
-uint64_t m5_readfile(void *buffer, uint64_t len, uint64_t offset);
-uint64_t m5_writefile(void *buffer, uint64_t len, uint64_t offset, const char *filename);
-void m5_debugbreak(void);
-void m5_switchcpu(void);
-void m5_togglesync(void);
-void m5_addsymbol(uint64_t addr, char *symbol);
+void m5_dump_reset_stats(uint64_t ns_delay, uint64_t ns_period);
+uint64_t m5_read_file(void *buffer, uint64_t len, uint64_t offset);
+uint64_t m5_write_file(void *buffer, uint64_t len, uint64_t offset,
+ const char *filename);
+void m5_debug_break(void);
+void m5_switch_cpu(void);
+void m5_dist_toggle_sync(void);
+void m5_add_symbol(uint64_t addr, char *symbol);
void m5_loadsymbol();
void m5_panic(void);
void m5_work_begin(uint64_t workid, uint64_t threadid);
.set noreorder
-SIMPLE_OP(arm, ARM(16))
-SIMPLE_OP(quiesce, QUIESCE)
-SIMPLE_OP(quiesceNs, QUIESCENS(16))
-SIMPLE_OP(quiesceCycle, QUIESCECYC(16))
-SIMPLE_OP(quiesceTime, QUIESCETIME)
-SIMPLE_OP(rpns, RPNS)
-SIMPLE_OP(wakeCPU, WAKE_CPU(16))
+SIMPLE_OP(m5_arm, ARM(16))
+SIMPLE_OP(m5_quiesce, QUIESCE)
+SIMPLE_OP(m5_quiesce_ns, QUIESCENS(16))
+SIMPLE_OP(m5_quiesce_cycle, QUIESCECYC(16))
+SIMPLE_OP(m5_quiesce_time, QUIESCETIME)
+SIMPLE_OP(m5_rpns, RPNS)
+SIMPLE_OP(m5_wake_cpu, WAKE_CPU(16))
SIMPLE_OP(m5_exit, M5EXIT(16))
-SIMPLE_OP(m5_initparam, INITPARAM(0))
-SIMPLE_OP(m5_loadsymbol, LOADSYMBOL(0))
+SIMPLE_OP(m5_init_param, INITPARAM(0))
+SIMPLE_OP(m5_load_symbol, LOADSYMBOL(0))
SIMPLE_OP(m5_reset_stats, RESET_STATS(16, 17))
SIMPLE_OP(m5_dump_stats, DUMP_STATS(16, 17))
-SIMPLE_OP(m5_dumpreset_stats, DUMPRST_STATS(16, 17))
+SIMPLE_OP(m5_dump_reset_stats, DUMPRST_STATS(16, 17))
SIMPLE_OP(m5_checkpoint, CHECKPOINT(16, 17))
-SIMPLE_OP(m5_readfile, READFILE)
-SIMPLE_OP(m5_debugbreak, DEBUGBREAK)
-SIMPLE_OP(m5_switchcpu, SWITCHCPU)
-SIMPLE_OP(m5_addsymbol, ADDSYMBOL(16, 17))
+SIMPLE_OP(m5_read_file, READFILE)
+SIMPLE_OP(m5_debug_break, DEBUGBREAK)
+SIMPLE_OP(m5_switch_cpu, SWITCHCPU)
+SIMPLE_OP(m5_add_symbol, ADDSYMBOL(16, 17))
SIMPLE_OP(m5_panic, PANIC)
SIMPLE_OP(m5a_bsm, AN_BSM)
PANIC
END(m5_panic)
-LEAF(m5_readfile)
+LEAF(m5_read_file)
retl
READFILE
-END(m5_readfile)
+END(m5_read_file)
-LEAF(m5_debugbreak)
+LEAF(m5_debug_break)
retl
DEBUGBREAK
-END(m5_debugbreak)
+END(m5_debug_break)
/* !!!!!! All code below here just panics !!!!!! */
-LEAF(arm)
+LEAF(m5_arm)
retl
PANIC
-END(arm)
+END(m5_arm)
-LEAF(quiesce)
+LEAF(m5_quiesce)
retl
PANIC
-END(quiesce)
+END(m5_quiesce)
-LEAF(quiesceNs)
+LEAF(m5_quiesce_ns)
retl
PANIC
-END(quiesceNs)
+END(m5_quiesce_ns)
-LEAF(quiesceCycle)
+LEAF(m5_quiesce_cycle)
retl
PANIC
-END(quiesceCycle)
+END(m5_quiesce_cycle)
-LEAF(quiesceTime)
+LEAF(m5_quiesce_time)
retl
PANIC
-END(quiesceTime)
+END(m5_quiesce_time)
-LEAF(m5_initparam)
+LEAF(m5_init_param)
retl
PANIC
-END(m5_initparam)
+END(m5_init_param)
-LEAF(m5_loadsymbol)
+LEAF(m5_load_symbol)
retl
PANIC
-END(m5_loadsymbol)
+END(m5_load_symbol)
LEAF(m5_reset_stats)
retl
PANIC
END(m5_dump_stats)
-LEAF(m5_dumpreset_stats)
+LEAF(m5_dump_reset_stats)
retl
PANIC
-END(m5_dumpreset_stats)
+END(m5_dump_reset_stats)
LEAF(m5_checkpoint)
retl
PANIC
END(m5_checkpoint)
-LEAF(m5_switchcpu)
+LEAF(m5_switch_cpu)
retl
PANIC
-END(m5_switchcpu)
+END(m5_switch_cpu)
-LEAF(m5_addsymbol)
+LEAF(m5_add_symbol)
retl
PANIC
-END(m5_addsymbol)
+END(m5_add_symbol)
LEAF(m5_anbegin)
retl
#endif
-TWO_BYTE_OP(arm, M5OP_ARM)
-TWO_BYTE_OP(quiesce, M5OP_QUIESCE)
-TWO_BYTE_OP(quiesceNs, M5OP_QUIESCE_NS)
-TWO_BYTE_OP(quiesceCycle, M5OP_QUIESCE_CYCLE)
-TWO_BYTE_OP(quiesceTime, M5OP_QUIESCE_TIME)
-TWO_BYTE_OP(rpns, M5OP_RPNS)
+TWO_BYTE_OP(m5_arm, M5OP_ARM)
+TWO_BYTE_OP(m5_quiesce, M5OP_QUIESCE)
+TWO_BYTE_OP(m5_quiesce_ns, M5OP_QUIESCE_NS)
+TWO_BYTE_OP(m5_quiesce_cycle, M5OP_QUIESCE_CYCLE)
+TWO_BYTE_OP(m5_quiesce_time, M5OP_QUIESCE_TIME)
+TWO_BYTE_OP(m5_rpns, M5OP_RPNS)
TWO_BYTE_OP(m5_exit, M5OP_EXIT)
TWO_BYTE_OP(m5_fail, M5OP_FAIL)
-TWO_BYTE_OP(m5_initparam, M5OP_INIT_PARAM)
-TWO_BYTE_OP(m5_loadsymbol, M5OP_LOAD_SYMBOL)
+TWO_BYTE_OP(m5_init_param, M5OP_INIT_PARAM)
+TWO_BYTE_OP(m5_load_symbol, M5OP_LOAD_SYMBOL)
TWO_BYTE_OP(m5_reset_stats, M5OP_RESET_STATS)
TWO_BYTE_OP(m5_dump_stats, M5OP_DUMP_STATS)
-TWO_BYTE_OP(m5_dumpreset_stats, M5OP_DUMP_RESET_STATS)
+TWO_BYTE_OP(m5_dump_reset_stats, M5OP_DUMP_RESET_STATS)
TWO_BYTE_OP(m5_checkpoint, M5OP_CHECKPOINT)
-TWO_BYTE_OP(m5_readfile, M5OP_READ_FILE)
-TWO_BYTE_OP(m5_writefile, M5OP_WRITE_FILE)
-TWO_BYTE_OP(m5_debugbreak, M5OP_DEBUG_BREAK)
-TWO_BYTE_OP(m5_switchcpu, M5OP_SWITCH_CPU)
-TWO_BYTE_OP(m5_addsymbol, M5OP_ADD_SYMBOL)
+TWO_BYTE_OP(m5_read_file, M5OP_READ_FILE)
+TWO_BYTE_OP(m5_write_file, M5OP_WRITE_FILE)
+TWO_BYTE_OP(m5_debug_break, M5OP_DEBUG_BREAK)
+TWO_BYTE_OP(m5_switch_cpu, M5OP_SWITCH_CPU)
+TWO_BYTE_OP(m5_add_symbol, M5OP_ADD_SYMBOL)
TWO_BYTE_OP(m5_panic, M5OP_PANIC)
TWO_BYTE_OP(m5_work_begin, M5OP_WORK_BEGIN)
TWO_BYTE_OP(m5_work_end, M5OP_WORK_END)
-TWO_BYTE_OP(m5_togglesync, M5OP_DIST_TOGGLE_SYNC)
+TWO_BYTE_OP(m5_dist_toggle_sync, M5OP_DIST_TOGGLE_SYNC)