17087Snate@binkert.org// Copyright (c) 2007 The Hewlett-Packard Development Company
27087Snate@binkert.org// All rights reserved.
37087Snate@binkert.org//
47087Snate@binkert.org// The license below extends only to copyright in the software and shall
57087Snate@binkert.org// not be construed as granting a license to any other intellectual
67087Snate@binkert.org// property including but not limited to intellectual property relating
77087Snate@binkert.org// to a hardware implementation of the functionality of the software
87087Snate@binkert.org// licensed hereunder.  You may use the software subject to the license
97087Snate@binkert.org// terms below provided that you ensure that this notice is replicated
107087Snate@binkert.org// unmodified and in its entirety in all distributions of the software,
117087Snate@binkert.org// modified or unmodified, in source code or in binary form.
127087Snate@binkert.org//
134158Sgblack@eecs.umich.edu// Copyright (c) 2007 The Regents of The University of Michigan
144158Sgblack@eecs.umich.edu// All rights reserved.
154158Sgblack@eecs.umich.edu//
164158Sgblack@eecs.umich.edu// Redistribution and use in source and binary forms, with or without
174158Sgblack@eecs.umich.edu// modification, are permitted provided that the following conditions are
184158Sgblack@eecs.umich.edu// met: redistributions of source code must retain the above copyright
194158Sgblack@eecs.umich.edu// notice, this list of conditions and the following disclaimer;
204158Sgblack@eecs.umich.edu// redistributions in binary form must reproduce the above copyright
214158Sgblack@eecs.umich.edu// notice, this list of conditions and the following disclaimer in the
224158Sgblack@eecs.umich.edu// documentation and/or other materials provided with the distribution;
234158Sgblack@eecs.umich.edu// neither the name of the copyright holders nor the names of its
244158Sgblack@eecs.umich.edu// contributors may be used to endorse or promote products derived from
254158Sgblack@eecs.umich.edu// this software without specific prior written permission.
264158Sgblack@eecs.umich.edu//
274158Sgblack@eecs.umich.edu// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
284158Sgblack@eecs.umich.edu// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
294158Sgblack@eecs.umich.edu// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
304158Sgblack@eecs.umich.edu// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
314158Sgblack@eecs.umich.edu// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
324158Sgblack@eecs.umich.edu// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
334158Sgblack@eecs.umich.edu// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
344158Sgblack@eecs.umich.edu// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
354158Sgblack@eecs.umich.edu// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
364158Sgblack@eecs.umich.edu// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
374158Sgblack@eecs.umich.edu// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
384158Sgblack@eecs.umich.edu//
394158Sgblack@eecs.umich.edu// Authors: Gabe Black
404158Sgblack@eecs.umich.edu
414158Sgblack@eecs.umich.edu////////////////////////////////////////////////////////////////////
424158Sgblack@eecs.umich.edu//
434158Sgblack@eecs.umich.edu// Unknown instructions
444158Sgblack@eecs.umich.edu//
454158Sgblack@eecs.umich.edu
464158Sgblack@eecs.umich.eduoutput header {{
474158Sgblack@eecs.umich.edu        /**
484158Sgblack@eecs.umich.edu         * Class for Unknown/Illegal instructions
494158Sgblack@eecs.umich.edu         */
507720Sgblack@eecs.umich.edu        class Unknown : public X86ISA::X86StaticInst
514158Sgblack@eecs.umich.edu        {
524158Sgblack@eecs.umich.edu          public:
534158Sgblack@eecs.umich.edu
544158Sgblack@eecs.umich.edu            // Constructor
554158Sgblack@eecs.umich.edu            Unknown(ExtMachInst _machInst) :
567720Sgblack@eecs.umich.edu                    X86ISA::X86StaticInst("unknown", _machInst, No_OpClass)
574158Sgblack@eecs.umich.edu            {
584158Sgblack@eecs.umich.edu            }
594158Sgblack@eecs.umich.edu
6012236Sgabeblack@google.com            Fault execute(ExecContext *, Trace::InstRecord *) const;
614158Sgblack@eecs.umich.edu
624158Sgblack@eecs.umich.edu            std::string generateDisassembly(Addr pc,
634158Sgblack@eecs.umich.edu                    const SymbolTable *symtab) const;
644158Sgblack@eecs.umich.edu
654158Sgblack@eecs.umich.edu        };
664158Sgblack@eecs.umich.edu}};
674158Sgblack@eecs.umich.edu
684158Sgblack@eecs.umich.eduoutput decoder {{
694158Sgblack@eecs.umich.edu        std::string Unknown::generateDisassembly(Addr pc,
704158Sgblack@eecs.umich.edu                const SymbolTable *symtab) const
714158Sgblack@eecs.umich.edu        {
724158Sgblack@eecs.umich.edu            return "Unknown instruction";
734158Sgblack@eecs.umich.edu        }
744158Sgblack@eecs.umich.edu}};
754158Sgblack@eecs.umich.edu
764158Sgblack@eecs.umich.eduoutput exec {{
7712234Sgabeblack@google.com        Fault Unknown::execute(ExecContext *xc,
784158Sgblack@eecs.umich.edu                Trace::InstRecord *traceData) const
794158Sgblack@eecs.umich.edu        {
8010474Sandreas.hansson@arm.com            return std::make_shared<InvalidOpcode>();
814158Sgblack@eecs.umich.edu        }
824158Sgblack@eecs.umich.edu}};
834158Sgblack@eecs.umich.edu
844158Sgblack@eecs.umich.edudef format Unknown() {{
854158Sgblack@eecs.umich.edu        decode_block = 'return new Unknown(machInst);\n'
864158Sgblack@eecs.umich.edu}};
87