cpu: Failure to restore RAS during squash
[gem5.git] / src / cpu / exetrace.hh
index e49a2bb59ce3c3269c7e8b1280c1d5b0b94b0c01..03e0e452941e23bbae843ca1bf3b070eceb8c225 100644 (file)
  * 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: Steve Reinhardt
- *          Nathan Binkert
  */
 
-#ifndef __EXETRACE_HH__
-#define __EXETRACE_HH__
+#ifndef __CPU_EXETRACE_HH__
+#define __CPU_EXETRACE_HH__
 
 #include "base/trace.hh"
+#include "base/types.hh"
 #include "cpu/static_inst.hh"
-#include "sim/host.hh"
-#include "sim/insttracer.hh"
+#include "cpu/thread_context.hh"
+#include "debug/ExecEnable.hh"
 #include "params/ExeTracer.hh"
+#include "sim/insttracer.hh"
 
 class ThreadContext;
 
-
 namespace Trace {
 
 class ExeTracerRecord : public InstRecord
 {
   public:
     ExeTracerRecord(Tick _when, ThreadContext *_thread,
-               const StaticInstPtr _staticInst, Addr _pc, bool spec,
-               const StaticInstPtr _macroStaticInst = NULL, MicroPC _upc = 0)
-        : InstRecord(_when, _thread, _staticInst, _pc, spec,
-                _macroStaticInst, _upc)
+               const StaticInstPtr _staticInst, TheISA::PCState _pc,
+               const StaticInstPtr _macroStaticInst = NULL)
+        : InstRecord(_when, _thread, _staticInst, _pc, _macroStaticInst)
     {
     }
 
-    void traceInst(StaticInstPtr inst, bool ran);
+    void traceInst(const StaticInstPtr &inst, bool ran);
 
     void dump();
-    virtual void dumpTicks(std::ostream &outs);
 };
 
 class ExeTracer : public InstTracer
@@ -69,23 +65,17 @@ class ExeTracer : public InstTracer
 
     InstRecord *
     getInstRecord(Tick when, ThreadContext *tc,
-            const StaticInstPtr staticInst, Addr pc,
-            const StaticInstPtr macroStaticInst = NULL, MicroPC upc = 0)
+            const StaticInstPtr staticInst, TheISA::PCState pc,
+            const StaticInstPtr macroStaticInst = NULL)
     {
-        if (!IsOn(ExecEnable))
-            return NULL;
-
-        if (!Trace::enabled)
-            return NULL;
-
-        if (!IsOn(ExecSpeculative) && tc->misspeculating())
+        if (!Debug::ExecEnable)
             return NULL;
 
         return new ExeTracerRecord(when, tc,
-                staticInst, pc, tc->misspeculating(), macroStaticInst, upc);
+                staticInst, pc, macroStaticInst);
     }
 };
 
-/* namespace Trace */ }
+} // namespace Trace
 
-#endif // __EXETRACE_HH__
+#endif // __CPU_EXETRACE_HH__