__init__.py revision 11802
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 296654Snate@binkert.org# Import useful subpackages of M5, but *only* when run as an m5 306654Snate@binkert.org# script. This is mostly to keep backward compatibility with existing 316654Snate@binkert.org# scripts while allowing new SCons code to operate properly. 322655Sstever@eecs.umich.edu 334762Snate@binkert.orgtry: 348222Snate@binkert.org # Try to import something that's generated by swig 3511802Sandreas.sandberg@arm.com import _m5.core 368222Snate@binkert.org 378222Snate@binkert.org # Try to grab something from it in case demandimport is being used 3811802Sandreas.sandberg@arm.com _m5.core.curTick 3911802Sandreas.sandberg@arm.com in_gem5 = True 404762Snate@binkert.orgexcept ImportError: 4111802Sandreas.sandberg@arm.com # The import failed, we're being called from the build system 4211802Sandreas.sandberg@arm.com in_gem5 = False 434762Snate@binkert.org 4411802Sandreas.sandberg@arm.comif in_gem5: 456654Snate@binkert.org import SimObject 466654Snate@binkert.org import core 476654Snate@binkert.org import objects 486654Snate@binkert.org import params 496654Snate@binkert.org import stats 506654Snate@binkert.org import util 515798Snate@binkert.org 524852Snate@binkert.org from event import * 538234Snate@binkert.org from main import main 544852Snate@binkert.org from simulate import * 559342SAndreas.Sandberg@arm.com 56