tlbop.isa revision 2686
12686Sksewell@umich.edu// -*- mode:c++ -*-
22686Sksewell@umich.edu
32038SN/A////////////////////////////////////////////////////////////////////
42038SN/A//
52038SN/A// TlbOp instructions
62038SN/A//
72038SN/A
82038SN/Aoutput header {{
92038SN/A        /**
102038SN/A         * Base class for integer operations.
112038SN/A         */
122038SN/A        class TlbOp : public MipsStaticInst
132038SN/A        {
142038SN/A                protected:
152038SN/A
162038SN/A                /// Constructor
172038SN/A                TlbOp(const char *mnem, MachInst _machInst, OpClass __opClass) : MipsStaticInst(mnem, _machInst, __opClass)
182038SN/A                {
192038SN/A                }
202038SN/A
212038SN/A                std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
222038SN/A        };
232038SN/A}};
242038SN/A
252038SN/Aoutput decoder {{
262038SN/A        std::string TlbOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
272038SN/A        {
282038SN/A                return "Disassembly of integer instruction\n";
292038SN/A        }
302038SN/A}};
312038SN/A
322038SN/Adef template TlbOpExecute {{
332038SN/A        Fault %(class_name)s::execute(%(CPU_exec_context)s *xc, Trace::InstRecord *traceData) const
342038SN/A        {
352038SN/A                //Write the resulting state to the execution context
362038SN/A                %(op_wb)s;
372038SN/A
382686Sksewell@umich.edu                //Call into the trap handler with the appropriate fault
392038SN/A                return No_Fault;
402038SN/A        }
412038SN/A}};
422038SN/A
432038SN/A// Primary format for integer operate instructions:
442038SN/Adef format TlbOp(code, *opt_flags) {{
452038SN/A        orig_code = code
462038SN/A        cblk = CodeBlock(code)
472038SN/A        iop = InstObjParams(name, Name, 'MipsStaticInst', cblk, opt_flags)
482038SN/A        header_output = BasicDeclare.subst(iop)
492038SN/A        decoder_output = BasicConstructor.subst(iop)
502038SN/A        decode_block = BasicDecodeWithMnemonic.subst(iop)
512038SN/A        exec_output = TlbOpExecute.subst(iop)
522038SN/A}};
53