Skip to contentSkip to conversation

xilinx-boot: Refactor recipe to add support for Xilinx ISE 14.1.

PATCH Applied Elvis Dowson 3 participants 4 messages Jun 24, 2012 – Jun 27, 2012 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 xilinx-boot: Refactor recipe to add support for Xilinx ISE 14.1.

* Refactor recipe to add support for Xilinx ISE 14.1.
* Fix minor spelling mistakes.
* Add additional log messages.

Ensure that you reconfigure your shell to use bash instead of dash while building with Ubuntu 12.04 LTS.

---
 classes/xilinx-boot.bbclass |   41 +++++++++++++++++++++++++++--------------
 1 file changed, 27 insertions(+), 14 deletions(-)
classes/xilinx-boot.bbclass +27 -14
index a7f1f1d..85fb6d9 100644
@@ -65,20 +65,31 @@ bbnote "Generate system ace image"
 # Set Xilinx EDK tools
 if [ -z ${XILINX_EDK} ]; then
 	# Get Xilinx version
-	if [ "${BUILD_ARCH}" = "x86_64" ]; then
-		EDK_SRCIPT="settings64.sh"
-	else
-		EDK_SRCIPT="settings.sh"
-	fi
-	# Strip EDK version
 	XILINX_VER=`echo ${XILINX_LOC} | tr -d '[:alpha:]/_'`
+	bbnote "XILINX ISE version ${XILINX_VER}, EDK script location ${XILINX_LOC}/${EDK_SCRIPT}"
 	if [ "${XILINX_VER}" \> "13" ]; then
-		source ${XILINX_LOC}/${EDK_SRCIPT} ${XILINX_LOC}
+		# EDK version 13.1 and higher
+		# Check host computer build architecture
+		if [ "${BUILD_ARCH}" = "x86_64" ]; then
+			EDK_SCRIPT="settings64.sh"
+		else
+			EDK_SCRIPT="settings32.sh"
+		fi
+		# Setup Xilinx environment variables
+		source ${XILINX_LOC}/${EDK_SCRIPT} ${XILINX_LOC}
 	else
-		# EDK version prior to 13.1 require to additionaly source this scripts
-		source ${XILINX_LOC}/${EDK_SRCIPT} ${XILINX_LOC}
-		source ${XILINX_LOC}/ISE/${EDK_SRCIPT} ${XILINX_LOC}/ISE
-		source ${XILINX_LOC}/EDK/${EDK_SRCIPT} ${XILINX_LOC}/EDK
+		# EDK versions prior to 13.1
+		# Check host computer build architecture
+		if [ "${BUILD_ARCH}" = "x86_64" ]; then
+			EDK_SCRIPT="settings64.sh"
+		else
+			EDK_SCRIPT="settings.sh"
+		fi
+		# Setup Xilinx environment variables
+		# EDK versions prior to 13.1 require additional ISE and EDK scripts to be sourced
+		source ${XILINX_LOC}/${EDK_SCRIPT} ${XILINX_LOC}
+		source ${XILINX_LOC}/ISE/${EDK_SCRIPT} ${XILINX_LOC}/ISE
+		source ${XILINX_LOC}/EDK/${EDK_SCRIPT} ${XILINX_LOC}/EDK
 	fi
 fi
 
@@ -90,11 +101,12 @@ fi
 # This could be ovirrided by setting in ${XILINX_BSP_PATH}/system_incl.make
 # BRAMINIT_ELF_FILES = $(PPC440_0_BOOTLOOP)
 # BRAMINIT_ELF_FILES_ARGS = -pe ppc440_0 $(PPC440_0_BOOTLOOP)
-# For Xilinx EDK 13.1 Bootlop is set by default
+# For Xilinx EDK 13.1 Bootloop is set by default
 #
 cd ${XILINX_BSP_PATH}
 if [ ! -f implementation/download.bit ]; then
 	# Bitstream not found generate it
+	bbnote "bitstream not found, generating it"
 	make -f ${XILINX_BSP_PATH}/system.make init_bram
 fi
 
