diff options
-rwxr-xr-x | src/build/debug/vpo-debug-framework.pl | 34 | ||||
-rw-r--r-- | src/build/vpo/Setup_Env | 57 | ||||
-rw-r--r--[-rwxr-xr-x] | src/build/vpo/VBU_Cacheline.pm | 65 | ||||
-rw-r--r-- | src/build/vpo/do_sprint | 93 | ||||
-rw-r--r--[-rwxr-xr-x] | src/build/vpo/hb-istep | 157 | ||||
-rw-r--r--[-rwxr-xr-x] | src/build/vpo/hb-virtdebug.pl | 26 |
6 files changed, 269 insertions, 163 deletions
diff --git a/src/build/debug/vpo-debug-framework.pl b/src/build/debug/vpo-debug-framework.pl index 4c51c6938..057e847b1 100755 --- a/src/build/debug/vpo-debug-framework.pl +++ b/src/build/debug/vpo-debug-framework.pl @@ -55,7 +55,8 @@ my %optionInfo = ( "directory instead of using this option."], "--out-path=<path>" => ["The path to the directory where the output will be saved."], "--debug" => ["Enable debug tracing."], - "--mute" => ["Shut up the 'Data saved ...' message"], + "--mute" => ["Don't output the 'Data saved ...' message"], + "--no-save-states" => ["Don't save thread states..."], "-k#" => ["The cage to act on."], "-n#" => ["The node to act on."], "-s#" => ["The slot to act on."], @@ -78,11 +79,21 @@ my $cfgMan = 0; my $toolHelp = 0; my $debug = 0; my $mute = 0; +my $nosavestates = 0; my @ecmdOpt = ("-c3"); my @threadState = (); my $l2Flushed = 0; my $fh; -my $vbuToolDir = "/gsa/ausgsa/projects/h/hostboot/vbutools/latest"; + +# Use HB_VBUTOOLS env if specified +my $vbuToolDir = $ENV{'HB_VBUTOOLS'}; +if (defined ($vbuToolDir)) +{ + unless ($vbuToolDir ne "") + { + $vbuToolDir = "/gsa/ausgsa/projects/h/hostboot/vbutools/latest"; + } +} my $imgPath = ""; my $hbDir = $ENV{'HB_IMGDIR'}; @@ -105,6 +116,7 @@ if ($self) "out-path:s" => \$outPath, "debug" => \$debug, "mute" => \$mute, + "no-save-states" => \$nosavestates, "help" => \$cfgHelp, "toolhelp" => \$toolHelp, "man" => \$cfgMan, @@ -113,6 +125,7 @@ if ($self) "s=i" => \&processEcmdOpts, "p=i" => \&processEcmdOpts, "c=i" => \&processEcmdOpts) || pod2usage(-verbose => 0); + pod2usage(-verbose => 1) if ($cfgHelp && $self); pod2usage(-verbose => 2) if ($cfgMan && $self); pod2usage(-verbose => 0) if (($tool eq "") && $self); @@ -132,6 +145,7 @@ else "out-path:s" => \$outPath, "debug" => \$debug, "mute" => \$mute, + "no-save-states" => \$nosavestates, "help" => \$cfgHelp, "man" => \$cfgMan, "k=i" => \&processEcmdOpts, @@ -173,14 +187,20 @@ if ($debug) } # Save original thread states -saveThreadStates(); +if (!$nosavestates) +{ + saveThreadStates(); +} # Parse tool options and call module. parseToolOpts($toolOptions); callToolModule($tool); # Restore thread states -restoreThreadStates(); +if (!$nosavestates) +{ + restoreThreadStates(); +} if (!$mute) { @@ -380,7 +400,7 @@ sub stopInstructions my $thread = shift; #Stopping all threads - my $command = "$vbuToolDir/proc_thread_control.x86 @ecmdOpt -stop -t$thread $flag"; + my $command = "$vbuToolDir/proc_thread_control_wrap.x86 @ecmdOpt -stop -t$thread $flag"; if ($debug) { @@ -396,7 +416,7 @@ sub startInstructions my $thread = shift; #Starting all threads - my $command = "$vbuToolDir/proc_thread_control.x86 @ecmdOpt -start -t$thread $flag"; + my $command = "$vbuToolDir/proc_thread_control_wrap.x86 @ecmdOpt -start -t$thread $flag"; if ($debug) { @@ -428,7 +448,7 @@ sub queryThreadState { my $thread = shift; - my $command = "$vbuToolDir/proc_thread_control.x86 @ecmdOpt -query -t$thread"; + my $command = "$vbuToolDir/proc_thread_control_wrap.x86 @ecmdOpt -query -t$thread"; my $result = `$command`; if ($debug) diff --git a/src/build/vpo/Setup_Env b/src/build/vpo/Setup_Env index 8cfd9af7a..8227c83d0 100644 --- a/src/build/vpo/Setup_Env +++ b/src/build/vpo/Setup_Env @@ -1,11 +1,16 @@ ################################################################################ # -# Setup intialization source script for HostBoot Sprint Release VPO/VBU model testing with cronus tools +# Setup intialization source script for HostBoot Sprint Release VPO/VBU model +# testing with cronus tools # # # Version 1.0 Copy from Jim's on 03/21/2012, tested on VBU & VPO # Version 1.1 04-16-2012 Update to run with sprint 11 image # Sync with Jim's version. +# Version 1.2 05-09-2012 Pick-up Jim's latest changes as of 05-09-2012 +# Update default Cronus version to newer level +# Update default HB_TOOLS level +# Increase simclock cycles to 5000000 per loop # # ################################################################################ @@ -48,13 +53,13 @@ Setup_MyEnv() { # Default Sprint release - sprint=hb0406a_1214.810 + sprint=hb0419a_1216.810 # Initialize HostBoot environment/cronus/tools - note new naming convention - export AUTOVBU_CRONUS_SIM=rel.20120409 + export AUTOVBU_CRONUS_SIM=rel.20120507 export GLOBAL_DEBUG=8.VW.Vc.dG.F3.0I.E8.V - export HB_TOOLS=$AUTOVBU_HBTOOLS_BASEDIR/rel.04162012 + export HB_TOOLS=$AUTOVBU_HBTOOLS_BASEDIR/rel.20120509 # Select default model -- choose either VBU or VPO versions @@ -70,7 +75,7 @@ Setup_MyEnv() { # Default sprint test case settings export AUTOVBU_CORE=-c3 - export AUTOVBU_SIMCLOCKS=2000000 + export AUTOVBU_SIMCLOCKS=5000000 export AUTOVBU_INITIAL_CHKPT=after_8megzero export AUTOVBU_LOOPS=1200 export AUTOVBU_PRINTK_LINES=50 @@ -218,15 +223,41 @@ Setup_MyDynamic() { # Set other defaults based upon MODEL case "$VPO_MODEL$VBU_MODEL" in - p1_e8062_wafer_nomem_c1000_opt_4) + p1_e8062_wafer_nomem_c1000_opt_4|m_2_e) export AUTOVBU_ECMD_VER=${AUTOVBU_ECMD_VER-p8s1} export AWAN_SCRIPT=${AWAN_SCRIPT-run_script_star4b} export AWAN_CONFIG=${AWAN_CONFIG-star4b} + export DEFAULT_LEVEL=prev ;; - m_1_c|m_2_a|m_2_e|p1_e8056_c1000_cen1_cen054_unopt_2_gfw|p1_e8062_c1000_cen1_cen061_unopt_1) + m_1_c|p1_e8056_c1000_cen1_cen054_unopt_2_gfw) export AUTOVBU_ECMD_VER=${AUTOVBU_ECMD_VER-cronusflex} export AWAN_SCRIPT=${AWAN_SCRIPT-run_script_star8b_flex} export AWAN_CONFIG=${AWAN_CONFIG-star8b} + export DEFAULT_LEVEL=prev + ;; + m_2_a|p1_e8062_c1000_cen1_cen061_unopt_1) + export AUTOVBU_ECMD_VER=${AUTOVBU_ECMD_VER-cronusflex} + export AWAN_SCRIPT=${AWAN_SCRIPT- run_script_star8b_flex} + export AWAN_CONFIG=${AWAN_CONFIG-star8b} + export DEFAULT_LEVEL=prev + ;; + p1_e8056*|p1_e8059*|p1_e8062*) + export AUTOVBU_ECMD_VER=${AUTOVBU_ECMD_VER-p8s1} + export AWAN_SCRIPT=${AWAN_SCRIPT-run_script_star8b} + export AWAN_CONFIG=${AWAN_CONFIG-star8b} + export DEFAULT_LEVEL=prev + ;; + s1_e8024_wafer_nomem_dc_opt_6) + export AUTOVBU_ECMD_VER=${AUTOVBU_ECMD_VER-p8s1} + export AWAN_SCRIPT=${AWAN_SCRIPT-run_script_star8b} + export AWAN_CONFIG=${AWAN_CONFIG-star8b} + unset DEFAULT_LEVEL + ;; + s1_e8024_wafer_nomem*) + export AUTOVBU_ECMD_VER=${AUTOVBU_ECMD_VER-p8s1} + export AWAN_SCRIPT=${AWAN_SCRIPT-run_script_star4b} + export AWAN_CONFIG=${AWAN_CONFIG-star4b} + unset DEFAULT_LEVEL ;; *) export AUTOVBU_ECMD_VER=${AUTOVBU_ECMD_VER-p8s1} @@ -244,12 +275,12 @@ Setup_MyDynamic() { fi # Adjust PATH -- we want our tools at the beginning of the path, release tools at the end - echo $PATH | grep "$HB_RELDIR" >/dev/null 2>&1 if [ $? -ne 0 ]; then PATH=$PATH:$HB_RELDIR fi + # Needed for hb-dump/hb-Trace/etc... to find fsp-trace echo $PATH | grep "$HB_TOOLS" >/dev/null 2>&1 if [ $? -ne 0 ]; then PATH=$HB_TOOLS:$PATH @@ -397,14 +428,8 @@ Setup_MyHBImage() { set -x siminit ${AUTOVBU_INITIAL_CHKPT-after_8megzero} -quiet || return 1 - - /afs/awd/projects/eclipz/lab/p8/gsiexe/p8_load_l3 -f ${HB_IMGDIR}/hbicore${use_test}.bin -b ${AUTOVBU_CORE--c3} || return 1 - /afs/awd/projects/eclipz/lab/p8/gsiexe/p8_load_l3 -f ${HB_IMGDIR}/vbu_targeting.bin \ - -o $vbu_targeting_addr -b ${AUTOVBU_CORE--c3} || return 1 - /afs/awd/projects/eclipz/lab/p8/gsiexe/p8_load_l3 -f ${HB_IMGDIR}/hbicore${use_test}_extended.bin \ - -o 0x500690 -b ${AUTOVBU_CORE--c3} || return 1 - /afs/awd/projects/eclipz/lab/p8/gsiexe/p8_load_l3 -f ${HB_IMGDIR}/pnor.toc \ - -o 0x500000 -b ${AUTOVBU_CORE--c3} || return 1 + $HB_VBUTOOLS/p8_load_l3 -l ${DEFAULT_LEVEL-rel} -f ${HB_IMGDIR}/hbicore${use_test}.bin -b ${AUTOVBU_CORE--c3} || return 1 + $HB_VBUTOOLS/p8_load_l3 -l ${DEFAULT_LEVEL-rel} -f ${HB_IMGDIR}/vbu${use_test}.pnor -o 0x400000 -b ${AUTOVBU_CORE--c3} || return 1 set +x fi diff --git a/src/build/vpo/VBU_Cacheline.pm b/src/build/vpo/VBU_Cacheline.pm index b44a0a7ea..d063fea4e 100755..100644 --- a/src/build/vpo/VBU_Cacheline.pm +++ b/src/build/vpo/VBU_Cacheline.pm @@ -76,9 +76,7 @@ my $curDir = getcwd(); my $CLfile = "$curDir/istepmodereg.dma"; my $CORE = "-c3"; -## my $SIM_CLOCKS = "4000000"; -## my $SIM_CLOCKS = "2000000"; -my $SIM_CLOCKS = "3000000"; +my $SIM_CLOCKS = "5000000"; ############################################# ## Internal Globals @@ -105,19 +103,23 @@ my $FLUSHCMD = "$vbuToolsDir/proc_l2_flush_wrap.x86 $CORE -quiet"; my $FLUSHQUERY = "$vbuToolsDir/p8_check_l3"; my $RUNCLKSCMD = "simclock"; -## @todo -## NOTE: need to be able to specify thread (-t ) and core (-c ), they -## should not be hardwired -## my $QUERYCMD = "$vbuToolsDir/proc_thread_control.x86 -query $CORE -t0"; -## my $STOPCMD = "$vbuToolsDir/proc_thread_control.x86 -stop $CORE -tall"; -## my $STARTCMD = "$vbuToolsDir/proc_thread_control.x86 -start $CORE -tall"; -my $RESETCMD = "$vbuToolsDir/proc_thread_control.x86 -sreset_auto $CORE"; - -## Jim McGuire's older versions. -my $QUERYCMD = "/gsa/pokgsa/home/m/c/mcguirej/public/auto/rel/P8bin/p8_ins_query"; -my $STOPCMD = "/gsa/pokgsa/home/m/c/mcguirej/public/auto/rel/P8bin/p8_ins_stop"; -my $STARTCMD = "/gsa/pokgsa/home/m/c/mcguirej/public/auto/rel/P8bin/p8_ins_start"; - +# Start/Stop/Query tool commands +# Note: +# ----- +# Query command output strings: +# Single thread (-t0,1,..) "Running" or "Quiesced" +# All threads (-tall) A formatted table +# +# TODO: +# Needs to resolve the error when using "start -tall". After running a while, +# start -tall may lock up with this error: +# "proc_thread_control: Thread Start failed: RAS Status Run bit is not on" +# Temporary workaround is using only one thread as shown below. +# Lance Karm is still investigating. +my $QUERYCMD = "$vbuToolsDir/proc_thread_control_wrap.x86 -query $CORE -t0"; +my $STARTCMD = "$vbuToolsDir/proc_thread_control_wrap.x86 -start $CORE -t0"; +my $STOPCMD = "$vbuToolsDir/proc_thread_control_wrap.x86 -stop $CORE -t0"; +my $RESETCMD = "$vbuToolsDir/proc_thread_control_wrap.x86 -sreset $CORE"; ## #============================================================================== @@ -256,24 +258,16 @@ sub P8_Ins_Start() { my $cmd = "$STARTCMD"; - if ( P8_Ins_Query() eq "STOPPED" ) - { - if ( !$CLdebug ) - { $cmd .= " -quiet"; } - else - { print STDERR __LINE__, "-- run $cmd ...\n"; } - - ( system( $cmd ) == 0 ) - or die "$cmd failed $? : $! \n"; + if ( !$CLdebug ) + { $cmd .= " -quiet"; } + else + { print STDERR __LINE__, "-- run $cmd ...\n"; } + ( system( $cmd ) == 0 ) + or die "$cmd failed $? : $! \n"; - ## reset the flushFlag, need to flush again before a read. - $L2_Flushed = 0; - } - else - { - if ($CLdebug) { print STDERR __LINE__, "-- P8_Ins_Start: already RUNNING\n"; } - } + ## reset the flushFlag, need to flush again before a read. + $L2_Flushed = 0; } @@ -368,13 +362,6 @@ sub RunClocks() if ( $CLdebug ) { printf STDERR __LINE__, "-- RunClocks()\n"; } - ## Check, and start instructions if necessary - if ( P8_Ins_Query( ) ne "RUNNING" ) - { - - P8_Ins_Start(); - } - $cmd = "$RUNCLKSCMD $SIM_CLOCKS -quiet"; if ( $CLdebug ) { print STDERR __LINE__, "-- run $cmd ...\n"; } ( system( $cmd ) == 0 ) diff --git a/src/build/vpo/do_sprint b/src/build/vpo/do_sprint index 8e4a2af87..e0b1c7bf4 100644 --- a/src/build/vpo/do_sprint +++ b/src/build/vpo/do_sprint @@ -26,14 +26,30 @@ # # NOTE: Execution environment must be intialized prior using source Setup_Env script # +# +################################################################################## # # Version 1.0 03-21-2012 Copy from Jim's on 03/21/2012, tested on VBU & VPO -# Version 1.1 04-16-2012 - Update to run with new Sprint 11 image. Load only these files on L3: -# hbicore.bin (or hbicore_test.bin if running test image) at address 0 -# vbu.pnor at address 0x400000 +# +# Version 1.1 04-16-2012 - Update to run with new Sprint 11 image. Load only +# these files on L3: +# hbicore.bin (or hbicore_test.bin if running +# test image) at address 0 +# vbu.pnor at address 0x400000 # - Sync with Jim's do_sprint'change # +# Version 1.2 05-09-2012 VPO tool changes: +# - Use p8_load_l3 and p8_dump_l3 at specified +# directory by Joe McGill +# Default vbutool dir now is for Murano +# "prev" vbutool dir is for Venice (only temporarily, +# will be removed) +# - Use proc_thread_control instead of +# p8_ins_query/stop/start +# - Use env variable $HB_VBUTOOLS for VBU tools +# +################################################################################## PGM=`basename $0` @@ -140,6 +156,10 @@ if [ "$HB_IMGDIR" = "" -o ! -d "$HB_IMGDIR" ]; then echo "ERROR: Missing/Invalid definition for HB_IMGDIR" fi +if [ "$HB_VBUTOOLS" = "" -o ! -d "$HB_VBUTOOLS" ]; then + echo "ERROR: Missing/Invalid definition for HB_VBUTOOLS" +fi + if [ "$HB_TOOLS" = "" -o ! -d "$HB_TOOLS" ]; then echo "ERROR: Missing/invalid definition for HB_TOOLS" exit 1 @@ -176,7 +196,6 @@ sim_clocks=${AUTOVBU_SIMCLOCKS-2000000} loopstart=${AUTOVBU_START-0} loopmax=`expr $loopstart '+' ${AUTOVBU_LOOPS-2000}` lines=${AUTOVBU_PRINTK_LINES-50} -sample=${AUTOVBU_PRINTK_SAMPLE-30} # If we requested checkpoints after loops or isteps, force a checkpoint after the hbitest as well test "$chkpt_after_loops" = "--chkpt_after_loops" && chkpt_after_hbitest="--chkpt_after_hbitest" @@ -208,8 +227,8 @@ if [ "$start_after_hbiload" != "--start_after_hbiload" -a "$start_after_hbitest" fi if [ "$start_after_hbiload" != "--start_after_hbiload" -a "$start_after_hbitest" != "--start_after_hbitest" ]; then - /afs/awd/projects/eclipz/lab/p8/gsiexe/p8_load_l3 -f ${HB_IMG}/hbicore${use_test}.bin -b ${CORE--c3} || exit 1 - /afs/awd/projects/eclipz/lab/p8/gsiexe/p8_load_l3 -f ${HB_IMG}/vbu${use_test}.pnor -o 0x400000 -b ${CORE--c3} || exit 1 + $HB_VBUTOOLS/p8_load_l3 -l ${DEFAULT_LEVEL-rel} -f ${HB_IMG}/hbicore${use_test}.bin -b ${CORE--c3} || exit 1 + $HB_VBUTOOLS/p8_load_l3 -l ${DEFAULT_LEVEL-rel} -f ${HB_IMG}/vbu${use_test}.pnor -o 0x400000 -b ${CORE--c3} || exit 1 fi @@ -222,7 +241,7 @@ if [ "$start_after_hbiload" != "--start_after_hbiload" -a "$start_after_hbitest" simclock 1 -quiet # Start instructions - p8_ins_reset || exit 1 + $HB_VBUTOOLS/proc_thread_control_wrap.x86 -sreset ${CORE--c3} -quiet # Make a checkpoint now if requested test "$chkpt_after_hbiload" = "--chkpt_after_hbiload" && simcheckpoint chkpt_after_hbiload-$AUTOCHKPT_VERSION @@ -349,19 +368,20 @@ if [ "$start_after_hbitest" != "--start_after_hbitest" ]; then fi if [ "$use_hb_trace" = "--use_hb_trace" ]; then - p8_ins_stop + $HB_VBUTOOLS/proc_thread_control_wrap.x86 -stop ${CORE--c3} -t0 -quiet $HB_TOOLS/hb-trace $test_arg --out $printk_tmp3 2>&1 | egrep -v "^FAPI DBG>:|^FAPI IMP>:|Using deprecated ReturnCode function to assign integer" >$printk_tmp2 test -f $printk_tmp3/hb-Trace.output && cp $printk_tmp3/hb-Trace.output $printk_tmp3/tmp.hb-Trace.output-$istep - p8_ins_start + $HB_VBUTOOLS/proc_thread_control_wrap.x86 -start ${CORE--c3} -t0 -quiet elif [ "$use_printk" = "--use_printk" ]; then DUMP_PRINTK ${addr} ${lines} >$printk_tmp2 elif [ "$use_dump_l3" = "--use_dump_l3" ]; then DUMP_L3_PRINTK ${addr} ${lines} >$printk_tmp2 else - p8_ins_stop + $HB_VBUTOOLS/proc_thread_control_wrap.x86 -stop ${CORE--c3} -t0 -quiet $HB_TOOLS/hb-printk $test_arg --out $printk_tmp3 2>&1 | egrep -v "^FAPI DBG>:|^FAPI IMP>:|Using deprecated ReturnCode function to assign integer" >$printk_tmp2 - p8_ins_start + $HB_VBUTOOLS/proc_thread_control_wrap.x86 -start ${CORE--c3} -t0 -quiet fi + echo >>$printk_tmp2 diff -a $printk_tmp1 $printk_tmp2 | egrep -a "^> " | sed -e 's/[Ee][Rr][Rr][Oo][Rr]/ERR*R/g' -e 's/FAIL/F*IL/g' mv $printk_tmp2 $printk_tmp1 @@ -430,31 +450,31 @@ if [ "$start_after_hbitest" != "--start_after_hbitest" ]; then simclock $sim_clocks -quiet || exit 1 cur_cia=`GET_CIA` echo "$loopcnt: $cur_cia" - $HB_TOOLS/hb-ContTrace --mute > /dev/null - cat hb-ContTrace.output >> tracMERG + + $HB_TOOLS/hb-ContTrace --mute > /dev/null + cat hb-ContTrace.output >> tracMERG + if [ "$use_hb_trace" = "--use_hb_trace" ]; then - p8_ins_stop + $HB_VBUTOOLS/proc_thread_control_wrap.x86 -stop ${CORE--c3} -t0 -quiet $HB_TOOLS/hb-trace $test_arg --out $printk_tmp3 2>&1 | egrep -v "^FAPI DBG>:|^FAPI IMP>:|Using deprecated ReturnCode function to assign integer" >$printk_tmp2 test -f $printk_tmp3/hb-Trace.output && cp $printk_tmp3/hb-Trace.output $printk_tmp3/tmp.hb-Trace.output-$loopcnt - p8_ins_start + #$HB_VBUTOOLS/proc_thread_control_wrap.x86 -start ${CORE--c3} -t0 -quiet elif [ "$use_printk" = "--use_printk" ]; then DUMP_PRINTK ${addr} ${lines} >$printk_tmp2 elif [ "$use_dump_l3" = "--use_dump_l3" ]; then DUMP_L3_PRINTK ${addr} ${lines} >$printk_tmp2 else - if [ `expr $loopcnt % $sample` -eq 0 ]; - then - $HB_TOOLS/hb-printk --mute > /dev/null - diff hb-Printk.output printk_out | sed -e 's/< //g' -e '1d' - mv hb-Printk.output printk_out - fi - fi - if [ -f $printk_tmp2 ]; - then - echo >>$printk_tmp2 - diff -a $printk_tmp1 $printk_tmp2 | egrep -a "^> " | sed -e 's/[Ee][Rr][Rr][Oo][Rr]/ERR*R/g' -e 's/FAIL/F*IL/g' - mv $printk_tmp2 $printk_tmp1 + $HB_VBUTOOLS/proc_thread_control_wrap.x86 -stop ${CORE--c3} -t0 -quiet + $HB_TOOLS/hb-printk $test_arg --out $printk_tmp3 2>&1 | egrep -v "^FAPI DBG>:|^FAPI IMP>:|Using deprecated ReturnCode function to assign integer" >$printk_tmp2 + #$HB_VBUTOOLS/proc_thread_control_wrap.x86 -start ${CORE--c3} -t0 -quiet fi + + # Start instruction, conttrace may have stop instructions + $HB_VBUTOOLS/proc_thread_control_wrap.x86 -start ${CORE--c3} -t0 -quiet + + echo >>$printk_tmp2 + diff -a $printk_tmp1 $printk_tmp2 | egrep -a "^> " | sed -e 's/[Ee][Rr][Rr][Oo][Rr]/ERR*R/g' -e 's/FAIL/F*IL/g' + mv $printk_tmp2 $printk_tmp1 grep 'HypeEmu: Illegal instruction' $printk_tmp1 >/dev/null if [ $? -eq 0 ]; then @@ -504,10 +524,15 @@ if [ "$start_after_hbitest" != "--start_after_hbitest" ]; then fi done $HB_TOOLS/hb-ContTrace --mute > /dev/null + cat hb-ContTrace.output >> tracMERG $HB_TOOLS/hb-ContTrace --mute --last > /dev/null cat hb-ContTrace.output >> tracMERG - date + + # Start instruction, conttrace may have stop instructions + $HB_VBUTOOLS/proc_thread_control_wrap.x86 -start ${CORE--c3} -t0 -quiet + + date rm -f $printk_tmp2 $printk_tmp1 @@ -562,9 +587,9 @@ if [ "$trace_after_loops" != "" ]; then fi echo "Loading: chkpt_after_loop${loopcnt}-$AUTOCHKPT_VERSION" siminit chkpt_after_loop${loopcnt}-$AUTOCHKPT_VERSION || exit 1 - p8_ins_stop + $HB_VBUTOOLS/proc_thread_control_wrap.x86 -stop ${CORE--c3} -t0 -quiet $HB_TOOLS/hb-trace $test_arg --out $AUTOVBU_TEST_DIR/trace_after_loop${loopcnt} >/dev/null 2>&1 - p8_ins_start + $HB_VBUTOOLS/proc_thread_control_wrap.x86 -start ${CORE--c3} -t0 -quiet done cat `ls -1rt $AUTOVBU_TEST_DIR/trace_after_loop*/hb-Trace.output` | sort | uniq -c | sed -e 's/[Ee][Rr][Rr][Oo][Rr]/ERR*R/g' -e 's/FAIL/F*IL/g' > $AUTOVBU_TEST_DIR/trace_after_loop-hb-Trace.output @@ -580,9 +605,9 @@ if [ -d "$AUTOVBU_TEST_DIR/trace_after_hbitest" -a ! -f $AUTOVBU_TEST_DIR/trace_ chmod a+rx $AUTOVBU_TEST_DIR/trace_after_hbitest >/dev/null 2>&1 echo "Loading: chkpt_after_hbitest-$AUTOCHKPT_VERSION" siminit chkpt_after_hbitest-$AUTOCHKPT_VERSION || exit 1 - p8_ins_stop + $HB_VBUTOOLS/proc_thread_control_wrap.x86 -stop ${CORE--c3} -t0 -quiet $HB_TOOLS/hb-trace $test_arg --out $AUTOVBU_TEST_DIR/trace_after_hbitest >/dev/null 2>&1 - p8_ins_start + $HB_VBUTOOLS/proc_thread_control_wrap.x86 -start ${CORE--c3} -t0 -quiet echo echo "Trace file: $AUTOVBU_TEST_DIR/trace_after_hbitest/hb-Trace.output" echo @@ -616,9 +641,9 @@ if [ "$trace_after_istep" != "" ]; then fi echo "Loading: chkpt_after_istep_${istep}-$AUTOCHKPT_VERSION" siminit chkpt_after_istep_${istep}-$AUTOCHKPT_VERSION || exit 1 - p8_ins_stop + $HB_VBUTOOLS/proc_thread_control_wrap.x86 -stop ${CORE--c3} -t0 -quiet $HB_TOOLS/hb-trace $test_arg --out $AUTOVBU_TEST_DIR/trace_after_istep_${istep} >/dev/null 2>&1 - p8_ins_start + $HB_VBUTOOLS/proc_thread_control_wrap.x86 -start ${CORE--c3} -t0 -quiet done cat `ls -1rt $AUTOVBU_TEST_DIR/trace_after_istep*/hb-Trace.output` | sort | uniq -c | sed -e 's/[Ee][Rr][Rr][Oo][Rr]/ERR*R/g' -e 's/FAIL/F*IL/g' > $AUTOVBU_TEST_DIR/trace_after_istep-hb-Trace.output diff --git a/src/build/vpo/hb-istep b/src/build/vpo/hb-istep index 729d5ec46..beda8eed0 100755..100644 --- a/src/build/vpo/hb-istep +++ b/src/build/vpo/hb-istep @@ -40,6 +40,15 @@ # Author: Mark Wenning # +################################################################################## +# +# +# Version 1.1 05-09-2012 Start version history +# VPO performance improvement changes +# +# +################################################################################## + #------------------------------------------------------------------------------ # Specify perl modules to use #------------------------------------------------------------------------------ @@ -71,6 +80,7 @@ sub resume_istep; sub isShutDown; sub getSymbol; sub dumpEnvVar; +sub isTraceFull; #------------------------------------------------------------------------------ # Constants @@ -354,22 +364,9 @@ sub main() exit; } - ## - ## Before we start, we must make sure the system is stopped and memory - ## is flushed so that we can read the state. This includes: - ## - make sure that HostBoot has not already started and run to - ## completion (shutdown status ) - ## - read/write memory location to set single-step mode (SPLESS or - ## FSP) - ## - etc?? - ## - my $qstr = VBU_Cacheline::P8_Ins_Query(); - if ( $qstr ne "STOPPED" ) - { - print STDOUT "Setting P8 Instructions to STOPPED.\n"; - VBU_Cacheline::P8_Ins_Stop(); - VBU_Cacheline::P8_Flush_L2(); - } + ## Stop instruction to read L3 + VBU_Cacheline::P8_Ins_Stop(); + VBU_Cacheline::P8_Flush_L2(); if ( isShutDown() ) { @@ -422,8 +419,6 @@ sub main() exit; } - - ## ## Process resume ## @@ -463,8 +458,7 @@ sub printUsage() 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 " [--clear-trace] (clear trace buffers before starting)\n"; - + print STDOUT " [--clear-trace] (clear trace buffers before starting)\n"; print STDOUT "\n" ; } @@ -611,14 +605,9 @@ sub find_in_inList( $ ) ## sub isShutDown() { - ## check to make sure that system is stopped and flushed. - my $qstr = VBU_Cacheline::P8_Ins_Query(); - if ( $qstr ne "STOPPED" ) - { - ## Stop instructions, flush L2 - VBU_Cacheline::P8_Ins_Stop(); - VBU_Cacheline::P8_Flush_L2(); - } + ## Make sure system is stopped and flushed. + VBU_Cacheline::P8_Ins_Stop(); + VBU_Cacheline::P8_Flush_L2(); my $flag = VBU_Cacheline::CLread( sprintf( "%x", $ShutDownFlag ) ); my $status = VBU_Cacheline::CLread( sprintf( "%x", $ShutDownSts ) ); @@ -758,27 +747,38 @@ sub getSyncStatus( ) my $seqnum = 0; my $running = 0; + # Start instructions before going into loop + VBU_Cacheline::P8_Ins_Start(); + ## get response. sendCmd() should have bumped g_SeqNum, so we will sit ## here for a reasonable amount of time waiting for the correct sequence ## number to come back. while(1) { - ## advance HostBoot code by a certain # of cycles, then check the ## sequence number to see if it has changed. rinse and repeat. - ## Note: RunClocks will also start instructions - ## $$VBU_Cacheline::RunClocks(); + # Progress bar + print STDOUT "."; + + # Feed simclocks runClocks(); - ## activate continuous trace - system ("$hbToolsDir/hb-ContTrace --mute > /dev/null" ); - system ("cat hb-ContTrace.output >> tracMERG"); - - ## $$ for old memory-based regs, stop instructions, flush L2 - ## $$ VBU_Cacheline::P8_Ins_Stop(); - ## $$ VBU_Cacheline::P8_Flush_L2(); - ## $$ VBU_Cacheline::CLread( $statusreg ); + # Check if trace buffer is full, if it is, call ContTrace to + # dump traces out from L3 + # Note: This is called here in order to avoid repeated + # system calls of ContTrace in every loop, when the + # trace buffer is not yet full. + if ( isTraceFull() ) + { + # Print Trace Full message just for reference when running. + print STDOUT "T/F"; + system ("$hbToolsDir/hb-ContTrace --no-save-states --mute > /dev/null" ); + system ("cat hb-ContTrace.output >> tracMERG"); + + # Need to start instructions after trace has been dumped out. + VBU_Cacheline::P8_Ins_Start(); + } ## Fetch status reg(s) $result = getStatus( ); @@ -794,6 +794,8 @@ sub getSyncStatus( ) ## && ( $seqnum == $g_SeqNum ) if ( $seqnum == $g_SeqNum ) { + # Done progress bar + print STDOUT "\n"; return $result; } @@ -804,6 +806,8 @@ sub getSyncStatus( ) if ( $count <= 0 ) { + # Done progress bar + print STDOUT "\n"; print STDOUT "TIMEOUT waiting for seqnum=$g_SeqNum\n"; return -1; } @@ -879,7 +883,7 @@ sub runIStep( $$ ) } } - print STDOUT "-------------------------------------------------------------- $g_SeqNum\n"; + print STDOUT "------------------------------------------------------- SeqNum: $g_SeqNum\n"; } } @@ -1000,26 +1004,17 @@ sub setMode( $ ) my $hexstr = sprintf( "%x",$IstepModeReg ); - ## check to make sure that system is stopped and flushed. - my $qstr = VBU_Cacheline::P8_Ins_Query(); - if ( $qstr ne "STOPPED" ) - { - ## Stop instructions, flush L2 - VBU_Cacheline::P8_Ins_Stop(); - VBU_Cacheline::P8_Flush_L2(); - } + ## Stop and flush + VBU_Cacheline::P8_Ins_Stop(); + VBU_Cacheline::P8_Flush_L2(); if ( $cmd eq "spless" ) { - ## $$ VBU_Cacheline::CLwrite( $IstepModeReg, "0x4057b0074057b007" ); - VBU_Cacheline::CLwrite( $hexstr, SPLESS_MODE_SIGNATURE ); $expected = 1; } elsif ( $cmd eq "fsp" ) { - ##$$VBU_Cacheline::CLwrite( $IstepModeReg, "0x700b7504700b7504" ); - VBU_Cacheline::CLwrite( $hexstr, FSP_MODE_SIGNATURE ); $expected = 1; } @@ -1032,7 +1027,6 @@ sub setMode( $ ) if ( $opt_debug ) { ## readback and display - ##$result = VBU_Cacheline::CLread( $IstepModeReg ); $result = VBU_Cacheline::CLread( $hexstr ); printf STDERR "=== istepmodereg readback: 0x%lx\n", $result ; } @@ -1042,30 +1036,44 @@ sub setMode( $ ) ## @todo revisit while(1) { + # Progress bar + print STDOUT "."; + + # Check if trace buffer is full, if it is, call ContTrace to + # dump traces out from L3 + # Note: This is called here in order to avoid repeated + # system calls of ContTrace in every loop, when the + # trace buffer is not yet full. + if ( isTraceFull() ) + { + # Print Trace Full message just for reference when running. + print STDOUT "T/F"; + system ("$hbToolsDir/hb-ContTrace --no-save-states --mute > /dev/null" ); + system ("cat hb-ContTrace.output >> tracMERG"); + } + + # Because setMode read data from L3 instead of SCOM, + # Start instruction needs to be done every loop + VBU_Cacheline::P8_Ins_Start(); + ## advance HostBoot code by a certain # of cycles, then check the ## sequence number to see if it has changed. rinse and repeat. - ## $$VBU_Cacheline::RunClocks(); runClocks( ); - ## activate continuous trace - system ("$hbToolsDir/hb-ContTrace --mute > /dev/null" ); - system ("cat hb-ContTrace.output >> tracMERG"); - ## Stop instructions, flush L2 - VBU_Cacheline::P8_Ins_Stop(); - VBU_Cacheline::P8_Flush_L2(); - + VBU_Cacheline::P8_Ins_Stop(); + VBU_Cacheline::P8_Flush_L2(); ## check for system crash if ( isShutDown( ) ) { + # Stop progress bar + print STDOUT "\n"; print STDOUT "HostBoot has shut down."; return -1; } - ## $$$result = VBU_Cacheline::CLread( $statusreg ); $result = getStatus( ); - $readybit = ( ( $result & 0x4000000000000000 ) >> 62 ); if ($opt_debug) @@ -1076,6 +1084,8 @@ sub setMode( $ ) if ( $readybit == $expected ) { + # Stop progress bar + print STDOUT "\n"; print STDOUT "Set $cmd Mode success.\n" ; return 0; } @@ -1201,6 +1211,27 @@ sub clear_trace( ) print STDOUT "---------------------------------------------------------------\n"; } +## +## Read the scratch register to see if trace full condition is notified. +## The purpose of this routine is to avoid making system calls to +## ContTrace, which introduces overheads to VPO performance. +## +sub isTraceFull() +{ + my $traceIsFull = 1; + my $trigger = "simGETFAC B0.C0.S0.P0.E8.TPC.FSI.FSI_MAILBOX.FSXCOMP." . + "FSXLOG.LBUS_MAILBOX.Q_GMB2E0.NLC.L2 32"; + $trigger = `$trigger`; + $trigger =~ s/.*\n0xr(.*)\n.*/$1/g; + $trigger =~ s/\n//g; + + if ($trigger !~ /[1-9a-fA-F]+/) + { + $traceIsFull = 0; + } + + return $traceIsFull; +} __END__ diff --git a/src/build/vpo/hb-virtdebug.pl b/src/build/vpo/hb-virtdebug.pl index 4a2ee750e..ed751dfb8 100755..100644 --- a/src/build/vpo/hb-virtdebug.pl +++ b/src/build/vpo/hb-virtdebug.pl @@ -27,8 +27,16 @@ # relevant data such as the code version, kernel printk buffer & component traces. # # Author: CamVan Nguyen -# Last Updated: 07/19/2011 + +################################################################################## +# +# Version 1.1 05-09-2012 Start version history +# - Use HB_VBUTOOLS env if set +# - Use proc_thread_control_wrap in place of +# p8_ins_stop/start/query # +# +################################################################################## #------------------------------------------------------------------------------ # Specify perl modules to use @@ -93,6 +101,16 @@ my $core = "3"; #Default is core 3 my @threadState = (); #Array to store the thread states my $vbuToolDir = "/gsa/ausgsa/projects/h/hostboot/vbutools/latest"; +# Use HB_VBUTOOLS if it's set; otherwise, try to use the latest tool directory +my $vbuToolDir = $ENV{'HB_VBUTOOLS'}; +if (defined ($vbuToolDir)) +{ + unless ($vbuToolDir ne "") + { + $vbuToolDir = "/gsa/ausgsa/projects/h/hostboot/vbutools/latest"; + } +} + my $hbDir = $ENV{'HB_IMGDIR'}; if (defined ($hbDir)) { @@ -587,7 +605,7 @@ sub stopInstructions my $thread = shift; #Stopping all threads - my $command = "$vbuToolDir/proc_thread_control.x86"; + my $command = "$vbuToolDir/proc_thread_control_wrap.x86"; $command .= " @ecmdOpt -stop -t$thread -quiet"; die "ERROR: cannot stop instructions" if (system("$command") != 0); } @@ -600,7 +618,7 @@ sub startInstructions my $thread = shift; #Starting all threads - my $command = "$vbuToolDir/proc_thread_control.x86"; + my $command = "$vbuToolDir/proc_thread_control_wrap.x86"; $command .= " @ecmdOpt -start -t$thread -quiet"; die "ERROR: cannot start instructions" if (system("$command") != 0); } @@ -614,7 +632,7 @@ sub queryThreadState my $thread = shift; #print "thread $thread\n"; - my $command = "$vbuToolDir/proc_thread_control.x86 @ecmdOpt -query -t$thread"; + my $command = "$vbuToolDir/proc_thread_control_wrap.x86 @ecmdOpt -query -t$thread"; my $result = `$command`; #print "result:\n $result"; if ($result =~ m/Quiesced/) |