summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2005-01-18 15:28:34 -0500
committerNathan Binkert <binkertn@umich.edu>2005-01-18 15:28:34 -0500
commitd728d44b55541f45b0b1a5d33650c20d260da37a (patch)
treeac4ec4e68d279b36f90fa807eaa63ece6db49d13
parentcae9210dce7d325c9612a7484d749ebb1666401c (diff)
downloadgem5-d728d44b55541f45b0b1a5d33650c20d260da37a.tar.xz
More configuration fixes
sim/pyconfig/m5config.py: put panic, AddToPath, and Import here so they're always available. --HG-- extra : convert_revision : 104dba5ccac0d64479b4109d477b5192c4b07a6e
-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)