mem/cache/cache_builder.cc
+ python/swig/debug_wrap.cc
python/swig/main_wrap.cc
sim/builder.cc
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
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
from Statistics import Statistics
from Trace import Trace
from ExeTrace import ExecutionTrace
-from Debug import Debug
class Root(SimObject):
type = 'Root'
trace = Trace()
exetrace = ExecutionTrace()
serialize = Serialize()
- debug = Debug()
--- /dev/null
+%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"
+%}
return "debug break";
}
-//
-// Parameter context for global debug options
-//
-class DebugContext : public ParamContext
-{
- public:
- DebugContext(const string &_iniSection)
- : ParamContext(_iniSection) {}
- void checkParams();
-};
-
-DebugContext debugParams("debug");
-
-VectorParam<Tick> break_cycles(&debugParams, "break_cycles",
- "cycle(s) to create breakpoint events");
-
-void
-DebugContext::checkParams()
-{
- if (break_cycles.isValid()) {
- vector<Tick> &cycles = break_cycles;
-
- vector<Tick>::iterator i = cycles.begin();
- vector<Tick>::iterator end = cycles.end();
-
- for (; i < end; ++i)
- new DebugBreakEvent(&mainEventQueue, *i);
- }
-}
-
//
// handy function to schedule DebugBreakEvent on main event queue
// (callable from debugger)
//
-void sched_break_cycle(Tick when)
+void
+schedBreakCycle(Tick when)
{
new DebugBreakEvent(&mainEventQueue, when);
}
-void eventq_dump()
+void
+eventqDump()
{
mainEventQueue.dump();
}
extern "C" {
void init_main();
+void init_debug();
}
int
Py_Initialize();
PySys_SetArgv(argc, argv);
- // initialize SWIG 'm5.internal.main' module
+ // initialize SWIG modules
init_main();
+ init_debug();
PyRun_SimpleString("import m5.main");
PyRun_SimpleString("m5.main.main()");