mem.isa (12120:133620bfc43b) mem.isa (12234:78ece221f9f5)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2015 RISC-V Foundation
4// Copyright (c) 2016 The University of Virginia
5// All rights reserved.
6//
7// Redistribution and use in source and binary forms, with or without
8// modification, are permitted provided that the following conditions are

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

116 %(InitiateAccDeclare)s
117
118 %(CompleteAccDeclare)s
119 };
120}};
121
122def template EACompDeclare {{
123 Fault
1// -*- mode:c++ -*-
2
3// Copyright (c) 2015 RISC-V Foundation
4// Copyright (c) 2016 The University of Virginia
5// All rights reserved.
6//
7// Redistribution and use in source and binary forms, with or without
8// modification, are permitted provided that the following conditions are

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

116 %(InitiateAccDeclare)s
117
118 %(CompleteAccDeclare)s
119 };
120}};
121
122def template EACompDeclare {{
123 Fault
124 eaComp(%(CPU_exec_context)s *, Trace::InstRecord *) const;
124 eaComp(ExecContext *, Trace::InstRecord *) const;
125}};
126
127def template InitiateAccDeclare {{
128 Fault
125}};
126
127def template InitiateAccDeclare {{
128 Fault
129 initiateAcc(%(CPU_exec_context)s *, Trace::InstRecord *) const;
129 initiateAcc(ExecContext *, Trace::InstRecord *) const;
130}};
131
132
133def template CompleteAccDeclare {{
134 Fault
130}};
131
132
133def template CompleteAccDeclare {{
134 Fault
135 completeAcc(PacketPtr, %(CPU_exec_context)s *, Trace::InstRecord *) const;
135 completeAcc(PacketPtr, ExecContext *, Trace::InstRecord *) const;
136}};
137
138def template LoadStoreConstructor {{
139 %(class_name)s::%(class_name)s(ExtMachInst machInst):
140 %(base_class)s("%(mnemonic)s", machInst, %(op_class)s)
141 {
142 %(constructor)s;
143 %(offset_code)s;
144 }
145}};
146
147def template EACompExecute {{
148 Fault
136}};
137
138def template LoadStoreConstructor {{
139 %(class_name)s::%(class_name)s(ExtMachInst machInst):
140 %(base_class)s("%(mnemonic)s", machInst, %(op_class)s)
141 {
142 %(constructor)s;
143 %(offset_code)s;
144 }
145}};
146
147def template EACompExecute {{
148 Fault
149 %(class_name)s::eaComp(CPU_EXEC_CONTEXT *xc,
150 Trace::InstRecord *traceData) const
149 %(class_name)s::eaComp(ExecContext *xc, Trace::InstRecord *traceData) const
151 {
152 Addr EA;
153 Fault fault = NoFault;
154
155 %(op_decl)s;
156 %(op_rd)s;
157 %(ea_code)s;
158

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

196 fullExecTemplate.subst(iop) +
197 EACompExecute.subst(iop) +
198 initiateAccTemplate.subst(iop) +
199 completeAccTemplate.subst(iop))
200}};
201
202def template LoadExecute {{
203 Fault
150 {
151 Addr EA;
152 Fault fault = NoFault;
153
154 %(op_decl)s;
155 %(op_rd)s;
156 %(ea_code)s;
157

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

195 fullExecTemplate.subst(iop) +
196 EACompExecute.subst(iop) +
197 initiateAccTemplate.subst(iop) +
198 completeAccTemplate.subst(iop))
199}};
200
201def template LoadExecute {{
202 Fault
204 %(class_name)s::execute(CPU_EXEC_CONTEXT *xc,
205 Trace::InstRecord *traceData) const
203 %(class_name)s::execute(
204 ExecContext *xc, Trace::InstRecord *traceData) const
206 {
207 Addr EA;
208 Fault fault = NoFault;
209
210 %(op_decl)s;
211 %(op_rd)s;
212 %(ea_code)s;
213

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

221 }
222
223 return fault;
224 }
225}};
226
227def template LoadInitiateAcc {{
228 Fault
205 {
206 Addr EA;
207 Fault fault = NoFault;
208
209 %(op_decl)s;
210 %(op_rd)s;
211 %(ea_code)s;
212

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

220 }
221
222 return fault;
223 }
224}};
225
226def template LoadInitiateAcc {{
227 Fault
229 %(class_name)s::initiateAcc(CPU_EXEC_CONTEXT *xc,
228 %(class_name)s::initiateAcc(ExecContext *xc,
230 Trace::InstRecord *traceData) const
231 {
232 Addr EA;
233 Fault fault = NoFault;
234
235 %(op_src_decl)s;
236 %(op_rd)s;
237 %(ea_code)s;
238
239 if (fault == NoFault) {
240 fault = initiateMemRead(xc, traceData, EA, Mem, memAccessFlags);
241 }
242
243 return fault;
244 }
245}};
246
247def template LoadCompleteAcc {{
248 Fault
229 Trace::InstRecord *traceData) const
230 {
231 Addr EA;
232 Fault fault = NoFault;
233
234 %(op_src_decl)s;
235 %(op_rd)s;
236 %(ea_code)s;
237
238 if (fault == NoFault) {
239 fault = initiateMemRead(xc, traceData, EA, Mem, memAccessFlags);
240 }
241
242 return fault;
243 }
244}};
245
246def template LoadCompleteAcc {{
247 Fault
249 %(class_name)s::completeAcc(PacketPtr pkt, CPU_EXEC_CONTEXT *xc,
248 %(class_name)s::completeAcc(PacketPtr pkt, ExecContext *xc,
250 Trace::InstRecord *traceData) const
251 {
252 Fault fault = NoFault;
253
254 %(op_decl)s;
255 %(op_rd)s;
256
257 getMem(pkt, Mem, traceData);

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

265 }
266
267 return fault;
268 }
269}};
270
271def template StoreExecute {{
272 Fault
249 Trace::InstRecord *traceData) const
250 {
251 Fault fault = NoFault;
252
253 %(op_decl)s;
254 %(op_rd)s;
255
256 getMem(pkt, Mem, traceData);

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

264 }
265
266 return fault;
267 }
268}};
269
270def template StoreExecute {{
271 Fault
273 %(class_name)s::execute(CPU_EXEC_CONTEXT *xc,
272 %(class_name)s::execute(ExecContext *xc,
274 Trace::InstRecord *traceData) const
275 {
276 Addr EA;
277 Fault fault = NoFault;
278
279 %(op_decl)s;
280 %(op_rd)s;
281 %(ea_code)s;

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

298 }
299
300 return fault;
301 }
302}};
303
304def template StoreInitiateAcc {{
305 Fault
273 Trace::InstRecord *traceData) const
274 {
275 Addr EA;
276 Fault fault = NoFault;
277
278 %(op_decl)s;
279 %(op_rd)s;
280 %(ea_code)s;

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

297 }
298
299 return fault;
300 }
301}};
302
303def template StoreInitiateAcc {{
304 Fault
306 %(class_name)s::initiateAcc(CPU_EXEC_CONTEXT *xc,
305 %(class_name)s::initiateAcc(ExecContext *xc,
307 Trace::InstRecord *traceData) const
308 {
309 Addr EA;
310 Fault fault = NoFault;
311
312 %(op_decl)s;
313 %(op_rd)s;
314 %(ea_code)s;

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

327 }
328
329 return fault;
330 }
331}};
332
333def template StoreCompleteAcc {{
334 Fault
306 Trace::InstRecord *traceData) const
307 {
308 Addr EA;
309 Fault fault = NoFault;
310
311 %(op_decl)s;
312 %(op_rd)s;
313 %(ea_code)s;

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

326 }
327
328 return fault;
329 }
330}};
331
332def template StoreCompleteAcc {{
333 Fault
335 %(class_name)s::completeAcc(PacketPtr pkt, CPU_EXEC_CONTEXT *xc,
334 %(class_name)s::completeAcc(PacketPtr pkt, ExecContext *xc,
336 Trace::InstRecord *traceData) const
337 {
338 return NoFault;
339 }
340}};
341
342def format Load(memacc_code, ea_code = {{EA = Rs1 + ldisp;}}, mem_flags=[],
343 inst_flags=[]) {{

--- 21 unchanged lines hidden ---
335 Trace::InstRecord *traceData) const
336 {
337 return NoFault;
338 }
339}};
340
341def format Load(memacc_code, ea_code = {{EA = Rs1 + ldisp;}}, mem_flags=[],
342 inst_flags=[]) {{

--- 21 unchanged lines hidden ---