113658Sgabeblack@google.com# Copyright 2019 Google, Inc. 213658Sgabeblack@google.com# 313658Sgabeblack@google.com# Redistribution and use in source and binary forms, with or without 413658Sgabeblack@google.com# modification, are permitted provided that the following conditions are 513658Sgabeblack@google.com# met: redistributions of source code must retain the above copyright 613658Sgabeblack@google.com# notice, this list of conditions and the following disclaimer; 713658Sgabeblack@google.com# redistributions in binary form must reproduce the above copyright 813658Sgabeblack@google.com# notice, this list of conditions and the following disclaimer in the 913658Sgabeblack@google.com# documentation and/or other materials provided with the distribution; 1013658Sgabeblack@google.com# neither the name of the copyright holders nor the names of its 1113658Sgabeblack@google.com# contributors may be used to endorse or promote products derived from 1213658Sgabeblack@google.com# this software without specific prior written permission. 1313658Sgabeblack@google.com# 1413658Sgabeblack@google.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1513658Sgabeblack@google.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1613658Sgabeblack@google.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1713658Sgabeblack@google.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1813658Sgabeblack@google.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1913658Sgabeblack@google.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2013658Sgabeblack@google.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2113658Sgabeblack@google.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2213658Sgabeblack@google.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2313658Sgabeblack@google.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2413658Sgabeblack@google.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2513658Sgabeblack@google.com# 2613658Sgabeblack@google.com# Authors: Gabe Black 2713658Sgabeblack@google.com 2813658Sgabeblack@google.comfrom __future__ import print_function 2913658Sgabeblack@google.com 3013658Sgabeblack@google.comimport sys 3113658Sgabeblack@google.com 3213658Sgabeblack@google.comimport m5 3313658Sgabeblack@google.comfrom m5.objects import SystemC_Kernel, Root 3413658Sgabeblack@google.com 3513658Sgabeblack@google.com# pylint:disable=unused-variable 3613658Sgabeblack@google.com 3713658Sgabeblack@google.comkernel = SystemC_Kernel() 3813658Sgabeblack@google.comroot = Root(full_system=True, systemc_kernel=kernel) 3913658Sgabeblack@google.com 4013727Sgabeblack@google.comm5.systemc.sc_main(*sys.argv) 4113658Sgabeblack@google.com 4213658Sgabeblack@google.comm5.instantiate(None) 4313658Sgabeblack@google.com 4413658Sgabeblack@google.comcause = m5.simulate(m5.MaxTick).getCause() 4513658Sgabeblack@google.com 4613727Sgabeblack@google.comresult = m5.systemc.sc_main_result() 4713658Sgabeblack@google.comif result.code != 0: 4813658Sgabeblack@google.com m5.util.panic('sc_main return code was %d.' % result.code) 49