1// Copyright (c) 2006-2007 The Regents of The University of Michigan
2// All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without
5// modification, are permitted provided that the following conditions are
6// met: redistributions of source code must retain the above copyright
7// notice, this list of conditions and the following disclaimer;
8// redistributions in binary form must reproduce the above copyright

--- 135 unchanged lines hidden (view full) ---

144 %(fp_enable_check)s;
145 %(op_decl)s;
146 %(op_rd)s;
147 %(ea_code)s;
148 DPRINTF(Sparc, "%s: The address is 0x%x\n", mnemonic, EA);
149 %(fault_check)s;
150 if(fault == NoFault)
151 {
152 %(EA_trunc)s
153 fault = xc->read(EA, (%(mem_acc_type)s%(mem_acc_size)s_t&)Mem, %(asi_val)s);
154 }
155 if(fault == NoFault)
156 {
157 %(code)s;
158 }
159 if(fault == NoFault)
160 {

--- 14 unchanged lines hidden (view full) ---

175 %(fp_enable_check)s;
176 %(op_decl)s;
177 %(op_rd)s;
178 %(ea_code)s;
179 DPRINTF(Sparc, "%s: The address is 0x%x\n", mnemonic, EA);
180 %(fault_check)s;
181 if(fault == NoFault)
182 {
183 %(EA_trunc)s
184 fault = xc->read(EA, (%(mem_acc_type)s%(mem_acc_size)s_t&)Mem, %(asi_val)s);
185 }
186 return fault;
187 }
188}};
189
190def template LoadCompleteAcc {{
191 Fault %(class_name)s::completeAcc(PacketPtr pkt, %(CPU_exec_context)s * xc,

--- 29 unchanged lines hidden (view full) ---

221 DPRINTF(Sparc, "%s: The address is 0x%x\n", mnemonic, EA);
222 %(fault_check)s;
223 if(fault == NoFault)
224 {
225 %(code)s;
226 }
227 if(storeCond && fault == NoFault)
228 {
229 %(EA_trunc)s
230 fault = xc->write((%(mem_acc_type)s%(mem_acc_size)s_t)Mem,
231 EA, %(asi_val)s, 0);
232 }
233 if(fault == NoFault)
234 {
235 //Write the resulting state to the execution context
236 %(op_wb)s;
237 }

--- 17 unchanged lines hidden (view full) ---

255 DPRINTF(Sparc, "%s: The address is 0x%x\n", mnemonic, EA);
256 %(fault_check)s;
257 if(fault == NoFault)
258 {
259 %(code)s;
260 }
261 if(storeCond && fault == NoFault)
262 {
263 %(EA_trunc)s
264 fault = xc->write((%(mem_acc_type)s%(mem_acc_size)s_t)Mem,
265 EA, %(asi_val)s, 0);
266 }
267 if(fault == NoFault)
268 {
269 //Write the resulting state to the execution context
270 %(op_wb)s;
271 }

--- 44 unchanged lines hidden (view full) ---

316 AlternateASIPrivFaultCheck = '''
317 if(!bits(Pstate,2,2) && !bits(Hpstate,2,2) && !AsiIsUnPriv((ASI)EXT_ASI) ||
318 !bits(Hpstate,2,2) && AsiIsHPriv((ASI)EXT_ASI))
319 fault = new PrivilegedAction;
320 else if(AsiIsAsIfUser((ASI)EXT_ASI) && !bits(Pstate,2,2))
321 fault = new PrivilegedAction;
322 '''
323
324 TruncateEA = '''
325#if !FULL_SYSTEM
326 EA = Pstate<3:> ? EA<31:0> : EA;
327#endif
328 '''
329}};
330
331//A simple function to generate the name of the macro op of a certain
332//instruction at a certain micropc
333let {{
334 def makeMicroName(name, microPc):
335 return name + "::" + name + "_" + str(microPc)
336}};

--- 13 unchanged lines hidden (view full) ---

350
351 def doDualSplitExecute(code, postacc_code, eaRegCode, eaImmCode, execute,
352 faultCode, nameReg, nameImm, NameReg, NameImm, asi, opt_flags):
353 executeCode = ''
354 for (eaCode, name, Name) in (
355 (eaRegCode, nameReg, NameReg),
356 (eaImmCode, nameImm, NameImm)):
357 microParams = {"code": code, "postacc_code" : postacc_code,
349 "ea_code": eaCode, "fault_check": faultCode}
358 "ea_code": eaCode, "fault_check": faultCode,
359 "EA_trunc" : TruncateEA}
360 executeCode += doSplitExecute(execute, name, Name,
361 asi, opt_flags, microParams)
362 return executeCode
363}};