diff options
author | Gabe Black <gabeblack@google.com> | 2019-04-27 21:00:41 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2019-04-30 07:37:51 +0000 |
commit | e9e3fdc02233adbef6ad9831cee05531f4145dac (patch) | |
tree | 00679273cf25c5bb10511e7128f2f8b733028acf /src/arch/alpha | |
parent | 40cc7cdd53540ded69f055262b087dca54f5b715 (diff) | |
download | gem5-e9e3fdc02233adbef6ad9831cee05531f4145dac.tar.xz |
alpha: Implement simPalCheck within the ISA description.
This doesn't need to be plumbed through generic interfaces. If the
function/instruction got more complex in the future (unlikely since
Alpha doesn't really see development these days), it could be moved to
a helper function defined within Alpha files.
Change-Id: Ib746fad7bb13c5cc9c6ee555c3a46ce686771c12
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18433
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/arch/alpha')
-rw-r--r-- | src/arch/alpha/isa/decoder.isa | 25 | ||||
-rw-r--r-- | src/arch/alpha/isa/main.isa | 1 |
2 files changed, 25 insertions, 1 deletions
diff --git a/src/arch/alpha/isa/decoder.isa b/src/arch/alpha/isa/decoder.isa index 5635d381a..8732d70ba 100644 --- a/src/arch/alpha/isa/decoder.isa +++ b/src/arch/alpha/isa/decoder.isa @@ -858,7 +858,30 @@ decode OPCODE default Unknown::unknown() { } else { // check to see if simulator wants to do something special // on this PAL call (including maybe suppress it) - bool dopal = xc->simPalCheck(palFunc); + bool dopal = true; + ThreadContext *tc = xc->tcBase(); + auto *base_stats = tc->getKernelStats(); + auto *stats = dynamic_cast<AlphaISA::Kernel::Statistics *>( + base_stats); + assert(stats || !base_stats); + if (stats) + stats->callpal(palFunc, tc); + + System *sys = tc->getSystemPtr(); + + switch (palFunc) { + case PAL::halt: + xc->tcBase()->halt(); + if (--System::numSystemsRunning == 0) + exitSimLoop("all cpus halted"); + break; + + case PAL::bpt: + case PAL::bugchk: + if (sys->breakpoint()) + dopal = false; + break; + } if (dopal) { xc->setMiscReg(IPR_EXC_ADDR, NPC); diff --git a/src/arch/alpha/isa/main.isa b/src/arch/alpha/isa/main.isa index f77b1f9c9..3f7e1a39a 100644 --- a/src/arch/alpha/isa/main.isa +++ b/src/arch/alpha/isa/main.isa @@ -77,6 +77,7 @@ output exec {{ #include "arch/alpha/decoder.hh" #include "arch/alpha/kernel_stats.hh" +#include "arch/alpha/osfpal.hh" #include "arch/alpha/registers.hh" #include "arch/alpha/regredir.hh" #include "arch/generic/memhelpers.hh" |