CommMonitor.py revision 10615:cd8aae15f89a
1955SN/A# Copyright (c) 2012 ARM Limited
2955SN/A# All rights reserved.
31762SN/A#
4955SN/A# The license below extends only to copyright in the software and shall
5955SN/A# not be construed as granting a license to any other intellectual
6955SN/A# property including but not limited to intellectual property relating
7955SN/A# to a hardware implementation of the functionality of the software
8955SN/A# licensed hereunder.  You may use the software subject to the license
9955SN/A# terms below provided that you ensure that this notice is replicated
10955SN/A# unmodified and in its entirety in all distributions of the software,
11955SN/A# modified or unmodified, in source code or in binary form.
12955SN/A#
13955SN/A# Redistribution and use in source and binary forms, with or without
14955SN/A# modification, are permitted provided that the following conditions are
15955SN/A# met: redistributions of source code must retain the above copyright
16955SN/A# notice, this list of conditions and the following disclaimer;
17955SN/A# redistributions in binary form must reproduce the above copyright
18955SN/A# notice, this list of conditions and the following disclaimer in the
19955SN/A# documentation and/or other materials provided with the distribution;
20955SN/A# neither the name of the copyright holders nor the names of its
21955SN/A# contributors may be used to endorse or promote products derived from
22955SN/A# this software without specific prior written permission.
23955SN/A#
24955SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25955SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26955SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27955SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
282665Ssaidi@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
294762Snate@binkert.org# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30955SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
315522Snate@binkert.org# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
326143Snate@binkert.org# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
334762Snate@binkert.org# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
345522Snate@binkert.org# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35955SN/A#
365522Snate@binkert.org# Authors: Thomas Grass
37955SN/A#          Andreas Hansson
385522Snate@binkert.org
394202Sbinkertn@umich.edufrom m5.params import *
405742Snate@binkert.orgfrom m5.proxy import *
41955SN/Afrom MemObject import MemObject
424381Sbinkertn@umich.edufrom System import System
434381Sbinkertn@umich.edu
448334Snate@binkert.org# The communication monitor will most typically be used in combination
45955SN/A# with periodic dumping and resetting of stats using schedStatEvent
46955SN/Aclass CommMonitor(MemObject):
474202Sbinkertn@umich.edu    type = 'CommMonitor'
48955SN/A    cxx_header = "mem/comm_monitor.hh"
494382Sbinkertn@umich.edu
504382Sbinkertn@umich.edu    system = Param.System(Parent.any, "System that the monitor belongs to.")
514382Sbinkertn@umich.edu
526654Snate@binkert.org    # one port in each direction
535517Snate@binkert.org    master = MasterPort("Master port")
548614Sgblack@eecs.umich.edu    slave = SlavePort("Slave port")
557674Snate@binkert.org
566143Snate@binkert.org    # Boolean to enable or disable the trace. Writes to an a file named based on
576143Snate@binkert.org    # SimObject hierarchy.
586143Snate@binkert.org    trace_enable = Param.Bool(False, "Enable trace capture")
598233Snate@binkert.org
608233Snate@binkert.org    # Boolean to compress the trace or not.
618233Snate@binkert.org    trace_compress = Param.Bool(True, "Enable trace compression")
628233Snate@binkert.org
638233Snate@binkert.org    # packet trace output file, disabled by default
648334Snate@binkert.org    trace_file = Param.String("", "Packet trace output file")
658334Snate@binkert.org
668233Snate@binkert.org    # control the sample period window length of this monitor
678233Snate@binkert.org    sample_period = Param.Clock("1ms", "Sample period for histograms")
688233Snate@binkert.org
698233Snate@binkert.org    # for each histogram, set the number of bins and enable the user
708233Snate@binkert.org    # to disable the measurement, reads and writes use the same
718233Snate@binkert.org    # parameters
726143Snate@binkert.org
738233Snate@binkert.org    # histogram of burst length of packets (not using sample period)
748233Snate@binkert.org    burst_length_bins = Param.Unsigned('20', "# bins in burst length " \
758233Snate@binkert.org                                           "histograms")
766143Snate@binkert.org    disable_burst_length_hists = Param.Bool(False, "Disable burst length " \
776143Snate@binkert.org                                                "histograms")
786143Snate@binkert.org
796143Snate@binkert.org    # bandwidth per sample period
808233Snate@binkert.org    bandwidth_bins = Param.Unsigned('20', "# bins in bandwidth histograms")
818233Snate@binkert.org    disable_bandwidth_hists = Param.Bool(False, "Disable bandwidth histograms")
828233Snate@binkert.org
836143Snate@binkert.org    # latency from request to response (not using sample period)
848233Snate@binkert.org    latency_bins = Param.Unsigned('20', "# bins in latency histograms")
858233Snate@binkert.org    disable_latency_hists = Param.Bool(False, "Disable latency histograms")
868233Snate@binkert.org
878233Snate@binkert.org    # inter transaction time (ITT) distributions in uniformly sized
886143Snate@binkert.org    # bins up to the maximum, independently for read-to-read,
896143Snate@binkert.org    # write-to-write and the combined request-to-request that does not
906143Snate@binkert.org    # separate read and write requests
914762Snate@binkert.org    itt_bins = Param.Unsigned('20', "# bins in ITT distributions")
926143Snate@binkert.org    itt_max_bin = Param.Latency('100ns', "Max bin of ITT distributions")
938233Snate@binkert.org    disable_itt_dists = Param.Bool(False, "Disable ITT distributions")
948233Snate@binkert.org
958233Snate@binkert.org    # outstanding requests (that did not yet get a response) per
968233Snate@binkert.org    # sample period
978233Snate@binkert.org    outstanding_bins = Param.Unsigned('20', "# bins in outstanding " \
986143Snate@binkert.org                                          "requests histograms")
998233Snate@binkert.org    disable_outstanding_hists = Param.Bool(False, "Disable outstanding " \
1008233Snate@binkert.org                                               "requests histograms")
1018233Snate@binkert.org
1028233Snate@binkert.org    # transactions (requests) observed per sample period
1036143Snate@binkert.org    transaction_bins = Param.Unsigned('20', "# bins in transaction " \
1046143Snate@binkert.org                                          "count histograms")
1056143Snate@binkert.org    disable_transaction_hists = Param.Bool(False, "Disable transaction count " \
1066143Snate@binkert.org                                               "histograms")
1076143Snate@binkert.org
1086143Snate@binkert.org    # address distributions (heatmaps) with associated address masks
1096143Snate@binkert.org    # to selectively only look at certain bits of the address
1106143Snate@binkert.org    read_addr_mask = Param.Addr(MaxAddr, "Address mask for read address")
1116143Snate@binkert.org    write_addr_mask = Param.Addr(MaxAddr, "Address mask for write address")
1127065Snate@binkert.org    disable_addr_dists = Param.Bool(True, "Disable address distributions")
1136143Snate@binkert.org
1148233Snate@binkert.org    # optional stack distance calculator
1158233Snate@binkert.org    stack_dist_calc = Param.StackDistCalc(NULL, "Stack distance calculator")
1168233Snate@binkert.org