1# Copyright (c) 2019 ARM Limited
2# All rights reserved
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder.  You may use the software subject to the license
9# terms below provided that you ensure that this notice is replicated
10# unmodified and in its entirety in all distributions of the software,
11# modified or unmodified, in source code or in binary form.
12#
13# Redistribution and use in source and binary forms, with or without
14# modification, are permitted provided that the following conditions are
15# met: redistributions of source code must retain the above copyright
16# notice, this list of conditions and the following disclaimer;
17# redistributions in binary form must reproduce the above copyright
18# notice, this list of conditions and the following disclaimer in the
19# documentation and/or other materials provided with the distribution;
20# neither the name of the copyright holders nor the names of its
21# contributors may be used to endorse or promote products derived from
22# this software without specific prior written permission.
23#
24# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35#
36# Authors: Nikos Nikoleris
37
38'''
39Arm FS simulation tests
40'''
41
42from os.path import join as joinpath
43
44from testlib import *
45
46arm_fs_quick_tests = [
47    'realview-simple-atomic',
48    'realview-simple-atomic-dual',
49    'realview-simple-atomic-checkpoint',
50    'realview-simple-timing',
51    'realview-simple-timing-dual',
52    'realview-switcheroo-atomic',
53    'realview-switcheroo-timing',
54]
55
56arm_fs_long_tests = [
57    'realview-o3',
58    'realview-o3-checker',
59    'realview-o3-dual',
60    'realview-minor',
61    'realview-minor-dual',
62    'realview-switcheroo-noncaching-timing',
63    'realview-switcheroo-o3',
64    'realview-switcheroo-full',
65    'realview64-simple-atomic',
66    'realview64-simple-atomic-checkpoint',
67    'realview64-simple-atomic-dual',
68    'realview64-simple-timing',
69    'realview64-simple-timing-dual',
70    'realview64-o3',
71    'realview64-o3-checker',
72    'realview64-o3-dual',
73    'realview64-minor',
74    'realview64-minor-dual',
75    'realview64-switcheroo-atomic',
76    'realview64-switcheroo-timing',
77    'realview64-switcheroo-o3',
78    'realview64-switcheroo-full',
79    'realview-simple-timing-ruby',
80    'realview-simple-timing-dual-ruby',
81    'realview64-simple-timing-ruby',
82    'realview64-simple-timing-dual-ruby',
83]
84
85tarball = 'aarch-system-2014-10.tar.bz2'
86url = "http://gem5.org/dist/current/arm/" + tarball
87path = os.path.dirname(os.path.abspath(__file__))
88arm_fs_binaries = DownloadedArchive(url, path, tarball)
89
90for name in arm_fs_quick_tests:
91    args = [ joinpath(config.base_dir, 'tests', 'configs', name + '.py') ]
92    gem5_verify_config(
93        name=name,
94        verifiers=(), # Add basic stat verifiers
95        config=joinpath(path, 'run.py'),
96        config_args=args,
97        valid_isas=(constants.arm_tag,),
98        length=constants.quick_tag,
99        fixtures=(arm_fs_binaries,)
100    )
101
102for name in arm_fs_long_tests:
103    args = [ joinpath(config.base_dir, 'tests', 'configs', name + '.py') ]
104    gem5_verify_config(
105        name=name,
106        verifiers=(), # TODO: Add basic stat verifiers
107        config=joinpath(path, 'run.py'),
108        config_args=args,
109        valid_isas=(constants.arm_tag,),
110        length=constants.long_tag,
111        fixtures=(arm_fs_binaries,)
112    )
113