Make Alpha pseudo-insts available from SE mode.

This commit is contained in:
Steve Reinhardt 2008-12-17 09:51:18 -08:00
parent 02cd18f536
commit 1704ba2273
6 changed files with 57 additions and 29 deletions

View file

@ -783,14 +783,19 @@ decode OPCODE default Unknown::unknown() {
} }
} }
format BasicOperate {
0x1e: decode PALMODE { 0x1e: decode PALMODE {
0: OpcdecFault::hw_rei(); 0: OpcdecFault::hw_rei();
format BasicOperate {
1: hw_rei({{ xc->hwrei(); }}, IsSerializing, IsSerializeBefore); 1: hw_rei({{ xc->hwrei(); }}, IsSerializing, IsSerializeBefore);
} }
}
#endif
format BasicOperate {
// M5 special opcodes use the reserved 0x01 opcode space // M5 special opcodes use the reserved 0x01 opcode space
0x01: decode M5FUNC { 0x01: decode M5FUNC {
#if FULL_SYSTEM
0x00: arm({{ 0x00: arm({{
PseudoInst::arm(xc->tcBase()); PseudoInst::arm(xc->tcBase());
}}, IsNonSpeculative); }}, IsNonSpeculative);
@ -806,6 +811,7 @@ decode OPCODE default Unknown::unknown() {
0x04: quiesceTime({{ 0x04: quiesceTime({{
R0 = PseudoInst::quiesceTime(xc->tcBase()); R0 = PseudoInst::quiesceTime(xc->tcBase());
}}, IsNonSpeculative, IsUnverifiable); }}, IsNonSpeculative, IsUnverifiable);
#endif
0x07: rpns({{ 0x07: rpns({{
R0 = PseudoInst::rpns(xc->tcBase()); R0 = PseudoInst::rpns(xc->tcBase());
}}, IsNonSpeculative, IsUnverifiable); }}, IsNonSpeculative, IsUnverifiable);
@ -822,12 +828,14 @@ decode OPCODE default Unknown::unknown() {
0x21: m5exit({{ 0x21: m5exit({{
PseudoInst::m5exit(xc->tcBase(), R16); PseudoInst::m5exit(xc->tcBase(), R16);
}}, No_OpClass, IsNonSpeculative); }}, No_OpClass, IsNonSpeculative);
#if FULL_SYSTEM
0x31: loadsymbol({{ 0x31: loadsymbol({{
PseudoInst::loadsymbol(xc->tcBase()); PseudoInst::loadsymbol(xc->tcBase());
}}, No_OpClass, IsNonSpeculative); }}, No_OpClass, IsNonSpeculative);
0x30: initparam({{ 0x30: initparam({{
Ra = xc->tcBase()->getCpuPtr()->system->init_param; Ra = xc->tcBase()->getCpuPtr()->system->init_param;
}}); }});
#endif
0x40: resetstats({{ 0x40: resetstats({{
PseudoInst::resetstats(xc->tcBase(), R16, R17); PseudoInst::resetstats(xc->tcBase(), R16, R17);
}}, IsNonSpeculative); }}, IsNonSpeculative);
@ -840,18 +848,22 @@ decode OPCODE default Unknown::unknown() {
0x43: m5checkpoint({{ 0x43: m5checkpoint({{
PseudoInst::m5checkpoint(xc->tcBase(), R16, R17); PseudoInst::m5checkpoint(xc->tcBase(), R16, R17);
}}, IsNonSpeculative); }}, IsNonSpeculative);
#if FULL_SYSTEM
0x50: m5readfile({{ 0x50: m5readfile({{
R0 = PseudoInst::readfile(xc->tcBase(), R16, R17, R18); R0 = PseudoInst::readfile(xc->tcBase(), R16, R17, R18);
}}, IsNonSpeculative); }}, IsNonSpeculative);
#endif
0x51: m5break({{ 0x51: m5break({{
PseudoInst::debugbreak(xc->tcBase()); PseudoInst::debugbreak(xc->tcBase());
}}, IsNonSpeculative); }}, IsNonSpeculative);
0x52: m5switchcpu({{ 0x52: m5switchcpu({{
PseudoInst::switchcpu(xc->tcBase()); PseudoInst::switchcpu(xc->tcBase());
}}, IsNonSpeculative); }}, IsNonSpeculative);
#if FULL_SYSTEM
0x53: m5addsymbol({{ 0x53: m5addsymbol({{
PseudoInst::addsymbol(xc->tcBase(), R16, R17); PseudoInst::addsymbol(xc->tcBase(), R16, R17);
}}, IsNonSpeculative); }}, IsNonSpeculative);
#endif
0x54: m5panic({{ 0x54: m5panic({{
panic("M5 panic instruction called at pc=%#x.", xc->readPC()); panic("M5 panic instruction called at pc=%#x.", xc->readPC());
}}, IsNonSpeculative); }}, IsNonSpeculative);
@ -872,5 +884,4 @@ decode OPCODE default Unknown::unknown() {
}}, IsNonSpeculative); }}, IsNonSpeculative);
} }
} }
#endif
} }

View file

