stack_dist.hh revision 10995:a114e2712642
16145Snate@binkert.org/*
212065Snikos.nikoleris@arm.com * Copyright (c) 2015 ARM Limited
312065Snikos.nikoleris@arm.com * All rights reserved
412065Snikos.nikoleris@arm.com *
512065Snikos.nikoleris@arm.com * The license below extends only to copyright in the software and shall
612065Snikos.nikoleris@arm.com * not be construed as granting a license to any other intellectual
712065Snikos.nikoleris@arm.com * property including but not limited to intellectual property relating
812065Snikos.nikoleris@arm.com * to a hardware implementation of the functionality of the software
912065Snikos.nikoleris@arm.com * licensed hereunder.  You may use the software subject to the license
1012065Snikos.nikoleris@arm.com * terms below provided that you ensure that this notice is replicated
1112065Snikos.nikoleris@arm.com * unmodified and in its entirety in all distributions of the software,
1212065Snikos.nikoleris@arm.com * modified or unmodified, in source code or in binary form.
1312065Snikos.nikoleris@arm.com *
146145Snate@binkert.org * Redistribution and use in source and binary forms, with or without
156145Snate@binkert.org * modification, are permitted provided that the following conditions are
166145Snate@binkert.org * met: redistributions of source code must retain the above copyright
176145Snate@binkert.org * notice, this list of conditions and the following disclaimer;
186145Snate@binkert.org * redistributions in binary form must reproduce the above copyright
196145Snate@binkert.org * notice, this list of conditions and the following disclaimer in the
206145Snate@binkert.org * documentation and/or other materials provided with the distribution;
216145Snate@binkert.org * neither the name of the copyright holders nor the names of its
226145Snate@binkert.org * contributors may be used to endorse or promote products derived from
236145Snate@binkert.org * this software without specific prior written permission.
246145Snate@binkert.org *
256145Snate@binkert.org * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
266145Snate@binkert.org * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
276145Snate@binkert.org * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
286145Snate@binkert.org * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
296145Snate@binkert.org * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
306145Snate@binkert.org * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
316145Snate@binkert.org * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
326145Snate@binkert.org * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
336145Snate@binkert.org * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
346145Snate@binkert.org * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
356145Snate@binkert.org * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
366145Snate@binkert.org *
376145Snate@binkert.org * Authors: Andreas Sandberg
386145Snate@binkert.org */
396145Snate@binkert.org
406145Snate@binkert.org#ifndef __MEM_PROBES_STACK_DIST_HH__
416145Snate@binkert.org#define __MEM_PROBES_STACK_DIST_HH__
427054Snate@binkert.org
437054Snate@binkert.org#include "mem/packet.hh"
447054Snate@binkert.org#include "mem/probes/base.hh"
457054Snate@binkert.org#include "mem/stack_dist_calc.hh"
467054Snate@binkert.org#include "sim/stats.hh"
477054Snate@binkert.org
487054Snate@binkert.orgstruct StackDistProbeParams;
497054Snate@binkert.org
507054Snate@binkert.orgclass StackDistProbe : public BaseMemProbe
516145Snate@binkert.org{
527054Snate@binkert.org  public:
537054Snate@binkert.org    StackDistProbe(StackDistProbeParams *params);
546145Snate@binkert.org
557055Snate@binkert.org    void regStats() M5_ATTR_OVERRIDE;
567055Snate@binkert.org
5712065Snikos.nikoleris@arm.com  protected:
587454Snate@binkert.org    void handleRequest(const PacketPtr &pkt) M5_ATTR_OVERRIDE;
597055Snate@binkert.org
6012065Snikos.nikoleris@arm.com  protected:
6112065Snikos.nikoleris@arm.com    // Cache line size to simulate
6212065Snikos.nikoleris@arm.com    const unsigned lineSize;
6313784Sgabeblack@google.com
648257SBrad.Beckmann@amd.com    // Disable the linear histograms
657054Snate@binkert.org    const bool disableLinearHists;
6612065Snikos.nikoleris@arm.com
678645Snilay@cs.wisc.edu    // Disable the logarithmic histograms
689594Snilay@cs.wisc.edu    const bool disableLogHists;
6913784Sgabeblack@google.com
707054Snate@binkert.org  protected:
719465Snilay@cs.wisc.edu    // Reads linear histogram
726145Snate@binkert.org    Stats::Histogram readLinearHist;
736145Snate@binkert.org
746145Snate@binkert.org    // Reads logarithmic histogram
756145Snate@binkert.org    Stats::SparseHistogram readLogHist;
769465Snilay@cs.wisc.edu
777054Snate@binkert.org    // Writes linear histogram
787054Snate@binkert.org    Stats::Histogram writeLinearHist;
796876Ssteve.reinhardt@amd.com
806876Ssteve.reinhardt@amd.com    // Writes logarithmic histogram
819594Snilay@cs.wisc.edu    Stats::SparseHistogram writeLogHist;
8210917Sbrandon.potter@amd.com
836145Snate@binkert.org    // Writes logarithmic histogram
8410303Snilay@cs.wisc.edu    Stats::Scalar infiniteSD;
8513799SAndrea.Mondelli@ucf.edu
866145Snate@binkert.org  protected:
879497Snilay@cs.wisc.edu    StackDistCalc calc;
8810303Snilay@cs.wisc.edu};
8910303Snilay@cs.wisc.edu
909275Snilay@cs.wisc.edu
916493STushar.Krishna@amd.com#endif //__MEM_PROBES_STACK_DIST_HH__
927054Snate@binkert.org