opcdec.isa revision 2649
12227SN/A// -*- mode:c++ -*-
22227SN/A
32227SN/A// Copyright (c) 2003-2005 The Regents of The University of Michigan
42227SN/A// All rights reserved.
52227SN/A//
62227SN/A// Redistribution and use in source and binary forms, with or without
72227SN/A// modification, are permitted provided that the following conditions are
82227SN/A// met: redistributions of source code must retain the above copyright
92227SN/A// notice, this list of conditions and the following disclaimer;
102227SN/A// redistributions in binary form must reproduce the above copyright
112227SN/A// notice, this list of conditions and the following disclaimer in the
122227SN/A// documentation and/or other materials provided with the distribution;
132227SN/A// neither the name of the copyright holders nor the names of its
142227SN/A// contributors may be used to endorse or promote products derived from
152227SN/A// this software without specific prior written permission.
162227SN/A//
172227SN/A// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
182227SN/A// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
192227SN/A// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
202227SN/A// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
212227SN/A// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
222227SN/A// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
232227SN/A// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
242227SN/A// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
252227SN/A// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
262227SN/A// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
272227SN/A// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
282227SN/A
292649Ssaidi@eecs.umich.edu////////////////////////////////////////////////////////////////////
302649Ssaidi@eecs.umich.edu//
312649Ssaidi@eecs.umich.edu// OPCDEC fault instructions
322649Ssaidi@eecs.umich.edu//
332649Ssaidi@eecs.umich.edu
342227SN/Aoutput header {{
352227SN/A    /**
362227SN/A     * Static instruction class for instructions that cause an OPCDEC fault
372227SN/A     * when executed.  This is currently only for PAL mode instructions
382227SN/A     * executed in non-PAL mode.
392227SN/A     */
402227SN/A    class OpcdecFault : public AlphaStaticInst
412227SN/A    {
422227SN/A      public:
432227SN/A        /// Constructor
442227SN/A        OpcdecFault(ExtMachInst _machInst)
452227SN/A            : AlphaStaticInst("opcdec fault", _machInst, No_OpClass)
462227SN/A        {
472227SN/A        }
482227SN/A
492227SN/A        %(BasicExecDeclare)s
502227SN/A
512227SN/A        std::string
522227SN/A        generateDisassembly(Addr pc, const SymbolTable *symtab) const;
532227SN/A    };
542227SN/A}};
552227SN/A
562227SN/Aoutput decoder {{
572227SN/A    std::string
582227SN/A    OpcdecFault::generateDisassembly(Addr pc, const SymbolTable *symtab) const
592227SN/A    {
602227SN/A        return csprintf("%-10s (inst 0x%x, opcode 0x%x)",
612227SN/A                        " OPCDEC fault", machInst, OPCODE);
622227SN/A    }
632227SN/A}};
642227SN/A
652227SN/Aoutput exec {{
662227SN/A    Fault
672227SN/A    OpcdecFault::execute(%(CPU_exec_context)s *xc,
682227SN/A                     Trace::InstRecord *traceData) const
692227SN/A    {
702227SN/A        return new UnimplementedOpcodeFault;
712227SN/A    }
722227SN/A}};
732227SN/A
742227SN/Adef format OpcdecFault() {{
752227SN/A    decode_block = 'return new OpcdecFault(machInst);\n'
762227SN/A}};
772227SN/A
78