summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMark Wenning <wenning@us.ibm.com>2012-06-19 21:24:30 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-06-25 15:01:41 -0500
commit206300b53cd5653c03747c5f661615b353da8c22 (patch)
treee67d8d5419d933c04a1c1910441068dcc89ad5a4 /src
parentd3751578876a7a37d29d6492c2c02a2039547f2d (diff)
downloadblackbird-hostboot-206300b53cd5653c03747c5f661615b353da8c22.tar.gz
blackbird-hostboot-206300b53cd5653c03747c5f661615b353da8c22.zip
hb-Istep workaround for simics
RTC: 43953 Change-Id: I8e13c6186a39786382e70be4276a67b9ec8f92e9 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1238 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/build/debug/Hostboot/Istep.pm81
-rwxr-xr-xsrc/build/debug/simics-debug-framework.py10
2 files changed, 63 insertions, 28 deletions
diff --git a/src/build/debug/Hostboot/Istep.pm b/src/build/debug/Hostboot/Istep.pm
index e014e26fd..8801162aa 100755
--- a/src/build/debug/Hostboot/Istep.pm
+++ b/src/build/debug/Hostboot/Istep.pm
@@ -2,11 +2,11 @@
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
-# $Source: src/build/vpo/hb-istep $
+# $Source: src/build/debug/Hostboot/Istep.pm $
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011 - 2012
+# COPYRIGHT International Business Machines Corp. 2011-2012
#
# p1
#
@@ -102,17 +102,7 @@ my $opt_istepmode = 0;
my $command = "";
-
-## initialize inList to "undefined"
my @inList;
-$inList[MAX_ISTEPS][MAX_SUBSTEPS] = ();
-for( my $i = 0; $i < MAX_ISTEPS; $i++)
-{
- for(my $j = 0; $j < MAX_SUBSTEPS; $j++)
- {
- undef( $inList[$i][$j] );
- }
-}
## initialize the sequence number - 6 bit field, { 0 - 63 }
my $g_SeqNum = int(rand(64));
@@ -127,7 +117,6 @@ my $THREAD = "0";
## @todo make this an enviroment var?
## NOTE: this is the # cycles used for simics, it is multiplied by 100
## in vpo-debug-framework.pl
-## my $hbDefaultCycles = 50000;
my $hbDefaultCycles = 5000000;
my $hbCount = $ENV{'HB_COUNT'};
@@ -137,15 +126,12 @@ if ( !defined( $hbCount ) || ( $hbCount eq "" ) )
$hbCount = 0xffffffff; ## effectively infinite ...
}
+my $IstepModeReg = "";
+my $ShutDownFlag = "";
+my $ShutDownSts = "";
-## fetch all the symbols we need.
-my $IstepModeReg = getSymbol( "SPLESS::g_SPLess_IStepMode_Reg" );
-my $ShutDownFlag = getSymbol( "CpuManager::cv_shutdown_requested" );
-my $ShutDownSts = getSymbol( "CpuManager::cv_shutdown_status" );
-
-## @todo deprecated, fetch anyway for now
-my $CommandReg = getSymbol( "SPLESS::g_SPLess_Command_Reg" );
-my $StatusReg = getSymbol( "SPLESS::g_SPLess_Status_Reg" );
+my $CommandReg = "";
+my $StatusReg = "";
########################################################################
@@ -166,6 +152,27 @@ sub main
::userDisplay "Welcome to hb-Istep 3.3 .\n";
::userDisplay "Note that in simics, multiple options must be in quotes\n\n";
+
+ ## initialize the inList to undefined.
+ $inList[MAX_ISTEPS][MAX_SUBSTEPS] = ();
+ for( my $i = 0; $i < MAX_ISTEPS; $i++)
+ {
+ for(my $j = 0; $j < MAX_SUBSTEPS; $j++)
+ {
+ undef( $inList[$i][$j] );
+ }
+ }
+
+## fetch all the symbols we need.
+ $IstepModeReg = getSymbol( "SPLESS::g_SPLess_IStepMode_Reg" );
+ $ShutDownFlag = getSymbol( "CpuManager::cv_shutdown_requested" );
+ $ShutDownSts = getSymbol( "CpuManager::cv_shutdown_status" );
+
+## @todo deprecated, fetch anyway for now
+ $CommandReg = getSymbol( "SPLESS::g_SPLess_Command_Reg" );
+ $StatusReg = getSymbol( "SPLESS::g_SPLess_Status_Reg" );
+
+
## fetch the istep list
get_istep_list();
@@ -441,26 +448,41 @@ sub get_istep_list()
sub print_istep_list( )
{
my $hdrflag = 1;
+ my $col = 0;
- ::userDisplay " IStep Name\n";
- ::userDisplay "---------------------------------------------------\n";
+ ## ::userDisplay " IStep Name\n";
+ ##::userDisplay "---------------------------------------------------\n";
- for(my $i = 4; $i < MAX_ISTEPS; $i++)
+ for( my $i = 4; $i < MAX_ISTEPS; $i++)
{
- for(my $j = 0; $j < MAX_SUBSTEPS; $j++)
+ for( my $j = 0; $j < MAX_SUBSTEPS; $j++)
{
## print all substeps
if ( defined( $inList[$i][$j] ) )
{
if ( $hdrflag )
{
- ::userDisplay " -- IStep $i -- \n";
+ ::userDisplay " ----- IStep $i ----- \n";
$hdrflag = 0;
}
- ::userDisplay " $inList[$i][$j]\n" ;
+ ## will truncate after 40 chars, hopefully this will not be an issue
+ my $ss = sprintf( "%-40s", $inList[$i][$j] );
+ ::userDisplay "$ss" ;
+ $col ++ ;
+ if ( $col > 1 )
+ {
+ ::userDisplay "\n";
+ $col = 0;
+
+ }
}
} ## end for $j
+ if ( $col > 0 )
+ {
+ ::userDisplay "\n";
+ $col = 0;
+ }
$hdrflag=1;
} ## end for $i
}
@@ -1012,6 +1034,11 @@ sub clear_trace( )
}
}
+ # A Perl module must end with a true value or else it is considered not to
+ # have loaded. By convention this value is usually 1 though it can be
+ # any true value. A module can end with false to indicate failure but
+ # this is rarely used and it would instead die() (exit with an error).
+ 1;
__END__
diff --git a/src/build/debug/simics-debug-framework.py b/src/build/debug/simics-debug-framework.py
index 27f074fe2..e1c81bcdc 100755
--- a/src/build/debug/simics-debug-framework.py
+++ b/src/build/debug/simics-debug-framework.py
@@ -175,8 +175,14 @@ class DebugFrameworkProcess:
cycles = int(match.group(1))
+ ## @todo mww SIM_continue is busted, try this...
if (not SIM_simics_is_running()):
- SIM_continue(cycles)
+ ## SIM_continue(cycles)
+ syscmd = "run-cycles %d"%(cycles)
+ ## print ">> %s"%(syscmd)
+ ( rc, out ) = quiet_run_command( syscmd, output_modes.regular )
+ if ( rc ):
+ print "simics ERROR running %s: %d "%( syscmd, rc )
def ready_for_instr(self,data):
self.sendMsg("data-response", "0" if SIM_simics_is_running() else "1")
@@ -222,6 +228,8 @@ class DebugFrameworkProcess:
runStr = "phys_mem.write 0x%x 0x%x 0x%x"%(addr, data, size)
( result, out ) = quiet_run_command( runStr, output_modes.regular )
## DEBUG print ">> %s : "%(runStr) + " 0x%16.16x"%(result) + " : " + out
+ if ( result ):
+ print "simics ERROR running %s: %d "%( syscmd, result )
# @fn run_hb_debug_framework
# @brief Wrapper function to execute a tool module.
OpenPOWER on IntegriCloud