simple_trace.hh revision 13429:a1e199fd8122
111308Santhony.gutierrez@amd.com /* 212696Santhony.gutierrez@amd.com * Copyright (c) 2013 ARM Limited 311308Santhony.gutierrez@amd.com * All rights reserved 411308Santhony.gutierrez@amd.com * 511308Santhony.gutierrez@amd.com * The license below extends only to copyright in the software and shall 611308Santhony.gutierrez@amd.com * not be construed as granting a license to any other intellectual 711308Santhony.gutierrez@amd.com * property including but not limited to intellectual property relating 811308Santhony.gutierrez@amd.com * to a hardware implementation of the functionality of the software 911308Santhony.gutierrez@amd.com * licensed hereunder. You may use the software subject to the license 1011308Santhony.gutierrez@amd.com * terms below provided that you ensure that this notice is replicated 1111308Santhony.gutierrez@amd.com * unmodified and in its entirety in all distributions of the software, 1211308Santhony.gutierrez@amd.com * modified or unmodified, in source code or in binary form. 1311308Santhony.gutierrez@amd.com * 1411308Santhony.gutierrez@amd.com * Redistribution and use in source and binary forms, with or without 1511308Santhony.gutierrez@amd.com * modification, are permitted provided that the following conditions are 1611308Santhony.gutierrez@amd.com * met: redistributions of source code must retain the above copyright 1712696Santhony.gutierrez@amd.com * notice, this list of conditions and the following disclaimer; 1812696Santhony.gutierrez@amd.com * redistributions in binary form must reproduce the above copyright 1912696Santhony.gutierrez@amd.com * notice, this list of conditions and the following disclaimer in the 2011308Santhony.gutierrez@amd.com * documentation and/or other materials provided with the distribution; 2111308Santhony.gutierrez@amd.com * neither the name of the copyright holders nor the names of its 2211308Santhony.gutierrez@amd.com * contributors may be used to endorse or promote products derived from 2311308Santhony.gutierrez@amd.com * this software without specific prior written permission. 2411308Santhony.gutierrez@amd.com * 2511308Santhony.gutierrez@amd.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2611308Santhony.gutierrez@amd.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2711308Santhony.gutierrez@amd.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 2811308Santhony.gutierrez@amd.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2911308Santhony.gutierrez@amd.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 3011308Santhony.gutierrez@amd.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3111308Santhony.gutierrez@amd.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3211308Santhony.gutierrez@amd.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3312696Santhony.gutierrez@amd.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3412696Santhony.gutierrez@amd.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 3511308Santhony.gutierrez@amd.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3611308Santhony.gutierrez@amd.com * 3712696Santhony.gutierrez@amd.com * Authors: Matt Horsnell 3812696Santhony.gutierrez@amd.com */ 3911308Santhony.gutierrez@amd.com 4011308Santhony.gutierrez@amd.com/** 4111308Santhony.gutierrez@amd.com * @file This file initializes a simple trace unit which listens to 4212696Santhony.gutierrez@amd.com * a probe point in the fetch and commit stage of the O3 pipeline 4312696Santhony.gutierrez@amd.com * and simply outputs those events as a dissassembled instruction stream 4411308Santhony.gutierrez@amd.com * to the trace output. 4512696Santhony.gutierrez@amd.com */ 4612696Santhony.gutierrez@amd.com#ifndef __CPU_O3_PROBE_SIMPLE_TRACE_HH__ 4711308Santhony.gutierrez@amd.com#define __CPU_O3_PROBE_SIMPLE_TRACE_HH__ 4811308Santhony.gutierrez@amd.com 4912696Santhony.gutierrez@amd.com#include "cpu/o3/dyn_inst.hh" 5012696Santhony.gutierrez@amd.com#include "cpu/o3/impl.hh" 5112696Santhony.gutierrez@amd.com#include "params/SimpleTrace.hh" 5211308Santhony.gutierrez@amd.com#include "sim/probe/probe.hh" 5312696Santhony.gutierrez@amd.com 5412696Santhony.gutierrez@amd.comclass SimpleTrace : public ProbeListenerObject { 5512696Santhony.gutierrez@amd.com 5612696Santhony.gutierrez@amd.com public: 5712696Santhony.gutierrez@amd.com SimpleTrace(const SimpleTraceParams *params): 5812696Santhony.gutierrez@amd.com ProbeListenerObject(params) 5911308Santhony.gutierrez@amd.com { 6012696Santhony.gutierrez@amd.com } 6112696Santhony.gutierrez@amd.com 6212696Santhony.gutierrez@amd.com /** Register the probe listeners. */ 6312696Santhony.gutierrez@amd.com void regProbeListeners(); 6412696Santhony.gutierrez@amd.com 6512696Santhony.gutierrez@amd.com /** Returns the name of the trace. */ 6612696Santhony.gutierrez@amd.com const std::string name() const { return ProbeListenerObject::name() + ".trace"; } 6712696Santhony.gutierrez@amd.com 6812696Santhony.gutierrez@amd.com private: 6912696Santhony.gutierrez@amd.com void traceFetch(const O3CPUImpl::DynInstConstPtr& dynInst); 7012696Santhony.gutierrez@amd.com void traceCommit(const O3CPUImpl::DynInstConstPtr& dynInst); 7112696Santhony.gutierrez@amd.com 7212696Santhony.gutierrez@amd.com}; 7312696Santhony.gutierrez@amd.com#endif//__CPU_O3_PROBE_SIMPLE_TRACE_HH__ 7411308Santhony.gutierrez@amd.com