diff options
Diffstat (limited to 'src/build/debug/simics-debug-framework.py')
-rw-r--r-- | src/build/debug/simics-debug-framework.py | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/build/debug/simics-debug-framework.py b/src/build/debug/simics-debug-framework.py index 3176f8cba..fd90806bb 100644 --- a/src/build/debug/simics-debug-framework.py +++ b/src/build/debug/simics-debug-framework.py @@ -516,7 +516,7 @@ def magic_instruction_callback(user_arg, cpu, arg): # Stop the simulation, much like a hard-coded breakpoint SIM_break_simulation( "Simulation stopped. (hap 7007)" ) - if arg == 7008: + if arg == 7008: # MAGIC_RANDOM cpu.r3 = random.randint(1, 0xffffffffffffffffL) if arg == 7009: # MAGIC_MEMORYLEAK_FUNCTION @@ -525,6 +525,10 @@ def magic_instruction_callback(user_arg, cpu, arg): if arg == 7011: #MAGIC_SIMICS_CHECK cpu.r3 = 1 print "TimeManager::cv_isSimicsRunning = true" + # Clear the dump flag in case it was still set from a previous boot + # (this call happens only 1 time and it is very early in the boot) + if( os.environ.has_key('HB_DUMP_COMPLETE') ): + del os.environ['HB_DUMP_COMPLETE'] if arg == 7012: # MAGIC_LOAD_PAYLOAD #For P9 the Payload load is much faster due to PNOR @@ -537,6 +541,17 @@ def magic_instruction_callback(user_arg, cpu, arg): #SIM_run_alone( run_command, cmd ) print "MAGIC_LOAD_PAYLOAD not implemented\n"; + if arg == 7014: # MAGIC_HB_DUMP + # Collect a hostboot dump + # (no args) + + # Make sure we only do 1 dump even though every thread will TI + if( not os.environ.has_key('HB_DUMP_COMPLETE') ): + print "Generating Hostboot Dump for TI" + os.environ['HB_DUMP_COMPLETE']="1" + cmd1 = "hb-Dump quiet" + SIM_run_alone(run_command, cmd1 ) + if arg == 7018: # MAGIC_BREAK_ON_ERROR # Stop the simulation if an env var is set if( os.environ.has_key('HB_BREAK_ON_ERROR') ): @@ -573,6 +588,7 @@ def magic_instruction_callback(user_arg, cpu, arg): percent_s = "%s" dateCommand = "shell \" date +'%s > TRACE REGS: %d %d' \""%(percent_s,first_num,second_num) SIM_run_alone(run_command, dateCommand ) + if arg == 7022: # MAGIC_SET_LOG_LEVEL if( not os.environ.has_key('ENABLE_HB_SIMICS_LOGS') ): #print("Skipping Hostboot Simics Logging because ENABLE_HB_SIMICS_LOGS is not set") @@ -745,7 +761,9 @@ def magic_instruction_callback(user_arg, cpu, arg): #file = open("hb_trace_debug.dat", "a") #file.write("%s\n" % (saveCommand)) #file.close() - + if arg == 7056: # MAGIC_GCOV_DUMP_NOW + print('Gcov dumping chain from 0x%x' % (cpu.r3,)) + SIM_run_alone(run_command, 'hb-GcovModuleUnload "address=%d"' % (cpu.r3,)) # Continuous trace: Clear these files. rc = os.system( "rm -f hbTracMERG" ) @@ -769,4 +787,3 @@ SIM_hap_add_callback_range( "Core_Magic_Instruction", magic_instruction_callback # Run the registration automatically whenever this script is loaded. register_hb_debug_framework_tools() - |