summaryrefslogtreecommitdiffstats
path: root/sbe/build
diff options
context:
space:
mode:
authorSachin Gupta <sgupta2m@in.ibm.com>2016-04-04 03:18:13 -0500
committerAMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>2016-04-05 07:16:32 -0400
commite453a6782e4d56a37342fcd0c5e4b303bb5bacba (patch)
tree45954d1845aa389f4053bf58888e2f05beb0d789 /sbe/build
parent7b92c5d8d82c9e82e3fbd1ac35a319dbaa340858 (diff)
downloadtalos-sbe-e453a6782e4d56a37342fcd0c5e4b303bb5bacba.tar.gz
talos-sbe-e453a6782e4d56a37342fcd0c5e4b303bb5bacba.zip
Enable auto register for SBE tools
Change-Id: I79788ba40a2cb46855ba7a6c90359ed0616fda23 RTC: 149038 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22822 Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Tested-by: Jenkins Server Reviewed-by: Santosh S. Puranik <santosh.puranik@in.ibm.com> Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Diffstat (limited to 'sbe/build')
-rwxr-xr-xsbe/build/citest/build-script2
-rwxr-xr-xsbe/build/citest/populate-sandbox19
-rwxr-xr-xsbe/build/citest/setup-env7
-rwxr-xr-xsbe/build/simics/sbe_startup.simics4
-rwxr-xr-xsbe/build/simics/simics-debug-framework.py49
5 files changed, 32 insertions, 49 deletions
diff --git a/sbe/build/citest/build-script b/sbe/build/citest/build-script
index 808dfcbb..5378aa54 100755
--- a/sbe/build/citest/build-script
+++ b/sbe/build/citest/build-script
@@ -19,7 +19,7 @@ source "$SBEROOT/sbe/build/citest/setup-env"
# Build .
cd sbe/image
-scl enable devtoolset-2 " bash -c \"make all\"" || exit -1
+scl enable devtoolset-2 " bash -c \"make install\"" || exit -1
cd -
# Create simics sandbox.
diff --git a/sbe/build/citest/populate-sandbox b/sbe/build/citest/populate-sandbox
index cd377538..b49f1e04 100755
--- a/sbe/build/citest/populate-sandbox
+++ b/sbe/build/citest/populate-sandbox
@@ -16,6 +16,25 @@ fi
# Create test directory.
mkdir -p $SBETESTDIR || exit -1
+# Create test directory.
+mkdir -p $SBEFW_IMG_DIR || exit -1
+mkdir -p $SBEFW_SB_XIP_DIR || exit -1
+
+# Copy sbe binaries
+cp $SBEROOT/sbe/obj/*.bin $SBEFW_IMG_DIR/ || exit -1
+cp $SBEROOT/sbe/obj/simics.tar $SBEFW_DIR/ || exit -1
+# Copy XIP binary binaries
+cp $SBEROOT/import/chips/p9/xip/bin/p9_xip_tool $SBEFW_SB_XIP_DIR/ || exit -1
+# Compile sbe code in sandbox to copy binaries at right place
+echo "---Setup sandbox for sbe binaries."
+
+execute_in_sandbox "cd $SBEFW_DIR; mk -a" \
+ "ppc" || exit -1
+
+execute_in_sandbox "cd $SBEFW_DIR; mk install_all" \
+ "ppc" || exit -1
+
+
# Copy test files.
cp $SBEROOT/sbe/test/* $SBETESTDIR/ || exit -1
diff --git a/sbe/build/citest/setup-env b/sbe/build/citest/setup-env
index 9fa02c93..e0707cdc 100755
--- a/sbe/build/citest/setup-env
+++ b/sbe/build/citest/setup-env
@@ -2,8 +2,7 @@
export CITESTPATH=${SBEROOT}/sbe/build/citest
export PATH=${CITESTPATH}:${PATH}
-export SBE_IMG_OUT_LOC=${SBEROOT}/sbe/obj;
-export SBE_IMG_BIN_LOC=${SBEROOT}/sbe/obj;
+
# If we are running under Jenkins we need to pick a random-ish sandbox name
# so that the autoipl tools do not have a /tmp name collision.
if [ -z $JOB_NAME -o -z $BUILD_NUMBER ];
@@ -31,7 +30,6 @@ if [ -z $SANDBOXRC ];
then
export SANDBOXRC=${SANDBOXROOT}/sbesandboxrc
fi
-
# Useful utility function.
execute_in_sandbox()
{
@@ -55,6 +53,9 @@ export -f execute_in_sandbox
export MACHINE=${MACHINE:-$DEFAULT_MACHINE}
export SBETESTDIR=$SANDBOXBASE/simics/targets/p9_nimbus/sbeTest
+export SBEFW_DIR=$SANDBOXBASE/src/sbei/sbfw/
+export SBEFW_IMG_DIR=$SANDBOXBASE/src/sbei/sbfw/img
+export SBEFW_SB_XIP_DIR=$SANDBOXBASE/obj/ppc/hwsv/server/buildhwpf2/hwpf2/tools/
export AUTOSIM_FFDC_XML=$SBETESTDIR/ffdc.xml
export SBE_TEST_XML=$SBETESTDIR/test.xml
# Indicate we setup the CI environment.
diff --git a/sbe/build/simics/sbe_startup.simics b/sbe/build/simics/sbe_startup.simics
index fe8fbbab..15cd9e91 100755
--- a/sbe/build/simics/sbe_startup.simics
+++ b/sbe/build/simics/sbe_startup.simics
@@ -2,6 +2,10 @@ echo "Attempting to register SBE Tools"
# Load SBE debug tools.
try {
+ $sbe_startup_path = (lookup-file sbfw/simics-debug-framework.py);
+ $sbe_script_location = (python "''.join(map('/'.__add__,\""+$sbe_startup_path+"\"[1:].split('/')[0:-1]))")
+ python "os.environ['SBE_TOOLS_PATH'] = \""+$sbe_script_location+"\""
+ echo $sbe_script_location;
run-python-file (lookup-file sbfw/simics-debug-framework.py)
} except { echo "ERROR: Failed to load SBE debug tools." }
diff --git a/sbe/build/simics/simics-debug-framework.py b/sbe/build/simics/simics-debug-framework.py
index 07bac725..f5b54609 100755
--- a/sbe/build/simics/simics-debug-framework.py
+++ b/sbe/build/simics/simics-debug-framework.py
@@ -4,57 +4,21 @@ import subprocess
import re
import random
import sys
-sys.path.append("targets/p9_nimbus/sbeTest" )
-import testIstepAuto
+import imp
+testIstepAuto = imp.load_source("testIstepAuto", os.environ['SBE_TOOLS_PATH'] + "/testIstepAuto.py")
err = False
syms = {};
def check_sbe_tools_path ():
global SBE_TOOLS_PATH
- print "checking for SBE_TOOLS_PATH .."
- SB_SRC_PATH = os.environ['sb']
- SB_BB_PATH = os.environ['bb']
- SBE_TOOLS_REL_PATH = "/obj/ppc/sbei/sbfw/simics"
- TOOLS_IN_SB = os.environ['sb'] + "/.." + SBE_TOOLS_REL_PATH
- TOOLS_IN_BB = os.environ['bb'] + SBE_TOOLS_REL_PATH
+ SBE_TOOLS_PATH = os.environ['SBE_TOOLS_PATH'];
- if os.path.exists(TOOLS_IN_SB):
- SBE_TOOLS_PATH = TOOLS_IN_SB
- print "Found SBE_TOOLS_PATH at: ", SBE_TOOLS_PATH
- elif os.path.exists(TOOLS_IN_BB):
- SBE_TOOLS_PATH = TOOLS_IN_BB
- print "Found SBE_TOOLS_PATH at: ", SBE_TOOLS_PATH
- else:
- print "C"
- print "Error: Could not find SBE_TOOLS_PATH!"
- SBE_TOOLS_PATH = ""
-
-# MAGIC_INSTRUCTION hap handler
-# arg contains the integer parameter n passed to MAGIC_INSTRUCTION(n)
-# See src/include/arch/ppc.H for the definitions of the magic args.
-# Hostboot magic args should range 7000..7999.
-def magic_instruction_callback_sb(user_arg, cpu, arg):
- print "In magic_instruction_callback."
- print arg
- if arg == 8008:
- cpu.r3 = random.randint(1, 0xffffffffffffffffL)
-
- if arg == 8006: # MAGIC_SHUTDOWN
- # KernelMisc::shutdown()
- print "KernelMisc::shutdown() called."
- # Could break/stop/pause the simics run, but presently
- # shutdown() is called four times. --Monte Jan 2012
- # SIM_break_simulation( "Shutdown. Simulation stopped." )
-
-
-# @fn register_hb_debug_framework_tools
-# @brief Create a simics command wrapper for each debug tool module.
def register_sbe_debug_framework_tools():
check_sbe_tools_path ()
fillSymTable()
# Create command hook.
- new_command("sbe-istep", testIstepAuto.sbe_istep_func,
+ new_command("sbe-istep",testIstepAuto.sbe_istep_func,
args = [arg(int_t, "major"), arg(int_t, "minor")],
alias = "istep",
type = ["sbe-commands"],
@@ -95,11 +59,6 @@ def collectTrace():
SIM_run_alone( run_command, cmd4 )
-# Register the magic instruction hap handler (a callback).
-SIM_hap_add_callback_range( "Core_Magic_Instruction", magic_instruction_callback_sb, None, 8000, 8190 )
-
-
-
# Run the registration automatically whenever this script is loaded.
register_sbe_debug_framework_tools()
OpenPOWER on IntegriCloud