Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/18433
Change subject: alpha: Implement simPalCheck within the ISA description.
......................................................................
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
---
M src/arch/alpha/isa/decoder.isa
M src/arch/alpha/isa/main.isa
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/src/arch/alpha/isa/decoder.isa b/src/arch/alpha/isa/decoder.isa
index 5635d38..8732d70 100644
--- a/src/arch/alpha/isa/decoder.isa
+++ b/src/arch/alpha/isa/decoder.isa
@@ -858,7 +858,30 @@
} 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 f77b1f9..3f7e1a3 100644
--- a/src/arch/alpha/isa/main.isa
+++ b/src/arch/alpha/isa/main.isa
@@ -77,6 +77,7 @@
#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"
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/18433
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ib746fad7bb13c5cc9c6ee555c3a46ce686771c12
Gerrit-Change-Number: 18433
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev