summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-06-19 14:50:35 +0000
committerGabe Black <gblack@eecs.umich.edu>2007-06-19 14:50:35 +0000
commitebe4d05f70e2cac823bdbbc1e2060ab507e3e80f (patch)
tree773742d475efa1d2e71f5d313c8c69553c20a6c7 /src/arch
parent056cfc345bffd0fa5450ed5ef886415a596cf9f9 (diff)
downloadgem5-ebe4d05f70e2cac823bdbbc1e2060ab507e3e80f.tar.xz
Renovate the "fault" microop implementation.
--HG-- extra : convert_revision : dc9d67dd5413f00f16d37cb2d0f8b0d10971e14a
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/isa/microops/specop.isa64
1 files changed, 30 insertions, 34 deletions
diff --git a/src/arch/x86/isa/microops/specop.isa b/src/arch/x86/isa/microops/specop.isa
index 96fdf1c5e..b56223390 100644
--- a/src/arch/x86/isa/microops/specop.isa
+++ b/src/arch/x86/isa/microops/specop.isa
@@ -59,67 +59,63 @@
//
//////////////////////////////////////////////////////////////////////////
-def template MicroFaultExecute {{
- Fault %(class_name)s ::execute(%(CPU_exec_context)s *xc,
- Trace::InstRecord *traceData) const
- {
- //Return the fault we were constructed with
- return fault;
- }
-}};
-
-def template MicroFaultDeclare {{
- class %(class_name)s : public X86MicroopBase
+output header {{
+ class MicroFault : public X86MicroopBase
{
protected:
Fault fault;
void buildMe();
public:
- %(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
+ MicroFault(ExtMachInst _machInst, const char * instMnem,
bool isMicro, bool isDelayed, bool isFirst, bool isLast,
Fault _fault);
- %(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
+ MicroFault(ExtMachInst _machInst, const char * instMnem,
Fault _fault);
%(BasicExecDeclare)s
};
}};
-def template MicroFaultConstructor {{
-
- inline void %(class_name)s::buildMe()
- {
- %(constructor)s;
- }
+output decoder {{
+ Fault MicroFault::execute(%(CPU_exec_context)s *xc,
+ Trace::InstRecord *traceData) const
+ {
+ //Return the fault we were constructed with
+ return fault;
+ }
+}};
- inline %(class_name)s::%(class_name)s(
+output decoder {{
+ inline MicroFault::MicroFault(
ExtMachInst machInst, const char * instMnem, Fault _fault) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem,
- false, false, false, false, %(op_class)s), fault(_fault)
+ X86MicroopBase(machInst, "fault", instMnem,
+ false, false, false, false, No_OpClass), fault(_fault)
{
- buildMe();
}
- inline %(class_name)s::%(class_name)s(
+ inline MicroFault::MicroFault(
ExtMachInst machInst, const char * instMnem,
bool isMicro, bool isDelayed, bool isFirst, bool isLast,
Fault _fault) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem,
- isMicro, isDelayed, isFirst, isLast, %(op_class)s),
+ X86MicroopBase(machInst, "fault", instMnem,
+ isMicro, isDelayed, isFirst, isLast, No_OpClass),
fault(_fault)
{
- buildMe();
}
}};
let {{
- # This microop takes in a single parameter, a fault to return.
- iop = InstObjParams("fault", "GenFault", 'X86MicroopBase', {"code" : ""})
- header_output += MicroFaultDeclare.subst(iop)
- decoder_output += MicroFaultConstructor.subst(iop)
- exec_output += MicroFaultExecute.subst(iop)
+ class Fault(X86Microop):
+ def __init__(self, fault):
+ self.fault = fault
+
+ def getAllocator(self, *microFlags):
+ allocator = '''new MicroFault(machInst, mnemonic
+ %(flags)s, %(fault)s)''' % {
+ "flags" : self.microFlagsText(microFlags),
+ "fault" : self.fault}
+ return allocator
+ microopClasses["fault"] = Fault
}};