111803Srjthakur@google.com# Copyright (c) 2016 Google Inc.
211803Srjthakur@google.com# All rights reserved.
311803Srjthakur@google.com#
411803Srjthakur@google.com# The license below extends only to copyright in the software and
511803Srjthakur@google.com# shall not be construed as granting a license to any other
611803Srjthakur@google.com# intellectual property including but not limited to intellectual
711803Srjthakur@google.com# property relating to a hardware implementation of the
811803Srjthakur@google.com# functionality of the software licensed hereunder.  You may use the
911803Srjthakur@google.com# software subject to the license terms below provided that you
1011803Srjthakur@google.com# ensure that this notice is replicated unmodified and in its
1111803Srjthakur@google.com# entirety in all distributions of the software, modified or
1211803Srjthakur@google.com# unmodified, in source code or in binary form.
1311803Srjthakur@google.com#
1411803Srjthakur@google.com# Redistribution and use in source and binary forms, with or without
1511803Srjthakur@google.com# modification, are permitted provided that the following conditions are
1611803Srjthakur@google.com# met: redistributions of source code must retain the above copyright
1711803Srjthakur@google.com# notice, this list of conditions and the following disclaimer;
1811803Srjthakur@google.com# redistributions in binary form must reproduce the above copyright
1911803Srjthakur@google.com# notice, this list of conditions and the following disclaimer in the
2011803Srjthakur@google.com# documentation and/or other materials provided with the distribution;
2111803Srjthakur@google.com# neither the name of the copyright holders nor the names of its
2211803Srjthakur@google.com# contributors may be used to endorse or promote products derived from
2311803Srjthakur@google.com# this software without specific prior written permission.
2411803Srjthakur@google.com#
2511803Srjthakur@google.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2611803Srjthakur@google.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2711803Srjthakur@google.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2811803Srjthakur@google.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2911803Srjthakur@google.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3011803Srjthakur@google.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3111803Srjthakur@google.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3211803Srjthakur@google.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3311803Srjthakur@google.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3411803Srjthakur@google.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3511803Srjthakur@google.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3611803Srjthakur@google.com#
3711803Srjthakur@google.com# Authors: Rahul Thakur
3811803Srjthakur@google.com
3911803Srjthakur@google.comfrom m5.params import *
4011803Srjthakur@google.comfrom m5.proxy import *
4113665Sandreas.sandberg@arm.com
4213665Sandreas.sandberg@arm.comfrom m5.objects.BaseMemProbe import BaseMemProbe
4311803Srjthakur@google.com
4411803Srjthakur@google.comclass MemFootprintProbe(BaseMemProbe):
4511803Srjthakur@google.com    type = "MemFootprintProbe"
4611803Srjthakur@google.com    cxx_header = "mem/probes/mem_footprint.hh"
4711803Srjthakur@google.com    system = Param.System(Parent.any,
4811803Srjthakur@google.com                          "System pointer to get cache line and mem size")
4911803Srjthakur@google.com    page_size = Param.Unsigned(4096, "Page size for page-level footprint")
50