Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/5465
Change subject: sparc: Return debug faults from unimplemented instructions.
......................................................................
sparc: Return debug faults from unimplemented instructions.
These had been marked as non-speculative so that their execute
functions would only be called if the instruction should really be
executed. Instead, we can return faults which will cause the same
behavior when the instruction is committed and let the instruction
execute as normal.
Change-Id: I39fa5073e93399424144724b99bdc12070e42286
---
M src/arch/sparc/insts/unimp.hh
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/src/arch/sparc/insts/unimp.hh b/src/arch/sparc/insts/unimp.hh
index c0d9785..a63443a 100644
--- a/src/arch/sparc/insts/unimp.hh
+++ b/src/arch/sparc/insts/unimp.hh
@@ -31,6 +31,9 @@
#ifndef __ARCH_SPARC_INSTS_UNIMP_HH__
#define __ARCH_SPARC_INSTS_UNIMP_HH__
+#include <memory>
+
+#include "arch/generic/debugfaults.hh"
#include "arch/sparc/insts/static_inst.hh"
#include "base/cprintf.hh"
@@ -55,17 +58,14 @@
/// Constructor
FailUnimplemented(const char *_mnemonic, ExtMachInst _machInst) :
SparcStaticInst(_mnemonic, _machInst, No_OpClass)
- {
- // don't call execute() (which panics) if we're on a
- // speculative path
- flags[IsNonSpeculative] = true;
- }
+ {}
Fault
execute(ExecContext *xc, Trace::InstRecord *traceData) const override
{
- panic("attempt to execute unimplemented instruction '%s' "
- "(inst 0x%08x)", mnemonic, machInst);
+ return std::make_shared<GenericISA::M5PanicFault>(
+ "attempt to execute unimplemented instruction '%s'
(inst %#08x)",
+ mnemonic, machInst);
}
std::string
@@ -94,17 +94,14 @@
/// Constructor
WarnUnimplemented(const char *_mnemonic, ExtMachInst _machInst) :
SparcStaticInst(_mnemonic, _machInst, No_OpClass),
warned(false)
- {
- // don't call execute() (which panics) if we're on a
- // speculative path
- flags[IsNonSpeculative] = true;
- }
+ {}
Fault
execute(ExecContext *xc, Trace::InstRecord *traceData) const override
{
if (!warned) {
- warn("instruction '%s' unimplemented\n", mnemonic);
+ return std::make_shared<GenericISA::M5WarnFault>(
+ "instruction '%s' unimplemented\n", mnemonic);
warned = true;
}
return NoFault;
--
To view, visit https://gem5-review.googlesource.com/5465
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I39fa5073e93399424144724b99bdc12070e42286
Gerrit-Change-Number: 5465
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev