inteltrace.cc revision 7720
14776Sgblack@eecs.umich.edu/*
24776Sgblack@eecs.umich.edu * Copyright (c) 2001-2005 The Regents of The University of Michigan
34776Sgblack@eecs.umich.edu * All rights reserved.
44776Sgblack@eecs.umich.edu *
54776Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without
64776Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are
74776Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright
84776Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer;
94776Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright
104776Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the
114776Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution;
124776Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its
134776Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from
144776Sgblack@eecs.umich.edu * this software without specific prior written permission.
154776Sgblack@eecs.umich.edu *
164776Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
174776Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
184776Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
194776Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
204776Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
214776Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
224776Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
234776Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
244776Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
254776Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
264776Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
274776Sgblack@eecs.umich.edu *
284776Sgblack@eecs.umich.edu * Authors: Steve Reinhardt
294776Sgblack@eecs.umich.edu *          Lisa Hsu
304776Sgblack@eecs.umich.edu *          Nathan Binkert
314776Sgblack@eecs.umich.edu *          Steve Raasch
324776Sgblack@eecs.umich.edu */
334776Sgblack@eecs.umich.edu
344776Sgblack@eecs.umich.edu#include <iomanip>
354776Sgblack@eecs.umich.edu
366658Snate@binkert.org#include "config/the_isa.hh"
374776Sgblack@eecs.umich.edu#include "cpu/exetrace.hh"
384776Sgblack@eecs.umich.edu#include "cpu/inteltrace.hh"
394776Sgblack@eecs.umich.edu#include "cpu/static_inst.hh"
404776Sgblack@eecs.umich.edu
414776Sgblack@eecs.umich.eduusing namespace std;
424776Sgblack@eecs.umich.eduusing namespace TheISA;
434776Sgblack@eecs.umich.edu
444776Sgblack@eecs.umich.edunamespace Trace {
454776Sgblack@eecs.umich.edu
464776Sgblack@eecs.umich.eduvoid
474776Sgblack@eecs.umich.eduTrace::IntelTraceRecord::dump()
484776Sgblack@eecs.umich.edu{
494776Sgblack@eecs.umich.edu    ostream &outs = Trace::output();
504776Sgblack@eecs.umich.edu    ccprintf(outs, "%7d ) ", when);
517720Sgblack@eecs.umich.edu    outs << "0x" << hex << pc.instAddr() << ":\t";
524776Sgblack@eecs.umich.edu    if (staticInst->isLoad()) {
534776Sgblack@eecs.umich.edu        ccprintf(outs, "<RD %#x>", addr);
544776Sgblack@eecs.umich.edu    } else if (staticInst->isStore()) {
554776Sgblack@eecs.umich.edu        ccprintf(outs, "<WR %#x>", addr);
564776Sgblack@eecs.umich.edu    }
574776Sgblack@eecs.umich.edu    outs << endl;
584776Sgblack@eecs.umich.edu}
594776Sgblack@eecs.umich.edu
604776Sgblack@eecs.umich.edu/* namespace Trace */ }
614776Sgblack@eecs.umich.edu
624776Sgblack@eecs.umich.edu////////////////////////////////////////////////////////////////////////
634776Sgblack@eecs.umich.edu//
644776Sgblack@eecs.umich.edu//  ExeTracer Simulation Object
654776Sgblack@eecs.umich.edu//
664776Sgblack@eecs.umich.eduTrace::IntelTrace *
674776Sgblack@eecs.umich.eduIntelTraceParams::create()
684776Sgblack@eecs.umich.edu{
695034Smilesck@eecs.umich.edu    return new Trace::IntelTrace(this);
704776Sgblack@eecs.umich.edu};
71