MemChecker.py revision 10612
110612SMarco.Elver@ARM.com# Copyright (c) 2014 ARM Limited 210612SMarco.Elver@ARM.com# All rights reserved. 310612SMarco.Elver@ARM.com# 410612SMarco.Elver@ARM.com# The license below extends only to copyright in the software and shall 510612SMarco.Elver@ARM.com# not be construed as granting a license to any other intellectual 610612SMarco.Elver@ARM.com# property including but not limited to intellectual property relating 710612SMarco.Elver@ARM.com# to a hardware implementation of the functionality of the software 810612SMarco.Elver@ARM.com# licensed hereunder. You may use the software subject to the license 910612SMarco.Elver@ARM.com# terms below provided that you ensure that this notice is replicated 1010612SMarco.Elver@ARM.com# unmodified and in its entirety in all distributions of the software, 1110612SMarco.Elver@ARM.com# modified or unmodified, in source code or in binary form. 1210612SMarco.Elver@ARM.com# 1310612SMarco.Elver@ARM.com# Redistribution and use in source and binary forms, with or without 1410612SMarco.Elver@ARM.com# modification, are permitted provided that the following conditions are 1510612SMarco.Elver@ARM.com# met: redistributions of source code must retain the above copyright 1610612SMarco.Elver@ARM.com# notice, this list of conditions and the following disclaimer; 1710612SMarco.Elver@ARM.com# redistributions in binary form must reproduce the above copyright 1810612SMarco.Elver@ARM.com# notice, this list of conditions and the following disclaimer in the 1910612SMarco.Elver@ARM.com# documentation and/or other materials provided with the distribution; 2010612SMarco.Elver@ARM.com# neither the name of the copyright holders nor the names of its 2110612SMarco.Elver@ARM.com# contributors may be used to endorse or promote products derived from 2210612SMarco.Elver@ARM.com# this software without specific prior written permission. 2310612SMarco.Elver@ARM.com# 2410612SMarco.Elver@ARM.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2510612SMarco.Elver@ARM.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2610612SMarco.Elver@ARM.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 2710612SMarco.Elver@ARM.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2810612SMarco.Elver@ARM.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2910612SMarco.Elver@ARM.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3010612SMarco.Elver@ARM.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3110612SMarco.Elver@ARM.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3210612SMarco.Elver@ARM.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3310612SMarco.Elver@ARM.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 3410612SMarco.Elver@ARM.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3510612SMarco.Elver@ARM.com# 3610612SMarco.Elver@ARM.com# Authors: Marco Elver 3710612SMarco.Elver@ARM.com 3810612SMarco.Elver@ARM.comfrom MemObject import MemObject 3910612SMarco.Elver@ARM.comfrom m5.SimObject import SimObject 4010612SMarco.Elver@ARM.comfrom m5.params import * 4110612SMarco.Elver@ARM.comfrom m5.proxy import * 4210612SMarco.Elver@ARM.com 4310612SMarco.Elver@ARM.comclass MemChecker(SimObject): 4410612SMarco.Elver@ARM.com type = 'MemChecker' 4510612SMarco.Elver@ARM.com cxx_header = "mem/mem_checker.hh" 4610612SMarco.Elver@ARM.com 4710612SMarco.Elver@ARM.comclass MemCheckerMonitor(MemObject): 4810612SMarco.Elver@ARM.com type = 'MemCheckerMonitor' 4910612SMarco.Elver@ARM.com cxx_header = "mem/mem_checker_monitor.hh" 5010612SMarco.Elver@ARM.com 5110612SMarco.Elver@ARM.com # one port in each direction 5210612SMarco.Elver@ARM.com master = MasterPort("Master port") 5310612SMarco.Elver@ARM.com slave = SlavePort("Slave port") 5410612SMarco.Elver@ARM.com cpu_side = SlavePort("Alias for slave") 5510612SMarco.Elver@ARM.com mem_side = MasterPort("Alias for master") 5610612SMarco.Elver@ARM.com warn_only = Param.Bool(False, "Warn about violations only") 5710612SMarco.Elver@ARM.com memchecker = Param.MemChecker("Instance shared with other monitors") 5810612SMarco.Elver@ARM.com 59