summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
Diffstat (limited to 'sim')
-rw-r--r--sim/pyconfig/m5config.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/sim/pyconfig/m5config.py b/sim/pyconfig/m5config.py
index d7c0c6507..4e2a377b0 100644
--- a/sim/pyconfig/m5config.py
+++ b/sim/pyconfig/m5config.py
@@ -35,6 +35,19 @@ def defined(key):
def define(key, value = True):
env[key] = value
+def panic(*args, **kwargs):
+ sys.exit(*args, **kwargs)
+
+def AddToPath(path):
+ path = os.path.realpath(path)
+ if os.path.isdir(path):
+ sys.path.append(path)
+
+def Import(path):
+ AddToPath(os.path.dirname(path))
+ exec('from m5config import *')
+ mpy_exec(file(path, 'r'))
+
def issequence(value):
return isinstance(value, tuple) or isinstance(value, list)