summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
Diffstat (limited to 'src/python')
-rw-r--r--src/python/SConscript6
-rw-r--r--src/python/m5/main.py3
-rw-r--r--src/python/m5/objects/Root.py2
-rw-r--r--src/python/swig/debug.i19
4 files changed, 27 insertions, 3 deletions
diff --git a/src/python/SConscript b/src/python/SConscript
index 5c351c32a..be6248bab 100644
--- a/src/python/SConscript
+++ b/src/python/SConscript
@@ -98,11 +98,17 @@ pyzip_files.append('m5/defines.py')
pyzip_files.append('m5/info.py')
pyzip_files.append(join(env['ROOT'], 'util/pbs/jobfile.py'))
+env.Command(['swig/debug_wrap.cc', 'm5/internal/debug.py'],
+ 'swig/debug.i',
+ '$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} '
+ '-o ${TARGETS[0]} $SOURCES')
+
env.Command(['swig/main_wrap.cc', 'm5/internal/main.py'],
'swig/main.i',
'$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} '
'-o ${TARGETS[0]} $SOURCES')
+pyzip_dep_files.append('m5/internal/debug.py')
pyzip_dep_files.append('m5/internal/main.py')
# Action function to build the zip archive. Uses the PyZipFile module
diff --git a/src/python/m5/main.py b/src/python/m5/main.py
index 1e224c0cf..114c668a6 100644
--- a/src/python/m5/main.py
+++ b/src/python/m5/main.py
@@ -275,7 +275,8 @@ def main():
objects.Statistics.text_file = options.stats_file
# set debugging options
- objects.Debug.break_cycles = options.debug_break
+ for when in options.debug_break:
+ internal.debug.schedBreakCycle(int(when))
# set tracing options
objects.Trace.flags = options.trace_flags
diff --git a/src/python/m5/objects/Root.py b/src/python/m5/objects/Root.py
index 8e8d87f6d..b6123f192 100644
--- a/src/python/m5/objects/Root.py
+++ b/src/python/m5/objects/Root.py
@@ -5,7 +5,6 @@ from Serialize import Statreset
from Statistics import Statistics
from Trace import Trace
from ExeTrace import ExecutionTrace
-from Debug import Debug
class Root(SimObject):
type = 'Root'
@@ -22,4 +21,3 @@ class Root(SimObject):
trace = Trace()
exetrace = ExecutionTrace()
serialize = Serialize()
- debug = Debug()
diff --git a/src/python/swig/debug.i b/src/python/swig/debug.i
new file mode 100644
index 000000000..8da2974ca
--- /dev/null
+++ b/src/python/swig/debug.i
@@ -0,0 +1,19 @@
+%module debug
+
+%{
+// include these files when compiling debug_wrap.cc
+#include "sim/host.hh"
+%}
+
+%include "stdint.i"
+%include "sim/host.hh"
+
+%inline %{
+extern void schedBreakCycle(Tick when);
+%}
+
+%wrapper %{
+// fix up module name to reflect the fact that it's inside the m5 package
+#undef SWIG_name
+#define SWIG_name "m5.internal._debug"
+%}