@ -68,9 +68,7 @@ using namespace AlphaISA;
output exec {{ output exec {{
#include <math.h> #include <math.h>
#if FULL_SYSTEM
#include "sim/pseudo_inst.hh" #include "sim/pseudo_inst.hh"
#endif
#include "arch/alpha/ipr.hh" #include "arch/alpha/ipr.hh"
#include "base/fenv.hh" #include "base/fenv.hh"
#include "config/ss_compatible_fp.hh" #include "config/ss_compatible_fp.hh"

View file

@ -71,13 +71,14 @@ class BaseCPU(MemObject):
checker = Param.BaseCPU("checker CPU") checker = Param.BaseCPU("checker CPU")
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, do_checkpoint_insts = Param.Bool(True,
"enable checkpoint pseudo instructions") "enable checkpoint pseudo instructions")
do_statistics_insts = Param.Bool(True, do_statistics_insts = Param.Bool(True,
"enable statistics pseudo instructions") "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")
else: else:
workload = VectorParam.Process("processes to run") workload = VectorParam.Process("processes to run")

View file

@ -43,6 +43,7 @@ Source('eventq.cc')
Source('faults.cc') Source('faults.cc')
Source('init.cc') Source('init.cc')
BinSource('main.cc') BinSource('main.cc')
Source('pseudo_inst.cc')
Source('root.cc') Source('root.cc')
Source('serialize.cc') Source('serialize.cc')
Source('sim_events.cc') Source('sim_events.cc')
@ -54,7 +55,6 @@ Source('system.cc')
if env['FULL_SYSTEM']: if env['FULL_SYSTEM']:
Source('arguments.cc') Source('arguments.cc')
Source('pseudo_inst.cc')
else: else:
Source('tlb.cc') Source('tlb.cc')
SimObject('Process.py') SimObject('Process.py')

View file

@ -50,7 +50,9 @@
#include "sim/stats.hh" #include "sim/stats.hh"
#include "sim/system.hh" #include "sim/system.hh"
#include "sim/debug.hh" #include "sim/debug.hh"
#if FULL_SYSTEM
#include "sim/vptr.hh" #include "sim/vptr.hh"
#endif
using namespace std; using namespace std;
@ -59,6 +61,8 @@ using namespace TheISA;
namespace PseudoInst { namespace PseudoInst {
#if FULL_SYSTEM
void void
arm(ThreadContext *tc) arm(ThreadContext *tc)
{ {
@ -125,6 +129,8 @@ quiesceTime(ThreadContext *tc)
return (tc->readLastActivate() - tc->readLastSuspend()) / Clock::Int::ns; return (tc->readLastActivate() - tc->readLastSuspend()) / Clock::Int::ns;
} }
#endif
uint64_t uint64_t
rpns(ThreadContext *tc) rpns(ThreadContext *tc)
{ {
@ -139,6 +145,8 @@ m5exit(ThreadContext *tc, Tick delay)
mainEventQueue.schedule(event, when); mainEventQueue.schedule(event, when);
} }
#if FULL_SYSTEM
void void
loadsymbol(ThreadContext *tc) loadsymbol(ThreadContext *tc)
{ {
@ -187,6 +195,21 @@ loadsymbol(ThreadContext *tc)
file.close(); file.close();
} }
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 void
resetstats(ThreadContext *tc, Tick delay, Tick period) resetstats(ThreadContext *tc, Tick delay, Tick period)
{ {
@ -213,18 +236,6 @@ dumpstats(ThreadContext *tc, Tick delay, Tick period)
Stats::StatEvent(true, false, when, repeat); 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 void
dumpresetstats(ThreadContext *tc, Tick delay, Tick period) dumpresetstats(ThreadContext *tc, Tick delay, Tick period)
{ {
@ -251,6 +262,8 @@ m5checkpoint(ThreadContext *tc, Tick delay, Tick period)
mainEventQueue.schedule(event, when); mainEventQueue.schedule(event, when);
} }
#if FULL_SYSTEM
uint64_t uint64_t
readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset) readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
{ {
@ -286,6 +299,8 @@ readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
return result; return result;
} }
#endif
void void
debugbreak(ThreadContext *tc) debugbreak(ThreadContext *tc)
{ {

View file

@ -42,22 +42,25 @@ extern bool doStatisticsInsts;
extern bool doCheckpointInsts; extern bool doCheckpointInsts;
extern bool doQuiesce; extern bool doQuiesce;
#if FULL_SYSTEM
void arm(ThreadContext *tc); void arm(ThreadContext *tc);
void quiesce(ThreadContext *tc); void quiesce(ThreadContext *tc);
void quiesceNs(ThreadContext *tc, uint64_t ns); void quiesceNs(ThreadContext *tc, uint64_t ns);
void quiesceCycles(ThreadContext *tc, uint64_t cycles); void quiesceCycles(ThreadContext *tc, uint64_t cycles);
uint64_t quiesceTime(ThreadContext *tc); 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); uint64_t rpns(ThreadContext *tc);
void m5exit(ThreadContext *tc, Tick delay); void m5exit(ThreadContext *tc, Tick delay);
void loadsymbol(ThreadContext *xc);
void resetstats(ThreadContext *tc, Tick delay, Tick period); void resetstats(ThreadContext *tc, Tick delay, Tick period);
void dumpstats(ThreadContext *tc, Tick delay, Tick period); void dumpstats(ThreadContext *tc, Tick delay, Tick period);
void dumpresetstats(ThreadContext *tc, Tick delay, Tick period); void dumpresetstats(ThreadContext *tc, Tick delay, Tick period);
void m5checkpoint(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 debugbreak(ThreadContext *tc);
void switchcpu(ThreadContext *tc); void switchcpu(ThreadContext *tc);
void addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr);
/* namespace PsuedoInst */ } /* namespace PseudoInst */ }