util.isa (12106:7784fac1b159) util.isa (12234:78ece221f9f5)
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

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

125 }
126
127 return response.str();
128 }
129}};
130
131// This template provides the execute functions for a load
132def template LoadExecute {{
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

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

125 }
126
127 return response.str();
128 }
129}};
130
131// This template provides the execute functions for a load
132def template LoadExecute {{
133 Fault %(class_name)s::execute(CPU_EXEC_CONTEXT *xc,
133 Fault %(class_name)s::execute(ExecContext *xc,
134 Trace::InstRecord *traceData) const
135 {
136 Fault fault = NoFault;
137 Addr EA;
138 %(fp_enable_check)s;
139 %(op_decl)s;
140 %(op_rd)s;
141 %(ea_code)s;

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

153 %(op_wb)s;
154 }
155
156 return fault;
157 }
158}};
159
160def template LoadInitiateAcc {{
134 Trace::InstRecord *traceData) const
135 {
136 Fault fault = NoFault;
137 Addr EA;
138 %(fp_enable_check)s;
139 %(op_decl)s;
140 %(op_rd)s;
141 %(ea_code)s;

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

153 %(op_wb)s;
154 }
155
156 return fault;
157 }
158}};
159
160def template LoadInitiateAcc {{
161 Fault %(class_name)s::initiateAcc(CPU_EXEC_CONTEXT * xc,
161 Fault %(class_name)s::initiateAcc(ExecContext * xc,
162 Trace::InstRecord * traceData) const
163 {
164 Fault fault = NoFault;
165 Addr EA;
166 %(fp_enable_check)s;
167 %(op_decl)s;
168 %(op_rd)s;
169 %(ea_code)s;
170 DPRINTF(Sparc, "%s: The address is 0x%x\n", mnemonic, EA);
171 %(fault_check)s;
172 if (fault == NoFault) {
173 %(EA_trunc)s
174 fault = initiateMemRead(xc, traceData, EA, Mem, %(asi_val)s);
175 }
176 return fault;
177 }
178}};
179
180def template LoadCompleteAcc {{
162 Trace::InstRecord * traceData) const
163 {
164 Fault fault = NoFault;
165 Addr EA;
166 %(fp_enable_check)s;
167 %(op_decl)s;
168 %(op_rd)s;
169 %(ea_code)s;
170 DPRINTF(Sparc, "%s: The address is 0x%x\n", mnemonic, EA);
171 %(fault_check)s;
172 if (fault == NoFault) {
173 %(EA_trunc)s
174 fault = initiateMemRead(xc, traceData, EA, Mem, %(asi_val)s);
175 }
176 return fault;
177 }
178}};
179
180def template LoadCompleteAcc {{
181 Fault %(class_name)s::completeAcc(PacketPtr pkt, CPU_EXEC_CONTEXT * xc,
181 Fault %(class_name)s::completeAcc(PacketPtr pkt, ExecContext * xc,
182 Trace::InstRecord * traceData) const
183 {
184 Fault fault = NoFault;
185 %(op_decl)s;
186 %(op_rd)s;
187 getMem(pkt, Mem, traceData);
188 %(code)s;
189 if (fault == NoFault) {
190 %(op_wb)s;
191 }
192 return fault;
193 }
194}};
195
196// This template provides the execute functions for a store
197def template StoreExecute {{
182 Trace::InstRecord * traceData) const
183 {
184 Fault fault = NoFault;
185 %(op_decl)s;
186 %(op_rd)s;
187 getMem(pkt, Mem, traceData);
188 %(code)s;
189 if (fault == NoFault) {
190 %(op_wb)s;
191 }
192 return fault;
193 }
194}};
195
196// This template provides the execute functions for a store
197def template StoreExecute {{
198 Fault %(class_name)s::execute(CPU_EXEC_CONTEXT *xc,
198 Fault %(class_name)s::execute(ExecContext *xc,
199 Trace::InstRecord *traceData) const
200 {
201 Fault fault = NoFault;
202 // This is to support the conditional store in cas instructions.
203 // It should be optomized out in all the others
204 bool storeCond = true;
205 Addr EA;
206 %(fp_enable_check)s;

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

221 %(op_wb)s;
222 }
223
224 return fault;
225 }
226}};
227
228def template StoreInitiateAcc {{
199 Trace::InstRecord *traceData) const
200 {
201 Fault fault = NoFault;
202 // This is to support the conditional store in cas instructions.
203 // It should be optomized out in all the others
204 bool storeCond = true;
205 Addr EA;
206 %(fp_enable_check)s;

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

221 %(op_wb)s;
222 }
223
224 return fault;
225 }
226}};
227
228def template StoreInitiateAcc {{
229 Fault %(class_name)s::initiateAcc(CPU_EXEC_CONTEXT * xc,
229 Fault %(class_name)s::initiateAcc(ExecContext * xc,
230 Trace::InstRecord * traceData) const
231 {
232 Fault fault = NoFault;
233 bool storeCond = true;
234 Addr EA;
235 %(fp_enable_check)s;
236 %(op_decl)s;
237

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

246 %(EA_trunc)s
247 fault = writeMemTiming(xc, traceData, Mem, EA, %(asi_val)s, 0);
248 }
249 return fault;
250 }
251}};
252
253def template StoreCompleteAcc {{
230 Trace::InstRecord * traceData) const
231 {
232 Fault fault = NoFault;
233 bool storeCond = true;
234 Addr EA;
235 %(fp_enable_check)s;
236 %(op_decl)s;
237

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

246 %(EA_trunc)s
247 fault = writeMemTiming(xc, traceData, Mem, EA, %(asi_val)s, 0);
248 }
249 return fault;
250 }
251}};
252
253def template StoreCompleteAcc {{
254 Fault %(class_name)s::completeAcc(PacketPtr, CPU_EXEC_CONTEXT * xc,
254 Fault %(class_name)s::completeAcc(PacketPtr, ExecContext * xc,
255 Trace::InstRecord * traceData) const
256 {
257 return NoFault;
258 }
259}};
260
261def template EACompExecute {{
262 Fault
255 Trace::InstRecord * traceData) const
256 {
257 return NoFault;
258 }
259}};
260
261def template EACompExecute {{
262 Fault
263 %(class_name)s::eaComp(CPU_EXEC_CONTEXT *xc,
263 %(class_name)s::eaComp(ExecContext *xc,
264 Trace::InstRecord *traceData) const
265 {
266 Addr EA;
267 Fault fault = NoFault;
268 %(op_decl)s;
269 %(op_rd)s;
270 %(ea_code)s;
271 %(fault_check)s;

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

276 xc->setEA(EA);
277 }
278
279 return fault;
280 }
281}};
282
283def template EACompDeclare {{
264 Trace::InstRecord *traceData) const
265 {
266 Addr EA;
267 Fault fault = NoFault;
268 %(op_decl)s;
269 %(op_rd)s;
270 %(ea_code)s;
271 %(fault_check)s;

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

276 xc->setEA(EA);
277 }
278
279 return fault;
280 }
281}};
282
283def template EACompDeclare {{
284 Fault eaComp(%(CPU_exec_context)s *, Trace::InstRecord *) const;
284 Fault eaComp(ExecContext *, Trace::InstRecord *) const;
285}};
286
287// This delcares the initiateAcc function in memory operations
288def template InitiateAccDeclare {{
285}};
286
287// This delcares the initiateAcc function in memory operations
288def template InitiateAccDeclare {{
289 Fault initiateAcc(%(CPU_exec_context)s *, Trace::InstRecord *) const;
289 Fault initiateAcc(ExecContext *, Trace::InstRecord *) const;
290}};
291
292// This declares the completeAcc function in memory operations
293def template CompleteAccDeclare {{
290}};
291
292// This declares the completeAcc function in memory operations
293def template CompleteAccDeclare {{
294 Fault completeAcc(PacketPtr, %(CPU_exec_context)s *, Trace::InstRecord *) const;
294 Fault completeAcc(PacketPtr, ExecContext *, Trace::InstRecord *) const;
295}};
296
297// Here are some code snippets which check for various fault conditions
298let {{
299 LoadFuncs = [LoadExecute, LoadInitiateAcc, LoadCompleteAcc]
300 StoreFuncs = [StoreExecute, StoreInitiateAcc, StoreCompleteAcc]
301
302 # The LSB can be zero, since it's really the MSB in doubles and quads

--- 65 unchanged lines hidden ---
295}};
296
297// Here are some code snippets which check for various fault conditions
298let {{
299 LoadFuncs = [LoadExecute, LoadInitiateAcc, LoadCompleteAcc]
300 StoreFuncs = [StoreExecute, StoreInitiateAcc, StoreCompleteAcc]
301
302 # The LSB can be zero, since it's really the MSB in doubles and quads

--- 65 unchanged lines hidden ---