dram-lowp.py revision 12268
19850Sandreas.hansson@arm.com# Copyright (c) 2017 ARM Limited
29850Sandreas.hansson@arm.com# All rights reserved.
39850Sandreas.hansson@arm.com#
49850Sandreas.hansson@arm.com# The license below extends only to copyright in the software and shall
59850Sandreas.hansson@arm.com# not be construed as granting a license to any other intellectual
69850Sandreas.hansson@arm.com# property including but not limited to intellectual property relating
79850Sandreas.hansson@arm.com# to a hardware implementation of the functionality of the software
89850Sandreas.hansson@arm.com# licensed hereunder.  You may use the software subject to the license
99850Sandreas.hansson@arm.com# terms below provided that you ensure that this notice is replicated
109850Sandreas.hansson@arm.com# unmodified and in its entirety in all distributions of the software,
119850Sandreas.hansson@arm.com# modified or unmodified, in source code or in binary form.
129850Sandreas.hansson@arm.com#
139850Sandreas.hansson@arm.com# Copyright (c) 2015 Jason Lowe-Power
149850Sandreas.hansson@arm.com# All rights reserved.
159850Sandreas.hansson@arm.com#
169850Sandreas.hansson@arm.com# Redistribution and use in source and binary forms, with or without
179850Sandreas.hansson@arm.com# modification, are permitted provided that the following conditions are
189850Sandreas.hansson@arm.com# met: redistributions of source code must retain the above copyright
199850Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer;
209850Sandreas.hansson@arm.com# redistributions in binary form must reproduce the above copyright
219850Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer in the
229850Sandreas.hansson@arm.com# documentation and/or other materials provided with the distribution;
239850Sandreas.hansson@arm.com# neither the name of the copyright holders nor the names of its
249850Sandreas.hansson@arm.com# contributors may be used to endorse or promote products derived from
259850Sandreas.hansson@arm.com# this software without specific prior written permission.
269850Sandreas.hansson@arm.com#
279850Sandreas.hansson@arm.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
289850Sandreas.hansson@arm.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
299850Sandreas.hansson@arm.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
309850Sandreas.hansson@arm.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
319850Sandreas.hansson@arm.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
329850Sandreas.hansson@arm.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
339850Sandreas.hansson@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
349850Sandreas.hansson@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
359850Sandreas.hansson@arm.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
369850Sandreas.hansson@arm.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
379850Sandreas.hansson@arm.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
389850Sandreas.hansson@arm.com#
399850Sandreas.hansson@arm.com# Authors: Radhika Jagtap
409850Sandreas.hansson@arm.com#          Jason Lowe-Power
419850Sandreas.hansson@arm.com#          Andreas Hansson
429850Sandreas.hansson@arm.com#
4312109SRekai.GonzalezAlberquilla@arm.com# A wrapper around configs/dram/low_power_sweep.py
4412104Snathanael.premillieu@arm.com
459850Sandreas.hansson@arm.com# For some reason, this is implicitly needed by run.py
469850Sandreas.hansson@arm.comroot = None
479850Sandreas.hansson@arm.com
489850Sandreas.hansson@arm.comimport m5
4913556Sgabeblack@google.com
5013556Sgabeblack@google.comdef run_test(root):
5113556Sgabeblack@google.com        # Called from tests/run.py
529920Syasuko.eckert@amd.com
5313556Sgabeblack@google.com        # Set the working directory in case we are executing from
5412104Snathanael.premillieu@arm.com        # outside gem5's source tree
559850Sandreas.hansson@arm.com        import os
5612109SRekai.GonzalezAlberquilla@arm.com        os.chdir(os.path.join(os.path.dirname(__file__), "../"))
5712109SRekai.GonzalezAlberquilla@arm.com
5812109SRekai.GonzalezAlberquilla@arm.com        # The path to this script is the only parameter. Delete it so
5912109SRekai.GonzalezAlberquilla@arm.com        # we can execute the script that we want to execute.
6012109SRekai.GonzalezAlberquilla@arm.com        import sys
6112109SRekai.GonzalezAlberquilla@arm.com        del sys.argv[1:]
6212109SRekai.GonzalezAlberquilla@arm.com
6312109SRekai.GonzalezAlberquilla@arm.com        # Add a specific page policy and specify the number of ranks
6412109SRekai.GonzalezAlberquilla@arm.com        sys.argv.append('-p%s' % page_policy)
659850Sandreas.hansson@arm.com        sys.argv.append('-r 2')
669850Sandreas.hansson@arm.com
679850Sandreas.hansson@arm.com        # Execute the script we are wrapping
68        execfile(srcpath('configs/dram/low_power_sweep.py'), globals())
69