__init__.py (9876:b47db5ac7d1c) __init__.py (11802:be62996c95d1)
1# Copyright (c) 2005 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 18 unchanged lines hidden (view full) ---

27# Authors: Nathan Binkert
28
29# Import useful subpackages of M5, but *only* when run as an m5
30# script. This is mostly to keep backward compatibility with existing
31# scripts while allowing new SCons code to operate properly.
32
33try:
34 # Try to import something that's generated by swig
1# Copyright (c) 2005 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 18 unchanged lines hidden (view full) ---

27# Authors: Nathan Binkert
28
29# Import useful subpackages of M5, but *only* when run as an m5
30# script. This is mostly to keep backward compatibility with existing
31# scripts while allowing new SCons code to operate properly.
32
33try:
34 # Try to import something that's generated by swig
35 import internal.core
35 import _m5.core
36
37 # Try to grab something from it in case demandimport is being used
36
37 # Try to grab something from it in case demandimport is being used
38 internal.core.curTick
38 _m5.core.curTick
39 in_gem5 = True
39except ImportError:
40except ImportError:
40 # The import failed
41 internal = None
41 # The import failed, we're being called from the build system
42 in_gem5 = False
42
43
43if internal:
44if in_gem5:
44 import SimObject
45 import core
46 import objects
47 import params
48 import stats
49 import util
50
51 from event import *
52 from main import main
53 from simulate import *
54
45 import SimObject
46 import core
47 import objects
48 import params
49 import stats
50 import util
51
52 from event import *
53 from main import main
54 from simulate import *
55