memcheck.py revision 11720
12292SN/A# Copyright (c) 2016 ARM Limited
22329SN/A# All rights reserved.
32292SN/A#
42292SN/A# The license below extends only to copyright in the software and shall
52292SN/A# not be construed as granting a license to any other intellectual
62292SN/A# property including but not limited to intellectual property relating
72292SN/A# to a hardware implementation of the functionality of the software
82292SN/A# licensed hereunder.  You may use the software subject to the license
92292SN/A# terms below provided that you ensure that this notice is replicated
102292SN/A# unmodified and in its entirety in all distributions of the software,
112292SN/A# modified or unmodified, in source code or in binary form.
122292SN/A#
132292SN/A# Copyright (c) 2015 Jason Lowe-Power
142292SN/A# All rights reserved.
152292SN/A#
162292SN/A# Redistribution and use in source and binary forms, with or without
172292SN/A# modification, are permitted provided that the following conditions are
182292SN/A# met: redistributions of source code must retain the above copyright
192292SN/A# notice, this list of conditions and the following disclaimer;
202292SN/A# redistributions in binary form must reproduce the above copyright
212292SN/A# notice, this list of conditions and the following disclaimer in the
222292SN/A# documentation and/or other materials provided with the distribution;
232292SN/A# neither the name of the copyright holders nor the names of its
242292SN/A# contributors may be used to endorse or promote products derived from
252292SN/A# this software without specific prior written permission.
262292SN/A#
272689Sktlim@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
282689Sktlim@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
292689Sktlim@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
302292SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
312292SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
322292SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
332292SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
342292SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
352329SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
362292SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
372292SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
382292SN/A#
392329SN/A# Authors: Jason Lowe-Power
402292SN/A#          Andreas Hansson
412292SN/A
422292SN/Aimport m5
432669Sktlim@umich.edufrom m5.objects import *
442669Sktlim@umich.edu
452292SN/A# the traffic generator is only available if we have protobuf support,
462329SN/A# so potentially skip this test
472329SN/Arequire_sim_object("TrafficGen")
482292SN/A
492292SN/A# A wrapper around configs/example/memcheck.py
502329SN/A
512329SN/A# For some reason, this is implicitly needed by run.py
522329SN/Aroot = None
532329SN/A
542329SN/Adef run_test(root):
552329SN/A        # Called from tests/run.py
562329SN/A
572329SN/A        # Set the working directory in case we are executing from
582329SN/A        # outside gem5's source tree
592329SN/A        import os
602292SN/A        os.chdir(os.path.join(os.path.dirname(__file__), "../"))
612292SN/A
622292SN/A        # The path to this script is the only parameter. Delete it so
632292SN/A        # we can execute the script that we want to execute.
642292SN/A        import sys
652292SN/A        del sys.argv[1:]
662292SN/A
672292SN/A        # Add a specific max tick
682292SN/A        sys.argv.append('-m %d' % maxtick)
692292SN/A
702292SN/A        # Execute the script we are wrapping
712292SN/A        execfile(srcpath('configs/example/memcheck.py'), globals())
722292SN/A