O3: Track if the RAS has been pushed or not to pop the RAS if neccessary.
[gem5.git] / src / cpu / legiontrace.cc
index aa8e99fd11dfb2d592d4616bcb2059d5969aaf25..c000f57fced976530e87368b174c5d468a06ffb2 100644 (file)
     #error Legion tracing only works with SPARC simulations!
 #endif
 
-#include "config/full_system.hh"
-#if !FULL_SYSTEM
-    #error Legion tracing only works in full system!
-#endif
-
 #include <sys/ipc.h>
 #include <sys/shm.h>
 
 #include <cstdio>
 #include <iomanip>
 
-#include "arch/sparc/predecoder.hh"
+#include "arch/sparc/decoder.hh"
 #include "arch/sparc/registers.hh"
 #include "arch/sparc/utility.hh"
+#include "arch/tlb.hh"
 #include "base/socket.hh"
 #include "cpu/base.hh"
-#include "cpu/decode.hh"
 #include "cpu/legiontrace.hh"
 #include "cpu/static_inst.hh"
 #include "cpu/thread_context.hh"
+#include "sim/full_system.hh"
 #include "sim/system.hh"
 
-#if FULL_SYSTEM
-#include "arch/tlb.hh"
-#endif
-
 //XXX This is temporary
 #include "cpu/m5legion_interface.h"
 
 using namespace std;
 using namespace TheISA;
 
-#if FULL_SYSTEM
 static int diffcount = 0;
 static bool wasMicro = false;
-#endif
 
 namespace Trace {
 SharedData *shared_data = NULL;
@@ -155,7 +145,6 @@ Trace::LegionTraceRecord::dump()
 {
     ostream &outs = Trace::output();
 
-    static TheISA::Predecoder predecoder(NULL);
     // Compare
     bool compared = false;
     bool diffPC   = false;
@@ -432,15 +421,14 @@ Trace::LegionTraceRecord::dump()
                          << staticInst->disassemble(m5Pc, debugSymbolTable)
                          << endl;
 
-                    predecoder.setTC(thread);
-                    predecoder.moreBytes(m5Pc, m5Pc, shared_data->instruction);
+                    TheISA::Decoder *decoder = thread->getDecoderPtr();
+                    decoder->setTC(thread);
+                    decoder->moreBytes(m5Pc, m5Pc, shared_data->instruction);
 
-                    assert(predecoder.extMachInstReady());
+                    assert(decoder->instReady());
 
                     PCState tempPC = pc;
-                    StaticInstPtr legionInst =
-                        thread->getDecoderPtr()->decode(
-                                predecoder.getExtMachInst(tempPC), lgnPc);
+                    StaticInstPtr legionInst = decoder->decode(tempPC);
                     outs << setfill(' ') << setw(15)
                          << " Legion Inst: "
                          << "0x" << setw(8) << setfill('0') << hex
@@ -597,5 +585,7 @@ Trace::LegionTraceRecord::dump()
 Trace::LegionTrace *
 LegionTraceParams::create()
 {
+    if (!FullSystem)
+        panic("Legion tracing only works in full system!");
     return new Trace::LegionTrace(this);
 };