deprecate the m5exit instruction and rename it to m5exit_old

Implement a new m5exit instruction with an optional delay

arch/alpha/isa_desc:
    move m5exit to m5exit old.  The old version of the
    instruction is now deprecated

    Implement the new exit instruction with the optional delay
sim/sim_events.cc:
sim/sim_events.hh:
    Make SimExit take a cycle
sim/universe.cc:
    provide ticksPerMS, ticksPerUS, and ticksPerNS so we don't
    have to do math during the cycle

--HG--
extra : convert_revision : e2ed47a2e5cfcd57c82086c6fcb4a28bf801c214
This commit is contained in:
Nathan Binkert 2003-11-02 02:07:31 -05:00
parent 7c6fa585ca
commit c7d6745b07
4 changed files with 24 additions and 6 deletions

View file

@ -2425,9 +2425,21 @@ decode OPCODE default Unknown::unknown() {
if (!xc->misspeculating())
Annotate::EndInterval(xc);
}}, No_OpClass);
0x20: m5exit({{
0x20: m5exit_old({{
if (!xc->misspeculating())
SimExit("m5_exit instruction encountered");
SimExit(curTick, "m5_exit_old instruction encountered");
}}, No_OpClass);
0x21: m5exit({{
if (!xc->misspeculating()) {
Tick when = curTick;
Tick delay = xc->regs.intRegFile[16];
if (delay != 0) {
delay *= ticksPerUS;
delay /= 1000;
when += delay;
}
SimExit(when, "m5_exit instruction encountered");
}
}}, No_OpClass);
0x30: initparam({{ Ra = xc->cpu->system->init_param; }});
0x40: resetstats({{

View file

@ -64,9 +64,9 @@ SimExitEvent::description()
}
void
SimExit(const char *message)
SimExit(Tick when, const char *message)
{
static SimExitEvent event(message);
static SimExitEvent event(when, message);
}
//

View file

@ -66,7 +66,7 @@ class SimExitEvent : public Event
virtual const char *description();
};
void SimExit(const char *message);
void SimExit(Tick when, const char *message);
//
// Event class to terminate simulation after 'n' related events have

View file

@ -38,6 +38,9 @@ using namespace std;
Tick curTick = 0;
Tick ticksPerSecond;
Tick ticksPerMS;
Tick ticksPerUS;
Tick ticksPerNS;
class UniverseParamContext : public ParamContext
{
@ -49,10 +52,13 @@ class UniverseParamContext : public ParamContext
UniverseParamContext universe("Universe");
Param<Tick> universe_freq(&universe, "frequency", "tick frequency",
200000000);
200000000);
void
UniverseParamContext::checkParams()
{
ticksPerSecond = universe_freq;
ticksPerMS = universe_freq / 1000;
ticksPerUS = universe_freq / (1000 * 1000);
ticksPerNS = universe_freq / (1000 * 1000 * 1000);
}