changeset 50c9d48de3ca in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=50c9d48de3ca
description:
Make Alpha pseudo-insts available from SE mode.
diffstat:
5 files changed, 18 insertions(+), 1 deletion(-)
src/arch/alpha/isa/decoder.isa | 7 +++++++
src/arch/alpha/isa/main.isa | 1 -
src/cpu/BaseCPU.py | 5 +++++
src/sim/pseudo_inst.cc | 1 +
src/sim/pseudo_inst.hh | 5 +++++
diffs (267 lines):
diff -r c0d731772342 -r 50c9d48de3ca src/arch/alpha/isa/decoder.isa
--- a/src/arch/alpha/isa/decoder.isa Tue Dec 16 23:06:37 2008 -0800
+++ b/src/arch/alpha/isa/decoder.isa Wed Dec 17 09:51:18 2008 -0800
@@ -783,14 +783,19 @@
}
}
+ 0x1e: decode PALMODE {
+ 0: OpcdecFault::hw_rei();
+ format BasicOperate {
+ 1: hw_rei({{ xc->hwrei(); }}, IsSerializing, IsSerializeBefore);
+ }
+ }
+
+#endif
+
format BasicOperate {
- 0x1e: decode PALMODE {
- 0: OpcdecFault::hw_rei();
- 1:hw_rei({{ xc->hwrei(); }}, IsSerializing, IsSerializeBefore);
- }
-
// M5 special opcodes use the reserved 0x01 opcode space
0x01: decode M5FUNC {
+#if FULL_SYSTEM
0x00: arm({{
PseudoInst::arm(xc->tcBase());
}}, IsNonSpeculative);
@@ -806,6 +811,7 @@
0x04: quiesceTime({{
R0 = PseudoInst::quiesceTime(xc->tcBase());
}}, IsNonSpeculative, IsUnverifiable);
+#endif
0x07: rpns({{
R0 = PseudoInst::rpns(xc->tcBase());
}}, IsNonSpeculative, IsUnverifiable);
@@ -822,12 +828,14 @@
0x21: m5exit({{
PseudoInst::m5exit(xc->tcBase(), R16);
}}, No_OpClass, IsNonSpeculative);
+#if FULL_SYSTEM
0x31: loadsymbol({{
PseudoInst::loadsymbol(xc->tcBase());
}}, No_OpClass, IsNonSpeculative);
0x30: initparam({{
Ra = xc->tcBase()->getCpuPtr()->system->init_param;
}});
+#endif
0x40: resetstats({{
PseudoInst::resetstats(xc->tcBase(), R16, R17);
}}, IsNonSpeculative);
@@ -840,18 +848,22 @@
0x43: m5checkpoint({{
PseudoInst::m5checkpoint(xc->tcBase(), R16, R17);
}}, IsNonSpeculative);
+#if FULL_SYSTEM
0x50: m5readfile({{
R0 = PseudoInst::readfile(xc->tcBase(), R16, R17, R18);
}}, IsNonSpeculative);
+#endif
0x51: m5break({{
PseudoInst::debugbreak(xc->tcBase());
}}, IsNonSpeculative);
0x52: m5switchcpu({{
PseudoInst::switchcpu(xc->tcBase());
}}, IsNonSpeculative);
+#if FULL_SYSTEM
0x53: m5addsymbol({{
PseudoInst::addsymbol(xc->tcBase(), R16, R17);
}}, IsNonSpeculative);
+#endif
0x54: m5panic({{
panic("M5 panic instruction called at pc=%#x.", xc->readPC());
}}, IsNonSpeculative);
@@ -872,5 +884,4 @@
}}, IsNonSpeculative);
}
}
-#endif
}
diff -r c0d731772342 -r 50c9d48de3ca src/arch/alpha/isa/main.isa
--- a/src/arch/alpha/isa/main.isa Tue Dec 16 23:06:37 2008 -0800
+++ b/src/arch/alpha/isa/main.isa Wed Dec 17 09:51:18 2008 -0800
@@ -68,9 +68,7 @@
output exec {{
#include <math.h>
-#if FULL_SYSTEM
#include "sim/pseudo_inst.hh"
-#endif
#include "arch/alpha/ipr.hh"
#include "base/fenv.hh"
#include "config/ss_compatible_fp.hh"
diff -r c0d731772342 -r 50c9d48de3ca src/cpu/BaseCPU.py
--- a/src/cpu/BaseCPU.py Tue Dec 16 23:06:37 2008 -0800
+++ b/src/cpu/BaseCPU.py Wed Dec 17 09:51:18 2008 -0800
@@ -71,13 +71,14 @@
checker = Param.BaseCPU("checker CPU")
+ do_checkpoint_insts = Param.Bool(True,
+ "enable checkpoint pseudo instructions")
+ do_statistics_insts = Param.Bool(True,
+ "enable statistics pseudo instructions")
+
if build_env['FULL_SYSTEM']:
profile = Param.Latency('0ns', "trace the kernel stack")
do_quiesce = Param.Bool(True, "enable quiesce instructions")
- do_checkpoint_insts = Param.Bool(True,
- "enable checkpoint pseudo instructions")
- do_statistics_insts = Param.Bool(True,
- "enable statistics pseudo instructions")
else:
workload = VectorParam.Process("processes to run")
diff -r c0d731772342 -r 50c9d48de3ca src/sim/SConscript
--- a/src/sim/SConscript Tue Dec 16 23:06:37 2008 -0800
+++ b/src/sim/SConscript Wed Dec 17 09:51:18 2008 -0800
@@ -43,6 +43,7 @@
Source('faults.cc')
Source('init.cc')
BinSource('main.cc')
+Source('pseudo_inst.cc')
Source('root.cc')
Source('serialize.cc')
Source('sim_events.cc')
@@ -54,7 +55,6 @@
if env['FULL_SYSTEM']:
Source('arguments.cc')
- Source('pseudo_inst.cc')
else:
Source('tlb.cc')
SimObject('Process.py')
diff -r c0d731772342 -r 50c9d48de3ca src/sim/pseudo_inst.cc
--- a/src/sim/pseudo_inst.cc Tue Dec 16 23:06:37 2008 -0800
+++ b/src/sim/pseudo_inst.cc Wed Dec 17 09:51:18 2008 -0800
@@ -50,7 +50,9 @@
#include "sim/stats.hh"
#include "sim/system.hh"
#include "sim/debug.hh"
+#if FULL_SYSTEM
#include "sim/vptr.hh"
+#endif
using namespace std;
@@ -58,6 +60,8 @@
using namespace TheISA;
namespace PseudoInst {
+
+#if FULL_SYSTEM
void
arm(ThreadContext *tc)
@@ -125,6 +129,8 @@
return (tc->readLastActivate() - tc->readLastSuspend()) / Clock::Int::ns;
}
+#endif
+
uint64_t
rpns(ThreadContext *tc)
{
@@ -138,6 +144,8 @@
Event *event = new SimLoopExitEvent("m5_exit instruction encountered", 0);
mainEventQueue.schedule(event, when);
}
+
+#if FULL_SYSTEM
void
loadsymbol(ThreadContext *tc)
@@ -188,6 +196,21 @@
}
void
+addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr)
+{
+ char symb[100];
+ CopyStringOut(tc, symb, symbolAddr, 100);
+ std::string symbol(symb);
+
+ DPRINTF(Loader, "Loaded symbol: %s @ %#llx\n", symbol, addr);
+
+ tc->getSystemPtr()->kernelSymtab->insert(addr,symbol);
+}
+
+#endif
+
+
+void
resetstats(ThreadContext *tc, Tick delay, Tick period)
{
if (!tc->getCpuPtr()->params()->do_statistics_insts)
@@ -211,18 +234,6 @@
Tick repeat = period * Clock::Int::ns;
Stats::StatEvent(true, false, when, repeat);
-}
-
-void
-addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr)
-{
- char symb[100];
- CopyStringOut(tc, symb, symbolAddr, 100);
- std::string symbol(symb);
-
- DPRINTF(Loader, "Loaded symbol: %s @ %#llx\n", symbol, addr);
-
- tc->getSystemPtr()->kernelSymtab->insert(addr,symbol);
}
void
@@ -250,6 +261,8 @@
Event *event = new SimLoopExitEvent("checkpoint", 0, repeat);
mainEventQueue.schedule(event, when);
}
+
+#if FULL_SYSTEM
uint64_t
readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
@@ -286,6 +299,8 @@
return result;
}
+#endif
+
void
debugbreak(ThreadContext *tc)
{
diff -r c0d731772342 -r 50c9d48de3ca src/sim/pseudo_inst.hh
--- a/src/sim/pseudo_inst.hh Tue Dec 16 23:06:37 2008 -0800
+++ b/src/sim/pseudo_inst.hh Wed Dec 17 09:51:18 2008 -0800
@@ -42,22 +42,25 @@
extern bool doCheckpointInsts;
extern bool doQuiesce;
+#if FULL_SYSTEM
void arm(ThreadContext *tc);
void quiesce(ThreadContext *tc);
void quiesceNs(ThreadContext *tc, uint64_t ns);
void quiesceCycles(ThreadContext *tc, uint64_t cycles);
uint64_t quiesceTime(ThreadContext *tc);
+uint64_t readfile(ThreadContext *tc, Addr vaddr, uint64_t len,
+ uint64_t offset);
+void loadsymbol(ThreadContext *xc);
+void addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr);
+#endif
+
uint64_t rpns(ThreadContext *tc);
void m5exit(ThreadContext *tc, Tick delay);
-void loadsymbol(ThreadContext *xc);
void resetstats(ThreadContext *tc, Tick delay, Tick period);
void dumpstats(ThreadContext *tc, Tick delay, Tick period);
void dumpresetstats(ThreadContext *tc, Tick delay, Tick period);
void m5checkpoint(ThreadContext *tc, Tick delay, Tick period);
-uint64_t readfile(ThreadContext *tc, Addr vaddr, uint64_t len,
- uint64_t offset);
void debugbreak(ThreadContext *tc);
void switchcpu(ThreadContext *tc);
-void addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr);
-/* namespace PsuedoInst */ }
+/* namespace PseudoInst */ }
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev