- allocator = '''new %(class_name)s(machInst, macrocodeBlock,
- %(flags)s, "%(message)s", %(cc)s)''' % {
- "class_name" : self.className,
- "flags" : self.microFlagsText(microFlags),
- "message" : self.message,
- "cc" : self.cond}
- return allocator
-
- exec_output = ""
- header_output = ""
- decoder_output = ""
-
- def buildDebugMicro(func, func_num):
- global exec_output, header_output, decoder_output
-
- iop = InstObjParams(func, "Micro%sFlags" % func.capitalize(),
- "MicroDebugBase",
- {"code": "",
- "func": func,
- "func_num": "GenericISA::M5DebugFault::%s" % func_num,
- "cond_test": "checkCondition(ccFlagBits | cfofBits | \
- dfBit | ecfBit | ezfBit, cc)"})
- exec_output += MicroDebugExecute.subst(iop)
- header_output += MicroDebugDeclare.subst(iop)
- decoder_output += MicroDebugConstructor.subst(iop)
-
- iop = InstObjParams(func, "Micro%s" % func.capitalize(),
- "MicroDebugBase",
- {"code": "",
- "func": func,
- "func_num": "GenericISA::M5DebugFault::%s" % func_num,
- "cond_test": "true"})
- exec_output += MicroDebugExecute.subst(iop)
- header_output += MicroDebugDeclare.subst(iop)
- decoder_output += MicroDebugConstructor.subst(iop)
+ if self.once:
+ fault_allocator_template = \
+ "new %(fault_type)s(%(token)s, %(message)s)"
+ else:
+ fault_allocator_template = \
+ "new %(fault_type)s(%(message)s)"
+ fault_allocator = fault_allocator_template % {
+ "fault_type": self.fault,
+ "token": "std::string(\"%s\")" % self.message,
+ "message": "\"%s\"" % self.message
+ }