summaryrefslogtreecommitdiffstats
path: root/src/build/debug/simics-debug-framework.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/build/debug/simics-debug-framework.py')
-rwxr-xr-xsrc/build/debug/simics-debug-framework.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/build/debug/simics-debug-framework.py b/src/build/debug/simics-debug-framework.py
index 44fb49c51..4f647dd3e 100755
--- a/src/build/debug/simics-debug-framework.py
+++ b/src/build/debug/simics-debug-framework.py
@@ -570,6 +570,20 @@ def magic_instruction_callback(user_arg, cpu, arg):
if( os.environ.has_key('HB_BREAK_ON_ERROR') ):
SIM_break_simulation( "Stopping sim on HB error. (hap 7018)" )
+ if arg == 7019: # MAGIC_GET_SBE_TRACES
+ # Collect SBE traces out to a file
+ proc_num = cpu.r4
+ rc = cpu.r5
+ # generate the traces
+ cmd1 = "sbe-trace %d"%(proc_num)
+ print "cmd1", cmd1
+ # copy the file somewhere safe
+ cmd2 = "shell \"echo '==HB Collecting Traces (iar=%X,rc=%X,sbe=%d)==' >> sbetrace.hb.txt; cat sbe_%d_tracMERG >> sbetrace.hb.txt\""%(cpu.iar,rc,proc_num,proc_num)
+ print "cmd2", cmd2
+
+ saveCommand = "%s; %s"%(cmd1,cmd2)
+ SIM_run_alone(run_command, saveCommand )
+
if arg == 7055: # MAGIC_CONTINUOUS_TRACE
hb_tracBinaryBuffer = cpu.r4
hb_tracBinaryBufferSz = cpu.r5
@@ -660,6 +674,9 @@ rc = os.system( "rm -f hbTracBINARY3" )
rc = os.system( "rm -f tracMERG" )
rc = os.system( "rm -f tracBINARY" )
+# SBE traces: Clear these files.
+rc = os.system( "rm -f sbetrace.hb.txt" )
+
# Register the magic instruction hap handler (a callback).
SIM_hap_add_callback_range( "Core_Magic_Instruction", magic_instruction_callback, None, 7000, 7999 )
OpenPOWER on IntegriCloud