12SN/A/*
21762SN/A * Copyright (c) 2001-2005 The Regents of The University of Michigan
32SN/A * All rights reserved.
42SN/A *
52SN/A * Redistribution and use in source and binary forms, with or without
62SN/A * modification, are permitted provided that the following conditions are
72SN/A * met: redistributions of source code must retain the above copyright
82SN/A * notice, this list of conditions and the following disclaimer;
92SN/A * redistributions in binary form must reproduce the above copyright
102SN/A * notice, this list of conditions and the following disclaimer in the
112SN/A * documentation and/or other materials provided with the distribution;
122SN/A * neither the name of the copyright holders nor the names of its
132SN/A * contributors may be used to endorse or promote products derived from
142SN/A * this software without specific prior written permission.
152SN/A *
162SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272665Ssaidi@eecs.umich.edu *
282665Ssaidi@eecs.umich.edu * Authors: Steve Reinhardt
292665Ssaidi@eecs.umich.edu *          Nathan Binkert
302SN/A */
312SN/A
326216Snate@binkert.org#ifndef __CPU_EXETRACE_HH__
336216Snate@binkert.org#define __CPU_EXETRACE_HH__
342SN/A
354046Sbinkertn@umich.edu#include "base/trace.hh"
366216Snate@binkert.org#include "base/types.hh"
374046Sbinkertn@umich.edu#include "cpu/static_inst.hh"
387680Sgblack@eecs.umich.edu#include "cpu/thread_context.hh"
398232Snate@binkert.org#include "debug/ExecEnable.hh"
406216Snate@binkert.org#include "params/ExeTracer.hh"
414776Sgblack@eecs.umich.edu#include "sim/insttracer.hh"
422SN/A
433064Sgblack@eecs.umich.educlass ThreadContext;
442SN/A
452SN/Anamespace Trace {
462SN/A
474776Sgblack@eecs.umich.educlass ExeTracerRecord : public InstRecord
482SN/A{
492SN/A  public:
504776Sgblack@eecs.umich.edu    ExeTracerRecord(Tick _when, ThreadContext *_thread,
517720Sgblack@eecs.umich.edu               const StaticInstPtr _staticInst, TheISA::PCState _pc,
5210664SAli.Saidi@ARM.com               const StaticInstPtr _macroStaticInst = NULL)
5310664SAli.Saidi@ARM.com        : InstRecord(_when, _thread, _staticInst, _pc, _macroStaticInst)
542SN/A    {
552SN/A    }
562SN/A
5710417Sandreas.hansson@arm.com    void traceInst(const StaticInstPtr &inst, bool ran);
585784Sgblack@eecs.umich.edu
594046Sbinkertn@umich.edu    void dump();
605866Sksewell@umich.edu    virtual void dumpTicks(std::ostream &outs);
612SN/A};
622SN/A
634776Sgblack@eecs.umich.educlass ExeTracer : public InstTracer
644776Sgblack@eecs.umich.edu{
654776Sgblack@eecs.umich.edu  public:
665034Smilesck@eecs.umich.edu    typedef ExeTracerParams Params;
675034Smilesck@eecs.umich.edu    ExeTracer(const Params *params) : InstTracer(params)
684776Sgblack@eecs.umich.edu    {}
692SN/A
704776Sgblack@eecs.umich.edu    InstRecord *
714776Sgblack@eecs.umich.edu    getInstRecord(Tick when, ThreadContext *tc,
727720Sgblack@eecs.umich.edu            const StaticInstPtr staticInst, TheISA::PCState pc,
737720Sgblack@eecs.umich.edu            const StaticInstPtr macroStaticInst = NULL)
744776Sgblack@eecs.umich.edu    {
758232Snate@binkert.org        if (!Debug::ExecEnable)
764776Sgblack@eecs.umich.edu            return NULL;
772SN/A
784776Sgblack@eecs.umich.edu        return new ExeTracerRecord(when, tc,
7910664SAli.Saidi@ARM.com                staticInst, pc, macroStaticInst);
804776Sgblack@eecs.umich.edu    }
814776Sgblack@eecs.umich.edu};
822SN/A
837811Ssteve.reinhardt@amd.com} // namespace Trace
842SN/A
856216Snate@binkert.org#endif // __CPU_EXETRACE_HH__
86