mips: Delete authors lists from mips files.
[gem5.git] / src / arch / mips / isa / formats / unknown.isa
index 7c227559837b0a16f28a9093603304b06b920b06..cc1ac283f12bf54914babe80762773011c622fa8 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode:c++ -*-
 
-// Copyright (c) 2003-2005 The Regents of The University of Michigan
+// Copyright (c) 2006 The Regents of The University of Michigan
 // All rights reserved.
 //
 // Redistribution and use in source and binary forms, with or without
@@ -25,8 +25,6 @@
 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: Korey Sewell
 
 ////////////////////////////////////////////////////////////////////
 //
 //
 
 output header {{
-        std::string inst2string(MachInst machInst);
-}};
-output decoder {{
-
-std::string inst2string(MachInst machInst)
-{
-    string str = "";
-    uint32_t mask = 0x80000000;
-
-    for(int i=0; i < 32; i++) {
-        if ((machInst & mask) == 0) {
-            str += "0";
-        } else {
-            str += "1";
+    /**
+     * Static instruction class for unknown (illegal) instructions.
+     * These cause simulator termination if they are executed in a
+     * non-speculative mode.  This is a leaf class.
+     */
+    class Unknown : public MipsStaticInst
+    {
+      public:
+        /// Constructor
+        Unknown(MachInst _machInst)
+            : MipsStaticInst("unknown", _machInst, No_OpClass)
+        {
+            // don't call execute() (which panics) if we're on a
+            // speculative path
+            flags[IsNonSpeculative] = true;
         }
 
-        mask = mask >> 1;
-    }
+        Fault execute(ExecContext *, Trace::InstRecord *) const override;
 
-    return str;
-}
+        std::string generateDisassembly(
+                Addr pc, const SymbolTable *symtab) const override;
+    };
+}};
 
+output decoder {{
     std::string
     Unknown::generateDisassembly(Addr pc, const SymbolTable *symtab) const
     {
@@ -66,12 +67,9 @@ std::string inst2string(MachInst machInst)
 
 output exec {{
     Fault
-    Unknown::execute(%(CPU_exec_context)s *xc,
-                     Trace::InstRecord *traceData) const
+    Unknown::execute(ExecContext *xc, Trace::InstRecord *traceData) const
     {
-        panic("attempt to execute unknown instruction "
-              "(inst 0x%08x, opcode 0x%x, binary: %s)", machInst, OPCODE, inst2string(machInst));
-        return new UnimplementedOpcodeFault;
+        return std::make_shared<ReservedInstructionFault>();
     }
 }};