CommMonitor.py revision 10615:cd8aae15f89a
112027Sjungma@eit.uni-kl.de# Copyright (c) 2012 ARM Limited 212027Sjungma@eit.uni-kl.de# All rights reserved. 312027Sjungma@eit.uni-kl.de# 412027Sjungma@eit.uni-kl.de# The license below extends only to copyright in the software and shall 512027Sjungma@eit.uni-kl.de# not be construed as granting a license to any other intellectual 612027Sjungma@eit.uni-kl.de# property including but not limited to intellectual property relating 712027Sjungma@eit.uni-kl.de# to a hardware implementation of the functionality of the software 812027Sjungma@eit.uni-kl.de# licensed hereunder. You may use the software subject to the license 912027Sjungma@eit.uni-kl.de# terms below provided that you ensure that this notice is replicated 1012027Sjungma@eit.uni-kl.de# unmodified and in its entirety in all distributions of the software, 1112027Sjungma@eit.uni-kl.de# modified or unmodified, in source code or in binary form. 1212027Sjungma@eit.uni-kl.de# 1312027Sjungma@eit.uni-kl.de# Redistribution and use in source and binary forms, with or without 1412027Sjungma@eit.uni-kl.de# modification, are permitted provided that the following conditions are 1512027Sjungma@eit.uni-kl.de# met: redistributions of source code must retain the above copyright 1612027Sjungma@eit.uni-kl.de# notice, this list of conditions and the following disclaimer; 1712027Sjungma@eit.uni-kl.de# redistributions in binary form must reproduce the above copyright 1812027Sjungma@eit.uni-kl.de# notice, this list of conditions and the following disclaimer in the 1912027Sjungma@eit.uni-kl.de# documentation and/or other materials provided with the distribution; 2012027Sjungma@eit.uni-kl.de# neither the name of the copyright holders nor the names of its 2112027Sjungma@eit.uni-kl.de# contributors may be used to endorse or promote products derived from 2212027Sjungma@eit.uni-kl.de# this software without specific prior written permission. 2312027Sjungma@eit.uni-kl.de# 2412027Sjungma@eit.uni-kl.de# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2512027Sjungma@eit.uni-kl.de# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2612027Sjungma@eit.uni-kl.de# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 2712027Sjungma@eit.uni-kl.de# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2812027Sjungma@eit.uni-kl.de# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2912027Sjungma@eit.uni-kl.de# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3012027Sjungma@eit.uni-kl.de# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3112027Sjungma@eit.uni-kl.de# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3212027Sjungma@eit.uni-kl.de# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3312027Sjungma@eit.uni-kl.de# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 3412027Sjungma@eit.uni-kl.de# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3512027Sjungma@eit.uni-kl.de# 3612027Sjungma@eit.uni-kl.de# Authors: Thomas Grass 3712027Sjungma@eit.uni-kl.de# Andreas Hansson 3812027Sjungma@eit.uni-kl.de 3912027Sjungma@eit.uni-kl.defrom m5.params import * 4012027Sjungma@eit.uni-kl.defrom m5.proxy import * 4112027Sjungma@eit.uni-kl.defrom MemObject import MemObject 4212027Sjungma@eit.uni-kl.defrom System import System 4312027Sjungma@eit.uni-kl.de 4412027Sjungma@eit.uni-kl.de# The communication monitor will most typically be used in combination 4512027Sjungma@eit.uni-kl.de# with periodic dumping and resetting of stats using schedStatEvent 4612027Sjungma@eit.uni-kl.declass CommMonitor(MemObject): 4712027Sjungma@eit.uni-kl.de type = 'CommMonitor' 4812027Sjungma@eit.uni-kl.de cxx_header = "mem/comm_monitor.hh" 4912027Sjungma@eit.uni-kl.de 5012027Sjungma@eit.uni-kl.de system = Param.System(Parent.any, "System that the monitor belongs to.") 5112027Sjungma@eit.uni-kl.de 5212027Sjungma@eit.uni-kl.de # one port in each direction 5312027Sjungma@eit.uni-kl.de master = MasterPort("Master port") 5412027Sjungma@eit.uni-kl.de slave = SlavePort("Slave port") 5512027Sjungma@eit.uni-kl.de 5612027Sjungma@eit.uni-kl.de # Boolean to enable or disable the trace. Writes to an a file named based on 5712027Sjungma@eit.uni-kl.de # SimObject hierarchy. 5812027Sjungma@eit.uni-kl.de trace_enable = Param.Bool(False, "Enable trace capture") 5912027Sjungma@eit.uni-kl.de 6012027Sjungma@eit.uni-kl.de # Boolean to compress the trace or not. 6112027Sjungma@eit.uni-kl.de trace_compress = Param.Bool(True, "Enable trace compression") 6212027Sjungma@eit.uni-kl.de 6312027Sjungma@eit.uni-kl.de # packet trace output file, disabled by default 6412027Sjungma@eit.uni-kl.de trace_file = Param.String("", "Packet trace output file") 6512027Sjungma@eit.uni-kl.de 6612027Sjungma@eit.uni-kl.de # control the sample period window length of this monitor 6712027Sjungma@eit.uni-kl.de sample_period = Param.Clock("1ms", "Sample period for histograms") 6812027Sjungma@eit.uni-kl.de 6912027Sjungma@eit.uni-kl.de # for each histogram, set the number of bins and enable the user 7012027Sjungma@eit.uni-kl.de # to disable the measurement, reads and writes use the same 7112027Sjungma@eit.uni-kl.de # parameters 7212027Sjungma@eit.uni-kl.de 7312027Sjungma@eit.uni-kl.de # histogram of burst length of packets (not using sample period) 7412027Sjungma@eit.uni-kl.de burst_length_bins = Param.Unsigned('20', "# bins in burst length " \ 7512027Sjungma@eit.uni-kl.de "histograms") 7612027Sjungma@eit.uni-kl.de disable_burst_length_hists = Param.Bool(False, "Disable burst length " \ 7712027Sjungma@eit.uni-kl.de "histograms") 7812027Sjungma@eit.uni-kl.de 7912027Sjungma@eit.uni-kl.de # bandwidth per sample period 8012027Sjungma@eit.uni-kl.de bandwidth_bins = Param.Unsigned('20', "# bins in bandwidth histograms") 8112027Sjungma@eit.uni-kl.de disable_bandwidth_hists = Param.Bool(False, "Disable bandwidth histograms") 8212027Sjungma@eit.uni-kl.de 8312027Sjungma@eit.uni-kl.de # latency from request to response (not using sample period) 8412027Sjungma@eit.uni-kl.de latency_bins = Param.Unsigned('20', "# bins in latency histograms") 8512027Sjungma@eit.uni-kl.de disable_latency_hists = Param.Bool(False, "Disable latency histograms") 8612027Sjungma@eit.uni-kl.de 8712027Sjungma@eit.uni-kl.de # inter transaction time (ITT) distributions in uniformly sized 8812027Sjungma@eit.uni-kl.de # bins up to the maximum, independently for read-to-read, 8912027Sjungma@eit.uni-kl.de # write-to-write and the combined request-to-request that does not 9012027Sjungma@eit.uni-kl.de # separate read and write requests 9112027Sjungma@eit.uni-kl.de itt_bins = Param.Unsigned('20', "# bins in ITT distributions") 9212027Sjungma@eit.uni-kl.de itt_max_bin = Param.Latency('100ns', "Max bin of ITT distributions") 9312027Sjungma@eit.uni-kl.de disable_itt_dists = Param.Bool(False, "Disable ITT distributions") 9412027Sjungma@eit.uni-kl.de 9512027Sjungma@eit.uni-kl.de # outstanding requests (that did not yet get a response) per 9612027Sjungma@eit.uni-kl.de # sample period 9712027Sjungma@eit.uni-kl.de outstanding_bins = Param.Unsigned('20', "# bins in outstanding " \ 9812027Sjungma@eit.uni-kl.de "requests histograms") 9912027Sjungma@eit.uni-kl.de disable_outstanding_hists = Param.Bool(False, "Disable outstanding " \ 10012027Sjungma@eit.uni-kl.de "requests histograms") 10112027Sjungma@eit.uni-kl.de 10212027Sjungma@eit.uni-kl.de # transactions (requests) observed per sample period 10312027Sjungma@eit.uni-kl.de transaction_bins = Param.Unsigned('20', "# bins in transaction " \ 10412027Sjungma@eit.uni-kl.de "count histograms") 10512027Sjungma@eit.uni-kl.de disable_transaction_hists = Param.Bool(False, "Disable transaction count " \ 10612027Sjungma@eit.uni-kl.de "histograms") 10712027Sjungma@eit.uni-kl.de 10812027Sjungma@eit.uni-kl.de # address distributions (heatmaps) with associated address masks 10912027Sjungma@eit.uni-kl.de # to selectively only look at certain bits of the address 11012027Sjungma@eit.uni-kl.de read_addr_mask = Param.Addr(MaxAddr, "Address mask for read address") 11112027Sjungma@eit.uni-kl.de write_addr_mask = Param.Addr(MaxAddr, "Address mask for write address") 11212027Sjungma@eit.uni-kl.de disable_addr_dists = Param.Bool(True, "Disable address distributions") 11312027Sjungma@eit.uni-kl.de 11412027Sjungma@eit.uni-kl.de # optional stack distance calculator 11512027Sjungma@eit.uni-kl.de stack_dist_calc = Param.StackDistCalc(NULL, "Stack distance calculator") 11612027Sjungma@eit.uni-kl.de