nop.isa revision 2469
1////////////////////////////////////////////////////////////////////
2//
3// Noop instruction
4//
5
6output header {{
7        /**
8         * Noop class.
9         */
10        class Noop : public SparcStaticInst
11        {
12          protected:
13            // Constructor
14            Noop(const char *mnem, ExtMachInst _machInst, OpClass __opClass) :
15                SparcStaticInst(mnem, _machInst, __opClass)
16            {
17            }
18
19            std::string generateDisassembly(Addr pc,
20                    const SymbolTable *symtab) const;
21        };
22}};
23
24output decoder {{
25        std::string Noop::generateDisassembly(Addr pc,
26                const SymbolTable *symtab) const
27        {
28            return "Noop\n";
29        }
30}};
31
32def template NoopExecute {{
33        Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
34                Trace::InstRecord *traceData) const
35        {
36            //Nothing to see here, move along
37            return NoFault;
38        }
39}};
40
41// Primary format for integer operate instructions:
42def format Noop(code, *opt_flags) {{
43        orig_code = code
44        cblk = CodeBlock(code)
45        iop = InstObjParams(name, Name, 'SparcStaticInst', cblk, opt_flags)
46        header_output = BasicDeclare.subst(iop)
47        decoder_output = BasicConstructor.subst(iop)
48        decode_block = BasicDecode.subst(iop)
49        exec_output = NoopExecute.subst(iop)
50}};
51