@@ -141,16 +153,17 @@ do_deploy_prepend() {
 # Install u-boot elf image
 if [ -d "${XILINX_BSP_PATH}" ]; then
 	if [ -e "${S}/u-boot" ]; then
-        bbnote "Deploy uboot elf image"
+        bbnote "Deploying uboot elf image to ${XILINX_BSP_PATH}"
 		install ${S}/u-boot ${XILINX_BSP_PATH}
     fi
     if [ -n "${XILINX_LOC}" ]; then
+                bbnote "Xilinx design tools installed in ${XILINX_LOC}"
 		do_mk_sysace
         if [ -e  "${XILINX_BSP_PATH}/u-boot-${XILINX_BOARD}.ace" ]; then
 		    install ${XILINX_BSP_PATH}/u-boot-${XILINX_BOARD}.ace ${DEPLOYDIR}
         fi
     else
-        bbnote "XILINX_LOC undifined can't generate system ace image"
+        bbnote "XILINX_LOC undefined can't generate system ace image"
     fi
 fi
 }
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 2 lines · Elvis Dowson

Ensure that you reconfigure your shell to use bash instead of dash while building with Ubuntu 12.04 LTS.

why is this needed? may be you can fix the scripts to not have bashism

#2 lore raw

Hi Khem,

Quoted 4 lines · Khem Raj
Quoted 2 lines

Ensure that you reconfigure your shell to use bash instead of dash while building with Ubuntu 12.04 LTS.

why is this needed? may be you can fix the scripts to not have bashism

I tired to use a . (dot) instead of the source keyword, but ran into some errors, perhaps because of the xilinx settings64.sh script. I posted the errors in an earlier email, I'll reproduce that mail below, along with the xilinx settings64.sh script

Error message

For the following code snippet:

	if   [ "${XILINX_VER}" \> "14" ]; then
		bbnote "XILINX_VER ${XILINX_VER}, script location ${XILINX_LOC}/${EDK_SCRIPT}"
		source ${XILINX_LOC}/${EDK_SCRIPT} ${XILINX_LOC}
	fi

I get the following error:

DEBUG: Executing python function sstate_task_prefunc
DEBUG: Python function sstate_task_prefunc finished
DEBUG: Executing shell function do_deploy
ERROR: Function failed: do_deploy (see /tool/yocto/poky/build/tmp/work/ppc440-poky-linux/u-boot-xilinx-v2012.04.01-r16/temp/log.do_deploy.15616 for further information)
NOTE: Deploying uboot elf image to /project/xilinx-ml507
NOTE: Xilinx design tools installed in /tool/xilinx/14.1/ISE_DS
NOTE: Generate system ace image
NOTE: EDK_SCRIPT settings64.sh
NOTE: XILINX_VER 14.1, script location /tool/xilinx/14.1/ISE_DS/settings64.sh
/tool/yocto/poky/build/tmp/work/ppc440-poky-linux/u-boot-xilinx-v2012.04.01-r16/temp/run.do_deploy.15616: 129: /tool/yocto/poky/build/tmp/work/ppc440-poky-linux/u-boot-xilinx-v2012.04.01-r16/temp/run.do_deploy.15616: source: not found

if I replace the source keyword with a . (dot)

	if   [ "${XILINX_VER}" \> "14" ]; then
		bbnote "XILINX_VER ${XILINX_VER}, script location ${XILINX_LOC}/${EDK_SCRIPT}"
		. ${XILINX_LOC}/${EDK_SCRIPT} ${XILINX_LOC}
	fi

it executes the scripts but gives the following error:

