diff options
author | Doug Gilbert <dgilbert@us.ibm.com> | 2012-01-25 11:52:29 -0600 |
---|---|---|
committer | Douglas R. Gilbert <dgilbert@us.ibm.com> | 2012-02-03 13:24:03 -0600 |
commit | 73a45c77486bc82475c8d24739d1212ab8d9cfad (patch) | |
tree | 4aa321357ef984a696a68c2c9e75144927a01bdb /src/build | |
parent | 672ca9b23baf4923d74152fec4872b5207f96de8 (diff) | |
download | talos-hostboot-73a45c77486bc82475c8d24739d1212ab8d9cfad.tar.gz talos-hostboot-73a45c77486bc82475c8d24739d1212ab8d9cfad.zip |
istep breakpoint support
Change-Id: I592c617963f810209a9ab76345a8c568d14af62c
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/629
Tested-by: Jenkins Server
Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
Diffstat (limited to 'src/build')
-rwxr-xr-x | src/build/simics/hb-simdebug.py | 38 | ||||
-rwxr-xr-x | src/build/vpo/hb-istep | 61 |
2 files changed, 94 insertions, 5 deletions
diff --git a/src/build/simics/hb-simdebug.py b/src/build/simics/hb-simdebug.py index 4e5dbb2ee..af1a425c3 100755 --- a/src/build/simics/hb-simdebug.py +++ b/src/build/simics/hb-simdebug.py @@ -92,6 +92,7 @@ def hb_istep_usage(): print " sN..M - execute IStep N through M" print " <name1>..<name2> - execute named isteps name1 through name2" print " debug - enable debugging messages" + print " resume - Resume istep execution from break point" return None ## declare GLOBAL g_SeqNum var, & a routine to manipulate it. @@ -310,7 +311,35 @@ def runIStep( istep, substep, inList ): print "-----------------------------------------------------------------" return - + +def resume_istep(): + + bump_g_SeqNum() + + print "resume from breakpoint" + + byte0 = 0x80 + g_SeqNum ## gobit + seqnum + command = 0x01 + cmd = "0x%2.2x%2.2x_000000000000"%(byte0, command) + sendCommand( cmd ) + result = getSyncStatus() + + ## if result is -1 we have a timeout + if ( result == -1 ) : + print "-----------------------------------------------------------------" + else : + taskStatus = ( ( result & 0x00ff000000000000 ) >> 48 ) + + print "-----------------------------------------------------------------" + if ( taskStatus != 0 ) : + print "resume Istep FAILED, task status is %d"%( taskStatus ) + else: + print "resume Istep was successful" + print "-----------------------------------------------------------------" + + return + + ## run command = "sN" def sCommand( inList, scommand ) : @@ -355,6 +384,7 @@ def find_in_inList( inList, substepname) : ## sN ## sN..M ## <substepname1>..<substepname2> +## resume ## declare GLOBAL g_IStep_DEBUG & SPLess memory mapped regs g_IStep_DEBUG = 0 @@ -425,7 +455,11 @@ def istepHB( symsFile, str_arg1 ): if ( str_arg1 == "list" ): ## dump command list print_istep_list( inList ) return - + + if ( str_arg1 == "resume" ): ## resume from break point + resume_istep() + return None + ## check to see if we have an 's' command (string starts with 's' and a number) if ( re.match("^s+[0-9].*", str_arg1 ) ): ## run "s" command diff --git a/src/build/vpo/hb-istep b/src/build/vpo/hb-istep index 2cae8e617..ba4630a14 100755 --- a/src/build/vpo/hb-istep +++ b/src/build/vpo/hb-istep @@ -67,6 +67,7 @@ sub print_istep_list; sub find_in_inlist; sub parse_command; sub setMode; +sub resume_istep; #------------------------------------------------------------------------------ # Constants @@ -86,6 +87,7 @@ my $opt_command = ""; my $opt_list = 0; my $opt_help = 0; my $opt_cmdfile = 0; ## batchmode, later +my $opt_resume = 0; ## resume istep from break point my @inList; $inList[10][10] = (); @@ -135,7 +137,8 @@ GetOptions( "help" => \$opt_help, "normalmode" => \$opt_normalmode, "list" => \$opt_list, "command=s" => \$opt_command, - "cmdfile" => \$opt_cmdfile, + "cmdfile" => \$opt_cmdfile, + "resume" => \$opt_resume, "debug" => \$opt_debug, ); @@ -188,6 +191,15 @@ if ( $opt_list ) } ## +## Process resume +## +if ( $opt_resume ) +{ + resume_istep(); + ## exit; ?? +} + +## ## process --Istep Mode command ## IStepModeStr = "cpu0_0_0_3->scratch=0x4057b007_4057b007" ## NormalModeStr = "cpu0_0_0_3->scratch=0x700b7504_700b7504" @@ -212,7 +224,8 @@ if ( $opt_command ne "" ) if ( $opt_debug ) { print STDOUT "== process command \"$opt_command\" \n"; } parse_command( $opt_command ); } - + + #============================================================================== # SUBROUTINES @@ -230,6 +243,7 @@ sub printUsage() print STDOUT " [--command sN..M] (run isteps N through M)\n" ; print STDOUT " [--command <foo>] (run named istep \"foo\")\n" ; print STDOUT " [--command <foo>..<bar>] (run named isteps \"foo\" through \"bar\")\n" ; + print STDOUT " [--resume] (resume an istep that is at a break point)\n" ; print STDOUT "\n" ; @@ -562,4 +576,45 @@ sub setMode( ) } } -__END__
\ No newline at end of file +sub resume_istep() +{ + my $byte0; + my $command; + my $cmd; + my $result; + + $g_SeqNum++; ## bump + + printf STDOUT "resume istep\n"; + + $byte0 = 0x80 + $g_SeqNum; ## gobit + seqnum + $command = 0x01; + $cmd = sprintf( "0x%2.2x%2.2x000000000000", $byte0, $command ); + VBU_Cacheline::CLwrite( $commandreg, $cmd ); + + $result = getSyncStatus(); + + ## if result is -1 we have a timeout + if ( $result == -1 ) + { + print "-----------------------------------------------------------------\n"; + } + else + { + my $taskStatus = ( ( $result & 0x00ff000000000000 ) >> 48 ); + + print STDOUT "-----------------------------------------------------------------\n"; + if ( $taskStatus != 0 ) + { + # This probably means istep was not at a breakpoint. + printf STDOUT "resume istep FAILED, task status is %d\n", $taskStatus ; + } + else + { + printf STDOUT "resume istep returned success\n" ; + } + print STDOUT "-----------------------------------------------------------------\n"; + } +} + +__END__ |