From 4a2c50bc8ff2dfda53d26c6f347ae5b2839daeb3 Mon Sep 17 00:00:00 2001 From: Kevin Lim Date: Wed, 23 Aug 2006 16:57:07 -0400 Subject: Support loading in a symbol file. arch/alpha/freebsd/system.cc: arch/alpha/isa/decoder.isa: arch/alpha/linux/system.cc: arch/alpha/system.cc: arch/alpha/tru64/system.cc: Let symbol files be read in so that profiling can happen on the binaries as well. python/m5/objects/System.py: Add in symbol files. sim/pseudo_inst.cc: Load in a specified symbol file. sim/pseudo_inst.hh: Allow for symbols to be loaded. sim/system.hh: Support symbol file. util/m5/m5.c: util/m5/m5op.S: Add support to m5 util for loading symbols (and readfile). --HG-- extra : convert_revision : f10c1049bcd7b22b98c73052c0666b964aff222b --- util/m5/m5.c | 22 ++++++++++++++++++++++ util/m5/m5op.S | 8 ++++++++ 2 files changed, 30 insertions(+) (limited to 'util') diff --git a/util/m5/m5.c b/util/m5/m5.c index 6fdbc0500..fa9be96e8 100644 --- a/util/m5/m5.c +++ b/util/m5/m5.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "m5op.h" @@ -165,6 +166,22 @@ main(int argc, char *argv[]) } } + if (COMPARE("readfile")) { + char buf[256*1024]; + int offset = 0; + int len; + + if (argc != 2) + usage(); + + while ((len = m5_readfile(buf, sizeof(buf), offset)) > 0) { + write(STDOUT_FILENO, buf, len); + offset += len; + } + + return 0; + } + if (COMPARE("checkpoint")) { switch (argc) { case 4: @@ -182,5 +199,10 @@ main(int argc, char *argv[]) return 0; } + if (COMPARE("loadsymbol")) { + m5_loadsymbol(arg1); + return 0; + } + usage(); } diff --git a/util/m5/m5op.S b/util/m5/m5op.S index a53c45277..97eb9238d 100644 --- a/util/m5/m5op.S +++ b/util/m5/m5op.S @@ -38,6 +38,7 @@ #define exit_old_func 0x20 // deprectated! #define exit_func 0x21 #define initparam_func 0x30 +#define loadsymbol_func 0x31 #define resetstats_func 0x40 #define dumpstats_func 0x41 #define dumprststats_func 0x42 @@ -72,6 +73,7 @@ func: #define IVLE(reg) INST(m5_op, reg, 0, ivle_func) #define M5EXIT(reg) INST(m5_op, reg, 0, exit_func) #define INITPARAM(reg) INST(m5_op, reg, 0, initparam_func) +#define LOADSYMBOL(reg) INST(m5_op, reg, 0, loadsymbol_func) #define RESET_STATS(r1, r2) INST(m5_op, r1, r2, resetstats_func) #define DUMP_STATS(r1, r2) INST(m5_op, r1, r2, dumpstats_func) #define DUMPRST_STATS(r1, r2) INST(m5_op, r1, r2, dumprststats_func) @@ -139,6 +141,12 @@ LEAF(m5_initparam) RET END(m5_initparam) + .align 4 +LEAF(m5_loadsymbol) + LOADSYMBOL(0) + RET +END(m5_loadsymbol) + .align 4 LEAF(m5_reset_stats) RESET_STATS(16, 17) -- cgit v1.2.3