168a169,170
> %(InitiateAccDeclare)s
> %(CompleteAccDeclare)s
176a179,180
> %(InitiateAccDeclare)s
> %(CompleteAccDeclare)s
184a189,190
> %(InitiateAccDeclare)s
> %(CompleteAccDeclare)s
192a199,200
> %(InitiateAccDeclare)s
> %(CompleteAccDeclare)s
200a209,210
> %(InitiateAccDeclare)s
> %(CompleteAccDeclare)s
208a219,220
> %(InitiateAccDeclare)s
> %(CompleteAccDeclare)s
216a229,230
> %(InitiateAccDeclare)s
> %(CompleteAccDeclare)s
224a239,240
> %(InitiateAccDeclare)s
> %(CompleteAccDeclare)s
258,306d273
< def template MicroLoadExecute {{
< Fault %(class_name)s::%(class_name)s_%(micro_pc)s::execute(
< %(CPU_exec_context)s *xc, Trace::InstRecord *traceData) const
< {
< Fault fault = NoFault;
< Addr EA;
< %(op_decl)s;
< %(op_rd)s;
< %(ea_code)s;
< %(fault_check)s;
< DPRINTF(Sparc, "The address is 0x%x\n", EA);
< xc->read(EA, (uint%(mem_acc_size)s_t&)Mem, 0);
< %(code)s;
<
< if(fault == NoFault)
< {
< //Write the resulting state to the execution context
< %(op_wb)s;
< }
<
< return fault;
< }
< }};
<
< def template MicroStoreExecute {{
< Fault %(class_name)s::%(class_name)s_%(micro_pc)s::execute(
< %(CPU_exec_context)s *xc, Trace::InstRecord *traceData) const
< {
< Fault fault = NoFault;
< uint64_t write_result = 0;
< Addr EA;
< %(op_decl)s;
< %(op_rd)s;
< %(ea_code)s;
< %(fault_check)s;
< DPRINTF(Sparc, "The address is 0x%x\n", EA);
< %(code)s;
<
< if(fault == NoFault)
< {
< xc->write((uint%(mem_acc_size)s_t)Mem, EA, 0, &write_result);
< //Write the resulting state to the execution context
< %(op_wb)s;
< }
<
< return fault;
< }
< }};
<
309c276
< def doBlockMemFormat(code, execute, name, Name, opt_flags):
---
> def doBlockMemFormat(code, faultCode, execute, name, Name, opt_flags):
313,323d279
< faultCheck = '''if(bits(Pstate,2,2) == 0 && (EXT_ASI & 0x80) == 0)
< return new PrivilegedAction;
< if(AsiIsAsIfUser((ASI)EXT_ASI) && !bits(Pstate,2,2))
< return new PrivilegedAction;
< //The LSB can be zero, since it's really the MSB in doubles
< //and quads
< if(RD & 0xe)
< return new IllegalInstruction;
< if(EA & 0x3f)
< return new MemAddressNotAligned;
< '''
333c289
< for microPC in range(8):
---
> for microPc in range(8):
335c291
< if (microPC == 7):
---
> if (microPc == 7):
337c293
< pcedCode = matcher.sub("Frd_%d" % microPC, code)
---
> pcedCode = matcher.sub("Frd_%d" % microPc, code)
340c296
< "fault_check": faultCheck, "micro_pc": microPC,
---
> "fault_check": faultCode, "micro_pc": microPc,
344c300
< "fault_check": faultCheck, "micro_pc": microPC,
---
> "fault_check": faultCode, "micro_pc": microPc,
346,347d301
< exec_output += execute.subst(iop)
< exec_output += execute.subst(iop_imm)
350c304,311
< faultCheck = ''
---
> exec_output += doSplitExecute(
> pcedCode, addrCalcReg, addrCalcImm, execute, faultCode,
> makeMicroName(name, microPc),
> makeMicroName(name + "Imm", microPc),
> makeMicroName(Name, microPc),
> makeMicroName(Name + "Imm", microPc),
> opt_flags);
> faultCode = ''
354a316,319
> # We need to make sure to check the highest priority fault last.
> # That way, if other faults have been detected, they'll be overwritten
> # rather than the other way around.
> faultCode = AlternateASIPrivFaultCheck + BlockAlignmentFaultCheck
358,359c323,324
< decode_block) = doBlockMemFormat(code, MicroLoadExecute,
< name, Name, opt_flags)
---
> decode_block) = doBlockMemFormat(code, faultCode,
> LoadExecute, name, Name, opt_flags)
362a328,331
> # We need to make sure to check the highest priority fault last.
> # That way, if other faults have been detected, they'll be overwritten
> # rather than the other way around.
> faultCode = AlternateASIPrivFaultCheck + BlockAlignmentFaultCheck
366,367c335,336
< decode_block) = doBlockMemFormat(code, MicroStoreExecute,
< name, Name, opt_flags)
---
> decode_block) = doBlockMemFormat(code, faultCode,
> StoreExecute, name, Name, opt_flags)