}
if (fault == NoFault) {
+ %(update_code)s;
%(op_wb)s;
}
Msr msr = xc->readMiscReg(MISCREG_MSR);
%(op_decl)s;
- %(op_rd)s;
-
EA = pkt->req->getVaddr();
+ %(op_rd)s;
if (msr.le)
getMemLE(pkt, Mem, traceData);
}
if (fault == NoFault) {
- %(op_wb)s;
+ %(update_code)s;
+ %(op_wb)s;
}
return fault;
}
if (fault == NoFault) {
+ %(update_code)s;
%(op_wb)s;
}
NULL);
}
- // Need to write back any potential address register update
- if (fault == NoFault) {
- %(op_wb)s;
- }
-
return fault;
}
}};
Fault %(class_name)s::completeAcc(PacketPtr pkt, ExecContext *xc,
Trace::InstRecord *traceData) const
{
- return NoFault;
+ M5_VAR_USED Addr EA;
+ Fault fault = NoFault;
+
+ %(op_decl)s;
+ EA = pkt->req->getVaddr();
+ %(op_rd)s;
+
+ // Need to write back any potential address register update
+ if (fault == NoFault) {
+ %(update_code)s;
+ %(op_wb)s;
+ }
+
+ return fault;
}
}};
// dependence on Ra.
let {{
-def GenMemOp(name, Name, memacc_code, ea_code, ea_code_ra0, base,
+def GenMemOp(name, Name, memacc_code, update_code, ea_code, ea_code_ra0, base,
load_or_store, mem_flags = [], inst_flags = []):
# First the version where Ra is non-zero
(header_output, decoder_output, decode_block, exec_output) = \
- LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
+ LoadStoreBase(name, Name, ea_code,
+ memacc_code, update_code,
+ mem_flags, inst_flags,
base_class = base,
decode_template = CheckRaDecode,
exec_template_base = load_or_store)
# Now another version where Ra == 0
(header_output_ra0, decoder_output_ra0, _, exec_output_ra0) = \
- LoadStoreBase(name, Name + 'RaZero', ea_code_ra0, memacc_code,
+ LoadStoreBase(name, Name + 'RaZero', ea_code_ra0,
+ memacc_code, update_code,
mem_flags, inst_flags,
base_class = base,
exec_template_base = load_or_store)
}};
-def format LoadIndexOp(memacc_code, ea_code = {{ EA = Ra + Rb; }},
+def format LoadIndexOp(memacc_code, update_code = {{ }},
+ ea_code = {{ EA = Ra + Rb; }},
ea_code_ra0 = {{ EA = Rb; }},
mem_flags = [], inst_flags = []) {{
(header_output, decoder_output, decode_block, exec_output) = \
- GenMemOp(name, Name, memacc_code, ea_code, ea_code_ra0,
+ GenMemOp(name, Name, memacc_code, update_code, ea_code, ea_code_ra0,
'MemIndexOp', 'Load', mem_flags, inst_flags)
}};
-def format StoreIndexOp(memacc_code, ea_code = {{ EA = Ra + Rb; }},
+def format StoreIndexOp(memacc_code, update_code = {{ }},
+ ea_code = {{ EA = Ra + Rb; }},
ea_code_ra0 = {{ EA = Rb; }},
mem_flags = [], inst_flags = []) {{
(header_output, decoder_output, decode_block, exec_output) = \
- GenMemOp(name, Name, memacc_code, ea_code, ea_code_ra0,
+ GenMemOp(name, Name, memacc_code, update_code, ea_code, ea_code_ra0,
'MemIndexOp', 'Store', mem_flags, inst_flags)
}};
mem_flags = [], inst_flags = []) {{
# Add in the update code
- memacc_code += 'Ra = EA;'
+ update_code = 'Ra = EA;'
# Generate the class
(header_output, decoder_output, decode_block, exec_output) = \
- LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
+ LoadStoreBase(name, Name, ea_code, memacc_code, update_code,
+ mem_flags, inst_flags,
base_class = 'MemIndexOp',
decode_template = CheckRaRtDecode,
exec_template_base = 'Load')
mem_flags = [], inst_flags = []) {{
# Add in the update code
- memacc_code += 'Ra = EA;'
+ update_code = 'Ra = EA;'
# Generate the class
(header_output, decoder_output, decode_block, exec_output) = \
- LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
+ LoadStoreBase(name, Name, ea_code, memacc_code, update_code,
+ mem_flags, inst_flags,
base_class = 'MemIndexOp',
decode_template = CheckRaZeroDecode,
exec_template_base = 'Store')
ea_code_ra0 = {{ EA = disp; }},
mem_flags = [], inst_flags = []) {{
(header_output, decoder_output, decode_block, exec_output) = \
- GenMemOp(name, Name, memacc_code, ea_code, ea_code_ra0,
+ GenMemOp(name, Name, memacc_code, '', ea_code, ea_code_ra0,
'MemDispOp', 'Load', mem_flags, inst_flags)
}};
ea_code_ra0 = {{ EA = disp; }},
mem_flags = [], inst_flags = []) {{
(header_output, decoder_output, decode_block, exec_output) = \
- GenMemOp(name, Name, memacc_code, ea_code, ea_code_ra0,
+ GenMemOp(name, Name, memacc_code, '', ea_code, ea_code_ra0,
'MemDispOp', 'Store', mem_flags, inst_flags)
}};
ea_code_ra0 = {{ EA = (disp << 2); }},
mem_flags = [], inst_flags = []) {{
(header_output, decoder_output, decode_block, exec_output) = \
- GenMemOp(name, Name, memacc_code, ea_code, ea_code_ra0,
+ GenMemOp(name, Name, memacc_code, '', ea_code, ea_code_ra0,
'MemDispShiftOp', 'Load', mem_flags, inst_flags)
}};
ea_code_ra0 = {{ EA = (disp << 2); }},
mem_flags = [], inst_flags = []) {{
(header_output, decoder_output, decode_block, exec_output) = \
- GenMemOp(name, Name, memacc_code, ea_code, ea_code_ra0,
+ GenMemOp(name, Name, memacc_code, '', ea_code, ea_code_ra0,
'MemDispShiftOp', 'Store', mem_flags, inst_flags)
}};
mem_flags = [], inst_flags = []) {{
# Add in the update code
- memacc_code += 'Ra = EA;'
+ update_code = 'Ra = EA;'
# Generate the class
(header_output, decoder_output, decode_block, exec_output) = \
- LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
+ LoadStoreBase(name, Name, ea_code, memacc_code, update_code,
+ mem_flags, inst_flags,
base_class = 'MemDispOp',
decode_template = CheckRaRtDecode,
exec_template_base = 'Load')
mem_flags = [], inst_flags = []) {{
# Add in the update code
- memacc_code += 'Ra = EA;'
+ update_code = 'Ra = EA;'
# Generate the class
(header_output, decoder_output, decode_block, exec_output) = \
- LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
+ LoadStoreBase(name, Name, ea_code, memacc_code, update_code,
+ mem_flags, inst_flags,
base_class = 'MemDispOp',
decode_template = CheckRaZeroDecode,
exec_template_base = 'Store')
mem_flags = [], inst_flags = []) {{
# Add in the update code
- memacc_code += 'Ra = EA;'
+ update_code = 'Ra = EA;'
# Generate the class
(header_output, decoder_output, decode_block, exec_output) = \
- LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
+ LoadStoreBase(name, Name, ea_code, memacc_code, update_code,
+ mem_flags, inst_flags,
base_class = 'MemDispShiftOp',
decode_template = CheckRaRtDecode,
exec_template_base = 'Load')
mem_flags = [], inst_flags = []) {{
# Add in the update code
- memacc_code += 'Ra = EA;'
+ update_code = 'Ra = EA;'
# Generate the class
(header_output, decoder_output, decode_block, exec_output) = \
- LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
+ LoadStoreBase(name, Name, ea_code, memacc_code, update_code,
+ mem_flags, inst_flags,
base_class = 'MemDispShiftOp',
decode_template = CheckRaZeroDecode,
exec_template_base = 'Store')