11736SN/A# Copyright (c) 2005 The Regents of The University of Michigan
21736SN/A# All rights reserved.
31736SN/A#
41736SN/A# Redistribution and use in source and binary forms, with or without
51736SN/A# modification, are permitted provided that the following conditions are
61736SN/A# met: redistributions of source code must retain the above copyright
71736SN/A# notice, this list of conditions and the following disclaimer;
81736SN/A# redistributions in binary form must reproduce the above copyright
91736SN/A# notice, this list of conditions and the following disclaimer in the
101736SN/A# documentation and/or other materials provided with the distribution;
111736SN/A# neither the name of the copyright holders nor the names of its
121736SN/A# contributors may be used to endorse or promote products derived from
131736SN/A# this software without specific prior written permission.
141736SN/A#
151736SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
161736SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
171736SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
181736SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
191736SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
201736SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
211736SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
221736SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
231736SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
241736SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
251736SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
262665Ssaidi@eecs.umich.edu#
272665Ssaidi@eecs.umich.edu# Authors: Nathan Binkert
281736SN/A
2913714Sandreas.sandberg@arm.comfrom __future__ import print_function
3013714Sandreas.sandberg@arm.comfrom __future__ import absolute_import
3113714Sandreas.sandberg@arm.com
326654Snate@binkert.org# Import useful subpackages of M5, but *only* when run as an m5
336654Snate@binkert.org# script.  This is mostly to keep backward compatibility with existing
346654Snate@binkert.org# scripts while allowing new SCons code to operate properly.
352655Sstever@eecs.umich.edu
364762Snate@binkert.orgtry:
3711991Sandreas.sandberg@arm.com    # Try to import a native module
3811802Sandreas.sandberg@arm.com    import _m5.core
398222Snate@binkert.org
408222Snate@binkert.org    # Try to grab something from it in case demandimport is being used
4111802Sandreas.sandberg@arm.com    _m5.core.curTick
4211802Sandreas.sandberg@arm.com    in_gem5 = True
434762Snate@binkert.orgexcept ImportError:
4411802Sandreas.sandberg@arm.com    # The import failed, we're being called from the build system
4511802Sandreas.sandberg@arm.com    in_gem5 = False
464762Snate@binkert.org
4711802Sandreas.sandberg@arm.comif in_gem5:
4813714Sandreas.sandberg@arm.com    from . import SimObject
4913714Sandreas.sandberg@arm.com    from . import core
5013724Sgabeblack@google.com    from . import defines
5113714Sandreas.sandberg@arm.com    from . import objects
5213714Sandreas.sandberg@arm.com    from . import params
5313714Sandreas.sandberg@arm.com    from . import stats
5413724Sgabeblack@google.com    if defines.buildEnv['USE_SYSTEMC']:
5513724Sgabeblack@google.com        from . import systemc
5613724Sgabeblack@google.com        from . import tlm
5713714Sandreas.sandberg@arm.com    from . import util
585798Snate@binkert.org
5913714Sandreas.sandberg@arm.com    from .event import *
6013714Sandreas.sandberg@arm.com    from .main import main
6113714Sandreas.sandberg@arm.com    from .simulate import *
629342SAndreas.Sandberg@arm.com
63