tlbop.isa revision 2686:f0d591379ac3
1// -*- mode:c++ -*-
2
3////////////////////////////////////////////////////////////////////
4//
5// TlbOp instructions
6//
7
8output header {{
9        /**
10         * Base class for integer operations.
11         */
12        class TlbOp : public MipsStaticInst
13        {
14                protected:
15
16                /// Constructor
17                TlbOp(const char *mnem, MachInst _machInst, OpClass __opClass) : MipsStaticInst(mnem, _machInst, __opClass)
18                {
19                }
20
21                std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
22        };
23}};
24
25output decoder {{
26        std::string TlbOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
27        {
28                return "Disassembly of integer instruction\n";
29        }
30}};
31
32def template TlbOpExecute {{
33        Fault %(class_name)s::execute(%(CPU_exec_context)s *xc, Trace::InstRecord *traceData) const
34        {
35                //Write the resulting state to the execution context
36                %(op_wb)s;
37
38                //Call into the trap handler with the appropriate fault
39                return No_Fault;
40        }
41}};
42
43// Primary format for integer operate instructions:
44def format TlbOp(code, *opt_flags) {{
45        orig_code = code
46        cblk = CodeBlock(code)
47        iop = InstObjParams(name, Name, 'MipsStaticInst', cblk, opt_flags)
48        header_output = BasicDeclare.subst(iop)
49        decoder_output = BasicConstructor.subst(iop)
50        decode_block = BasicDecodeWithMnemonic.subst(iop)
51        exec_output = TlbOpExecute.subst(iop)
52}};
53