memcheck.py revision 11475
111458Sandreas.hansson@arm.com# Copyright (c) 2016 ARM Limited 211458Sandreas.hansson@arm.com# All rights reserved. 311458Sandreas.hansson@arm.com# 411458Sandreas.hansson@arm.com# The license below extends only to copyright in the software and shall 511458Sandreas.hansson@arm.com# not be construed as granting a license to any other intellectual 611458Sandreas.hansson@arm.com# property including but not limited to intellectual property relating 711458Sandreas.hansson@arm.com# to a hardware implementation of the functionality of the software 811458Sandreas.hansson@arm.com# licensed hereunder. You may use the software subject to the license 911458Sandreas.hansson@arm.com# terms below provided that you ensure that this notice is replicated 1011458Sandreas.hansson@arm.com# unmodified and in its entirety in all distributions of the software, 1111458Sandreas.hansson@arm.com# modified or unmodified, in source code or in binary form. 1211458Sandreas.hansson@arm.com# 1311457SN/A# Copyright (c) 2015 Jason Lowe-Power 1411457SN/A# All rights reserved. 1511457SN/A# 1611457SN/A# Redistribution and use in source and binary forms, with or without 1711457SN/A# modification, are permitted provided that the following conditions are 1811457SN/A# met: redistributions of source code must retain the above copyright 1911457SN/A# notice, this list of conditions and the following disclaimer; 2011457SN/A# redistributions in binary form must reproduce the above copyright 2111457SN/A# notice, this list of conditions and the following disclaimer in the 2211457SN/A# documentation and/or other materials provided with the distribution; 2311457SN/A# neither the name of the copyright holders nor the names of its 2411457SN/A# contributors may be used to endorse or promote products derived from 2511457SN/A# this software without specific prior written permission. 2611457SN/A# 2711457SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2811457SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2911457SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 3011457SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 3111457SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 3211457SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3311457SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3411457SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3511457SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3611457SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 3711457SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3811457SN/A# 3911457SN/A# Authors: Jason Lowe-Power 4011458Sandreas.hansson@arm.com# Andreas Hansson 4111105SN/A 4211458Sandreas.hansson@arm.com# A wrapper around configs/example/memcheck.py 4311105SN/A 4411105SN/A# For some reason, this is implicitly needed by run.py 4511105SN/Aroot = None 4611105SN/A 4711105SN/Adef run_test(root): 4811105SN/A # Called from tests/run.py 4911105SN/A 5011475Sandreas.sandberg@arm.com # Set the working directory in case we are executing from 5111475Sandreas.sandberg@arm.com # outside gem5's source tree 5211475Sandreas.sandberg@arm.com import os 5311475Sandreas.sandberg@arm.com os.chdir(os.path.join(os.path.dirname(__file__), "../")) 5411475Sandreas.sandberg@arm.com 5511458Sandreas.hansson@arm.com # The path to this script is the only parameter. Delete it so 5611458Sandreas.hansson@arm.com # we can execute the script that we want to execute. 5711458Sandreas.hansson@arm.com import sys 5811458Sandreas.hansson@arm.com del sys.argv[1:] 5911458Sandreas.hansson@arm.com 6011458Sandreas.hansson@arm.com # Add a specific max tick 6111458Sandreas.hansson@arm.com sys.argv.append('-m %d' % maxtick) 6211458Sandreas.hansson@arm.com 6311105SN/A # Execute the script we are wrapping 6411475Sandreas.sandberg@arm.com execfile(srcpath('configs/example/memcheck.py'), globals()) 65