NOTE: XILINX_VER 14.1, script location /tool/xilinx/14.1/ISE_DS/settings64.sh
/tool/yocto/poky/build/tmp/work/ppc440-poky-linux/u-boot-xilinx-v2012.04.01-r16/temp/run.do_deploy.7879: 12: [: /tool/yocto/poky/build/tmp/work/ppc440-poky-linux/u-boot-xilinx-v2012.04.01-r16/temp/run.do_deploy.7879: unexpected operator . /tool/xilinx/14.1/ISE_DS/common/.settings64.sh /tool/xilinx/14.1/ISE_DS/common
. /tool/xilinx/14.1/ISE_DS/EDK/.settings64.sh /tool/xilinx/14.1/ISE_DS/EDK
. /tool/xilinx/14.1/ISE_DS/common/CodeSourcery/.settings64.sh /tool/xilinx/14.1/ISE_DS/common/CodeSourcery
. /tool/xilinx/14.1/ISE_DS/PlanAhead/.settings64.sh /tool/xilinx/14.1/ISE_DS/PlanAhead
. /tool/xilinx/14.1/ISE_DS/../../Vivado/2012.1/.settings64.sh /tool/xilinx/14.1/ISE_DS/../../Vivado/2012.1
. /tool/xilinx/14.1/ISE_DS/ISE/.settings64.sh /tool/xilinx/14.1/ISE_DS/ISE
. /tool/xilinx/14.1/ISE_DS/SysGen/.settings64.sh /tool/xilinx/14.1/ISE_DS/SysGen

Xilinx settings64.sh script

# Copyright (c) 1995-2012 Xilinx, Inc. All rights reserved.

XIL_ARG_=$_
SETTINGS_FILE=.settings64.sh XIL_SCRIPT_LOC="/tool/xilinx/14.1/ISE_DS"
if [ $# != 0 ]; then
# The first argument is the location of Xilinx Installation. # Don't detect the installation location. XIL_SCRIPT_LOC="$1"
else
# XIL_SCRIPT_LOC should point to script location if [ "$0" == "ksh" ]; then

      XIL_SCRIPT_LOC_TMP_UNI=`readlink -f ${XIL_ARG_}`
   else
      XIL_SCRIPT_LOC_TMP_UNI=$BASH_SOURCE
   fi
   XIL_SCRIPT_LOC_TMP_UNI=${XIL_SCRIPT_LOC_TMP_UNI%/*}
   if [ "$XIL_SCRIPT_LOC_TMP_UNI" != "" ]; then
      if [ "$XIL_SCRIPT_LOC_TMP_UNI" == "settings64.sh" ]; then
         XIL_SCRIPT_LOC_TMP_UNI="./"
      fi
      XIL_SCRIPT_LOC_TMP_UNI=`readlink -f ${XIL_SCRIPT_LOC_TMP_UNI}`
      if [ $? == 0 ]; then
         XIL_SCRIPT_LOC=${XIL_SCRIPT_LOC_TMP_UNI}
      fi

fi
unset XIL_SCRIPT_LOC_TMP_UNI
fi

xlnxInstLocList=""

xlnxInstLocList="${xlnxInstLocList} common" xlnxInstLocList="${xlnxInstLocList} EDK" xlnxInstLocList="${xlnxInstLocList} common/CodeSourcery" xlnxInstLocList="${xlnxInstLocList} PlanAhead" xlnxInstLocList="${xlnxInstLocList} ../../Vivado/2012.1" xlnxInstLocList="${xlnxInstLocList} ISE" xlnxInstLocList="${xlnxInstLocList} SysGen" XIL_SCRIPT_LOC_TMP_UNI=${XIL_SCRIPT_LOC}
for i in $xlnxInstLocList
do

	d="${XIL_SCRIPT_LOC_TMP_UNI}/$i"
	sfn="$d/$SETTINGS_FILE"
	if [ -e  "$sfn" ]; then
		echo . "$sfn" "$d"
		. "$sfn" "$d"
	fi

done

Best regards,

Elvis Dowson

#3 lore raw

Applied.

Thanks

Quoted 111 lines · Elvis Dowson

Hi Khem,

Quoted 4 lines · Khem Raj
Quoted 2 lines

Ensure that you reconfigure your shell to use bash instead of dash while building with Ubuntu 12.04 LTS.

why is this needed? may be you can fix the scripts to not have bashism

I tired to use a . (dot) instead of the source keyword, but ran into some errors, perhaps because of the xilinx settings64.sh script. I posted the errors in an earlier email, I'll reproduce that mail below, along with the xilinx settings64.sh script

Error message

For the following code snippet:

       if   [ "${XILINX_VER}" \> "14" ]; then
               bbnote "XILINX_VER ${XILINX_VER}, script location ${XILINX_LOC}/${EDK_SCRIPT}" source ${XILINX_LOC}/${EDK_SCRIPT} ${XILINX_LOC}
       fi

I get the following error:

DEBUG: Executing python function sstate_task_prefunc
DEBUG: Python function sstate_task_prefunc finished
DEBUG: Executing shell function do_deploy
ERROR: Function failed: do_deploy (see /tool/yocto/poky/build/tmp/work/ppc440-poky-linux/u-boot-xilinx-v2012.04.01-r16/temp/log.do_deploy.15616 for further information)
NOTE: Deploying uboot elf image to /project/xilinx-ml507
NOTE: Xilinx design tools installed in /tool/xilinx/14.1/ISE_DS
NOTE: Generate system ace image
NOTE: EDK_SCRIPT settings64.sh
NOTE: XILINX_VER 14.1, script location /tool/xilinx/14.1/ISE_DS/settings64.sh
/tool/yocto/poky/build/tmp/work/ppc440-poky-linux/u-boot-xilinx-v2012.04.01-r16/temp/run.do_deploy.15616: 129: /tool/yocto/poky/build/tmp/work/ppc440-poky-linux/u-boot-xilinx-v2012.04.01-r16/temp/run.do_deploy.15616: source: not found

if I replace the source keyword with a . (dot)

       if   [ "${XILINX_VER}" \> "14" ]; then
               bbnote "XILINX_VER ${XILINX_VER}, script location ${XILINX_LOC}/${EDK_SCRIPT}" . ${XILINX_LOC}/${EDK_SCRIPT} ${XILINX_LOC}
       fi

it executes the scripts but gives the following error:

NOTE: XILINX_VER 14.1, script location /tool/xilinx/14.1/ISE_DS/settings64.sh
/tool/yocto/poky/build/tmp/work/ppc440-poky-linux/u-boot-xilinx-v2012.04.01-r16/temp/run.do_deploy.7879: 12: [: /tool/yocto/poky/build/tmp/work/ppc440-poky-linux/u-boot-xilinx-v2012.04.01-r16/temp/run.do_deploy.7879: unexpected operator . /tool/xilinx/14.1/ISE_DS/common/.settings64.sh /tool/xilinx/14.1/ISE_DS/common
. /tool/xilinx/14.1/ISE_DS/EDK/.settings64.sh /tool/xilinx/14.1/ISE_DS/EDK
. /tool/xilinx/14.1/ISE_DS/common/CodeSourcery/.settings64.sh /tool/xilinx/14.1/ISE_DS/common/CodeSourcery
. /tool/xilinx/14.1/ISE_DS/PlanAhead/.settings64.sh /tool/xilinx/14.1/ISE_DS/PlanAhead
. /tool/xilinx/14.1/ISE_DS/../../Vivado/2012.1/.settings64.sh /tool/xilinx/14.1/ISE_DS/../../Vivado/2012.1
. /tool/xilinx/14.1/ISE_DS/ISE/.settings64.sh /tool/xilinx/14.1/ISE_DS/ISE
. /tool/xilinx/14.1/ISE_DS/SysGen/.settings64.sh /tool/xilinx/14.1/ISE_DS/SysGen

Xilinx settings64.sh script

# Copyright (c) 1995-2012 Xilinx, Inc.  All rights reserved.

XIL_ARG_=$_
SETTINGS_FILE=.settings64.sh XIL_SCRIPT_LOC="/tool/xilinx/14.1/ISE_DS"
if [ $# != 0 ]; then
  # The first argument is the location of Xilinx Installation. # Don't detect the installation location. XIL_SCRIPT_LOC="$1"
else
  #  XIL_SCRIPT_LOC should point to script location
  if [ "$0" == "ksh" ]; then XIL_SCRIPT_LOC_TMP_UNI=readlink -f ${XIL_ARG_} else
     XIL_SCRIPT_LOC_TMP_UNI=$BASH_SOURCE
  fi
  XIL_SCRIPT_LOC_TMP_UNI=${XIL_SCRIPT_LOC_TMP_UNI%/*}
  if [ "$XIL_SCRIPT_LOC_TMP_UNI" != "" ]; then
     if [ "$XIL_SCRIPT_LOC_TMP_UNI" == "settings64.sh" ]; then XIL_SCRIPT_LOC_TMP_UNI="./"
     fi
     XIL_SCRIPT_LOC_TMP_UNI=readlink -f ${XIL_SCRIPT_LOC_TMP_UNI} if [ $? == 0 ]; then XIL_SCRIPT_LOC=${XIL_SCRIPT_LOC_TMP_UNI}
     fi
  fi
  unset XIL_SCRIPT_LOC_TMP_UNI
fi

xlnxInstLocList=""

xlnxInstLocList="${xlnxInstLocList} common" xlnxInstLocList="${xlnxInstLocList} EDK" xlnxInstLocList="${xlnxInstLocList} common/CodeSourcery" xlnxInstLocList="${xlnxInstLocList} PlanAhead" xlnxInstLocList="${xlnxInstLocList} ../../Vivado/2012.1" xlnxInstLocList="${xlnxInstLocList} ISE" xlnxInstLocList="${xlnxInstLocList} SysGen" XIL_SCRIPT_LOC_TMP_UNI=${XIL_SCRIPT_LOC}
for i in $xlnxInstLocList
do
       d="${XIL_SCRIPT_LOC_TMP_UNI}/$i" sfn="$d/$SETTINGS_FILE"
       if [ -e  "$sfn" ]; then
               echo . "$sfn" "$d"
               . "$sfn" "$d"
       fi
done

Best regards,

Elvis Dowson
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

Signature · 3 lines
Saludos
Adrian Alonso
http://aalonso.wordpress.com