112886Sspwilson2@wisc.edu# Copyright (c) 2017 Mark D. Hill and David A. Wood
212886Sspwilson2@wisc.edu# All rights reserved.
312886Sspwilson2@wisc.edu#
412886Sspwilson2@wisc.edu# Redistribution and use in source and binary forms, with or without
512886Sspwilson2@wisc.edu# modification, are permitted provided that the following conditions are
612886Sspwilson2@wisc.edu# met: redistributions of source code must retain the above copyright
712886Sspwilson2@wisc.edu# notice, this list of conditions and the following disclaimer;
812886Sspwilson2@wisc.edu# redistributions in binary form must reproduce the above copyright
912886Sspwilson2@wisc.edu# notice, this list of conditions and the following disclaimer in the
1012886Sspwilson2@wisc.edu# documentation and/or other materials provided with the distribution;
1112886Sspwilson2@wisc.edu# neither the name of the copyright holders nor the names of its
1212886Sspwilson2@wisc.edu# contributors may be used to endorse or promote products derived from
1312886Sspwilson2@wisc.edu# this software without specific prior written permission.
1412886Sspwilson2@wisc.edu#
1512886Sspwilson2@wisc.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1612886Sspwilson2@wisc.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1712886Sspwilson2@wisc.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1812886Sspwilson2@wisc.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1912886Sspwilson2@wisc.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2012886Sspwilson2@wisc.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2112886Sspwilson2@wisc.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2212886Sspwilson2@wisc.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2312886Sspwilson2@wisc.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2412886Sspwilson2@wisc.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2512886Sspwilson2@wisc.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2612886Sspwilson2@wisc.edu#
2712886Sspwilson2@wisc.edu# Authors: Sean Wilson
2812886Sspwilson2@wisc.edu
2912886Sspwilson2@wisc.edu'''
3012886Sspwilson2@wisc.eduTest file for the util m5 exit assembly instruction.
3112886Sspwilson2@wisc.edu'''
3212886Sspwilson2@wisc.eduimport re
3312886Sspwilson2@wisc.eduimport os
3412886Sspwilson2@wisc.edufrom testlib import *
3512886Sspwilson2@wisc.edu
3612886Sspwilson2@wisc.edum5_exit_regex = re.compile(
3712886Sspwilson2@wisc.edur'Exiting @ tick \d* because m5_exit instruction encountered'
3812886Sspwilson2@wisc.edu)
3912886Sspwilson2@wisc.edu
4014142Snikos.nikoleris@arm.compath = joinpath(absdirpath(__file__), '..',
4114142Snikos.nikoleris@arm.com                'test-progs', 'hello', 'bin', 'x86', 'linux')
4214142Snikos.nikoleris@arm.comfilename = 'm5_exit'
4314142Snikos.nikoleris@arm.comurl = 'http://gem5.org/dist/current/test-progs/m5-exit/bin/x86/linux/m5_exit'
4414142Snikos.nikoleris@arm.comtest_program = DownloadedProgram(url, path, filename)
4512886Sspwilson2@wisc.edu
4612886Sspwilson2@wisc.edua = verifier.MatchRegex(m5_exit_regex)
4712886Sspwilson2@wisc.edugem5_verify_config(
4812886Sspwilson2@wisc.edu    name='m5_exit_test',
4912886Sspwilson2@wisc.edu    verifiers=[a],
5012886Sspwilson2@wisc.edu    fixtures=(test_program,),
5112886Sspwilson2@wisc.edu    config=os.path.join(config.base_dir, 'configs', 'example','se.py'),
5214142Snikos.nikoleris@arm.com    config_args=['--cmd', joinpath(test_program.path, filename)],
5312886Sspwilson2@wisc.edu    valid_isas=('X86',)
5412886Sspwilson2@wisc.edu)
55