62,72c62,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
79,80c70
< %(class_name)s(ExtMachInst _machInst,
< const char * instMnem,
---
> MicroFault(ExtMachInst _machInst, const char * instMnem,
84,85c74
< %(class_name)s(ExtMachInst _machInst,
< const char * instMnem,
---
> MicroFault(ExtMachInst _machInst, const char * instMnem,
92c81,88
< def template MicroFaultConstructor {{
---
> output decoder {{
> Fault MicroFault::execute(%(CPU_exec_context)s *xc,
> Trace::InstRecord *traceData) const
> {
> //Return the fault we were constructed with
> return fault;
> }
> }};
94,99c90,91
< inline void %(class_name)s::buildMe()
< {
< %(constructor)s;
< }
<
< inline %(class_name)s::%(class_name)s(
---
> output decoder {{
> inline MicroFault::MicroFault(
101,102c93,94
< %(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)
104d95
< buildMe();
107c98
< inline %(class_name)s::%(class_name)s(
---
> inline MicroFault::MicroFault(
111,112c102,103
< %(base_class)s(machInst, "%(mnemonic)s", instMnem,
< isMicro, isDelayed, isFirst, isLast, %(op_class)s),
---
> X86MicroopBase(machInst, "fault", instMnem,
> isMicro, isDelayed, isFirst, isLast, No_OpClass),
115d105
< buildMe();
120,124c110,120
< # 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