1// Copyright (c) 2006 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 --- 49 unchanged lines hidden (view full) --- 58 59// Basic instruction class execute method template. 60def template BasicExecute {{ 61 Fault %(class_name)s::execute(%(CPU_exec_context)s *xc, 62 Trace::InstRecord *traceData) const 63 { 64 Fault fault = NoFault; 65 |
66 %(op_decl)s; 67 %(op_rd)s; 68 %(code)s; 69 70 if(fault == NoFault) 71 { 72 %(op_wb)s; 73 } 74 return fault; 75 } 76}}; 77 78// Basic decode template. 79def template BasicDecode {{ 80 return new %(class_name)s(machInst); 81}}; 82 |
83// The most basic instruction format... used only for a few misc. insts 84def format BasicOperate(code, *flags) {{ 85 iop = InstObjParams(name, Name, 'SparcStaticInst', 86 CodeBlock(code), flags) 87 header_output = BasicDeclare.subst(iop) 88 decoder_output = BasicConstructor.subst(iop) 89 decode_block = BasicDecode.subst(iop) 90 exec_output = BasicExecute.subst(iop) 91}}; |