Commit 345f1b34 authored by Ralf Stemmer's avatar Ralf Stemmer

MPSoC Scripts added

parent 29c9915a
BuildScripts.tar.gz
11.03.19 - MPSoC build scripts added
07.03.19 - Cross compiler build scripts added
#!/usr/bin/env bash
cd ./src
tar -cf ../BuildScripts.tar *
cd ..
gzip BuildScripts.tar
#!/usr/bin/env bash
#
# Version: 1.0.0
#
# Changelog:
# 1.0.0 - 11.03.19: First release
#
# Contributors:
# Ralf Stemmer - ralf.stemmer@uni-oldenburg.de
#
source ./scripts/settings.sh
LIBPATHS="-L$SDKDIR/lib"
INCLUDEPATHS="-I$SDKDIR/include"
CFLAGS="-O0 -c -Wall -fmessage-length=0 -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -DFSBL_DEBUG -DFSBL_DEBUG_INFO"
LFLAGS="-mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -Wl,-build-id=none"
GCC=arm-none-eabi-gcc
if [ -d "$SW_BUILDDIR" ] ; then
echo -e -n "\e[1;34mRemoving old object-files: "
find "$SW_BUILDDIR" -type f -name "*.o" -delete
echo -e "\e[1;32m✔\e[0m"
fi
mkdir -p $SW_BUILDDIR
function CompileForProcessor
{
# Compile
echo -e "\e[1;36mCompiling for ARM CortexA9 $1 \e[0;36m…\e[0m"
echo -e -n "\e[1;34m$SDKDIR/include/arm$1: "
if [ ! -d "$SDKDIR/include/arm$1" ] ; then
echo -e "\e[1;31m$SDKDIR/include/arm$1 missing! Rebuild SDK or check ARM number!"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
mkdir -p $SW_BUILDDIR/arm$1
SOURCES=$(find $SW_SRCDIR/arm$1 -type f -name "*.[c,S]")
for s in $SOURCES ;
do
echo -e -n "\e[1;34m - $s\e[0m "
FILENAME="${s##*/}"
OBJFILE="${FILENAME%.*}.o"
$GCC $CFLAGS $LIBPATHS $INCLUDEPATHS -I$SDKDIR/include/arm$1 -I$SW_SRCDIR/arm$1 -I$SW_SRCDIR/share -c -o "$SW_BUILDDIR/arm$1/$OBJFILE" $s
if [ $? -ne 0 ] ; then
echo -e "\e[1;31m$GCC FAILED!\e[0m"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
done
}
# Get ARM cores
ARCHITECTURE=$(echo 'cat //Project/SYSTEMINFO/@ARCH' | xmllint --shell "$SDK_SYSTEMDEF" | grep ARCH | grep -v cat | cut -d "\"" -f 2)
if [ "$ARCHITECTURE" == "zynq" ] ; then
ARMCOUNT=2
else
echo -e "\e[1;33mThere are no ARM cores on the $ARCHITECTURE plattform!"
exit 0
fi
# Compile firmware for each ARM
for ARMNR in $(seq 0 $((ARMCOUNT - 1)) ) ; do
# Only compile if there is source code
if [ ! -d "$SW_SRCDIR/arm$ARMNR" ] ; then
echo -e "\e[1;33mThere is no source code for ARM$ARMNR! \e[1;30m(Skipping)\e[0m"
continue
fi
CompileForProcessor $ARMNR
done
# Linken
function LinkFirmwareForProcessor
{
SOURCEDIR="$SW_SRCDIR/arm$1"
PROCSOURCES=$(find $SW_BUILDDIR/arm$1 -type f -name "*.o")
FIRMWARE="$OUTPUTDIR/firmware_arm$1.elf"
# prefere explicit linker script. Use SDK generated as fallback
if [ -f $SOURCEDIR/ldscript.ld ] ; then
LINKSCRIPT="$SOURCEDIR/ldscript.ld"
elif [ -f $SOURCEDIR/lscript.ld ] ; then # SDK uses lscript as name
LINKSCRIPT="$SOURCEDIR/lscript.ld"
else
LINKSCRIPT="$SDKDIR/ldscript_arm$1.ld"
fi
echo -e "\e[1;36mLinking \e[0;36m$SW_FIRMWARE\e[1;34m: "
echo -e -n "\e[1;34m$LINKSCRIPT: "
if [ ! -f "$LINKSCRIPT" ] ; then
echo -e "\e[1;31m$LINKSCRIPT missing! Rebuild SDK or check ARM number!"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
echo -e -n "\e[1;34m$SDKDIR/lib/arm$1: "
if [ ! -d "$SDKDIR/lib/arm$1" ] ; then
echo -e "\e[1;31m$SDKDIR/lib/arm$1 missing! Rebuild SDK or check ARM number!"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
echo -e -n "\e[1;34mLinking… "
$GCC -Wl,-T -Wl,$LINKSCRIPT $LFLAGS $LIBPATHS -L$SDKDIR/lib/arm$1 -o $FIRMWARE $PROCSOURCES -lps7init \
-Wl,--start-group,-lxil,-lgcc,-lc,--end-group \
-Wl,--start-group,-lxilffs,-lxil,-lgcc,-lc,--end-group
if [ $? -ne 0 ] ; then
echo -e "\e[1;31mFAILED!\e[0m"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
chmod -x $FIRMWARE
}
# Link firmware for each microblaze
for ARMNR in $(seq 0 $((ARMCOUNT - 1)) ) ; do
# Only compile if there is source code
if [ ! -d "$SW_SRCDIR/arm$ARMNR" ] ; then
echo -e "\e[1;33mThere is no source code for ARM$ARMNR! \e[1;30m(Skipping)\e[0m"
continue
fi
LinkFirmwareForProcessor $ARMNR
done
echo -e "\e[1;32mNew ARM binary built.\e[0m"
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#!/usr/bin/env bash
#
# Version: 1.0.0
#
# Changelog:
# 1.0.0 - 11.03.19: First release
#
# Contributors:
# Ralf Stemmer - ralf.stemmer@uni-oldenburg.de
#
source ./scripts/settings.sh
LIBPATHS="-L$SDKDIR/lib"
LIBS="-lxil -lgloss -lgcc -lc"
INCLUDEPATHS="-I$SDKDIR/include"
CFLAGS="-O0 -c -mcpu=v9.6 -mlittle-endian -mxl-soft-mul"
LFLAGS="-Wl,--no-relax -mcpu=v9.6 -mlittle-endian -mxl-soft-mul"
GCC=mb-gcc
OBJCOPY=mb-objcopy
if [ -f "$SW_SRCDIR/setup.sh" ] ; then
echo -e -n "\e[1;34mLoading software specific setup: "
source $SW_SRCDIR/setup.sh
echo -e "\e[1;32m✔\e[0m"
fi
if [ -d "$SW_BUILDDIR" ] ; then
echo -e -n "\e[1;34mRemoving old object-files: "
find "$SW_BUILDDIR" -type f -name "*.o" -delete
echo -e "\e[1;32m✔\e[0m"
fi
mkdir -p $SW_BUILDDIR
# Compile shared code
echo -e "\e[1;36mCompiling shared code \e[0;36m…\e[0m"
mkdir -p $SW_BUILDDIR/share
SOURCES=$(find $SW_SRCDIR/share -type f -name "*.c")
for s in $SOURCES ;
do
echo -e -n "\e[1;34m - $s\e[0m "
FILENAME="${s##*/}"
OBJFILE="${FILENAME%.*}.o"
$GCC $CFLAGS $LIBPATHS $INCLUDEPATHS -I$SW_SRCDIR/share -c -o "$SW_BUILDDIR/share/$OBJFILE" $s
if [ $? -ne 0 ] ; then
echo -e "\e[1;31m$GCC FAILED!\e[0m"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
done
# First argument must be the number of the processor ("0", "1", …)
# Second argument can be an address with a dot as prefix (".4000000", ".C0000000")
function CompileForProcessor
{
MBNUM=${1}
ADDRESS=${2:-""}
SDKINCLUDE="$SDKDIR/include/mb$MBNUM"
if [ -z $ADDRESS ] ; then
SOURCEDIR="$SW_SRCDIR/mb${MBNUM}"
BUILDDIR="$SW_BUILDDIR/mb${MBNUM}"
else
SOURCEDIR="$SW_SRCDIR/mb${MBNUM}.${ADDRESS}" # leads to …/mb0.40000000
BUILDDIR="$SW_BUILDDIR/mb${MBNUM}.${ADDRESS}"
fi
echo -e "\e[1;36mCompiling for MicroBlaze $MBNUM \e[1;35m$ADDRESS\e[0m"
# Check environment
echo -e "\e[1;34mChecking source environment"
echo -e -n "\t\e[1;34m$SDKINCLUDE: "
if [ ! -d "$SDKINCLUDE" ] ; then
echo -e "\e[1;31m$SDKINCLUDE missing! Rebuild SDK or check MicroBlaze number!"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
echo -e -n "\t\e[1;34m$SOURCEDIR: "
if [ ! -d "$SOURCEDIR" ] ; then
echo -e "\e[1;31m$SOURCEDIR missing! Check MicroBlaze number and/or address!"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
mkdir -p $BUILDDIR
# Compile
SOURCES=$(find $SOURCEDIR -type f -name "*.c")
for s in $SOURCES ;
do
echo -e -n "\e[1;34m - $s\e[0m "
FILENAME="${s##*/}"
OBJFILE="${FILENAME%.*}.o"
$GCC $CFLAGS $LIBPATHS $INCLUDEPATHS -I$SDKINCLUDE -I$SOURCEDIR -I$SW_SRCDIR/share -c -o "$BUILDDIR/$OBJFILE" $s
if [ $? -ne 0 ] ; then
echo -e "\e[1;31m$GCC FAILED!\e[0m"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
done
}
# Linken
# First argument must be the number of the processor ("0", "1", …)
# Second argument can be an address with a dot as prefix (".4000000", ".C0000000")
function LinkFirmwareForProcessor
{
MBNUM=${1}
ADDRESS=${2:-""}
#SDKINCLUDE="$SDKDIR/include/mb$MBNUM"
if [ -z $ADDRESS ] ; then
SOURCEDIR="$SW_SRCDIR/mb${MBNUM}"
BUILDDIR="$SW_BUILDDIR/mb${MBNUM}"
FIRMWARE="$OUTPUTDIR/firmware_mb${MBNUM}.elf"
# prefere explicit linker script. Use SDK generated as fallback
if [ -f $SOURCEDIR/ldscript.ld ] ; then
LINKSCRIPT="$SOURCEDIR/ldscript.ld"
else
LINKSCRIPT="$SDKDIR/ldscript_mb$MBNUM.ld"
fi
else
SOURCEDIR="$SW_SRCDIR/mb${MBNUM}.${ADDRESS}" # leads …/mb0.40000000
BUILDDIR="$SW_BUILDDIR/mb${MBNUM}.${ADDRESS}"
FIRMWARE="$OUTPUTDIR/firmware_mb${MBNUM}.${ADDRESS}.elf"
LINKSCRIPT="$SOURCEDIR/ldscript.ld"
fi
PROCSOURCES=$(find $BUILDDIR -type f -name "*.o")
SHARSOURCES=$(find $SW_BUILDDIR/share -type f -name "*.o")
echo -e "\e[1;36mLinking \e[0;36m$FIRMWARE\e[1;34m: "
# Check environment
echo -e "\e[1;34mChecking source environment"
echo -e -n "\t\e[1;34mLinker script $LINKSCRIPT: "
if [ ! -f "$LINKSCRIPT" ] ; then
echo -e "\e[1;31m$LINKSCRIPT missing! Rebuild SDK or check MicroBlaze number!"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
echo -e -n "\t\e[1;34mHAL $SDKDIR/lib/mb$MBNUM: "
if [ ! -d "$SDKDIR/lib/mb$MBNUM" ] ; then
echo -e "\e[1;31m$SDKDIR/lib/mb$MBNUM missing! Rebuild SDK or check MicroBlaze number!"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
echo -e -n "\e[1;34mLinking "
$GCC -Wl,-T -Wl,$LINKSCRIPT $LFLAGS $LIBPATHS -L$SDKDIR/lib/mb$MBNUM -o $FIRMWARE $PROCSOURCES $SHARSOURCES $LIBS
if [ $? -ne 0 ] ; then
echo -e "\e[1;31mFAILED!\e[0m"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
$OBJCOPY -O binary $FIRMWARE ${FIRMWARE%.*}.bin
chmod -x $FIRMWARE
chmod -x ${FIRMWARE%.*}.bin
}
# Count microblazes
MICROBLAZECOUNT=$( grep InstPath $SDK_MEMORYINFO | grep -i microblaze | wc -l )
# Build main firmware for each MicroBlaze
for MBNR in $(seq 0 $((MICROBLAZECOUNT - 1)) ) ; do
CompileForProcessor $MBNR
LinkFirmwareForProcessor $MBNR
done
# Now scan source directory for additional firmware mapped to different memory
MAPPINGS=$(find $SW_SRCDIR -type d -name "mb*.*" -printf "%f\n")
for m in $MAPPINGS ; do
MB=${m%.*}
MB=${MB:2}
ADDR=${m:4}
CompileForProcessor $MB $ADDR
LinkFirmwareForProcessor $MB $ADDR
done
echo -e "\e[1;32mNew System built.\e[0m"
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#!/usr/bin/env python3
#
# Version: 1.0.0
#
# Changelog:
# 1.0.0 - 11.03.19: First release
#
# Contributors:
# Ralf Stemmer - ralf.stemmer@uni-oldenburg.de
#
import sys
import os
import time
import argparse
import binascii
try:
from serial import *
except:
print("\033[1;31mModule \033[1;37mpyserial \033[1;31mmissing!")
print("\033[1;34m Try \033[1;36mpip\033[1;30m3\033[1;36m install pyserial\033[1;34m as root to install it.\033[1;30m")
exit(1)
ShutdownReceiver = False
cli = argparse.ArgumentParser(
description="Reader for SDF time measurement values.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
cli.add_argument("-s", "--silent", default=False, action="store_true",
help="Do not show progress")
cli.add_argument("datadevice", type=str, action="store",
help="Path to the serial communication device for reading measurement data.")
cli.add_argument("n", type=str, action="store",
help="Number of measurements.")
cli.add_argument("outfile", type=str, action="store",
help="Path where the measured data will be stored.")
class HEADER(object):
def __init__(self, headerbyte):
if type(headerbyte) != bytes:
raise TypeError("Header-Byte should be of type bytes as returned by uart.read(1)!")
header = int.from_bytes(headerbyte, byteorder="little", signed=False)
self.sync = (header >> 7) & 1
self.first = (header >> 6) & 1
self.zero = (header >> 5) & 1
self.overflow = (header >> 4) & 1
self.tmberror = (header >> 3) & 1
self.tmcerror = (header >> 2) & 1
self.size = (header >> 0) & 3
def isValid(self):
if self.sync != 1:
return False
if self.zero != 0:
return False
return True
def hasErrorFlags(self):
if self.overflow == 1:
return True
if self.tmberror == 1:
return True
if self.tmcerror == 1:
return True
return False
def GetDataSize(self):
return self.size + 1
class PACKET(object):
def __init__(self, header):
if type(header) != HEADER:
raise TypeError("header must be an instance of class HEADER!")
self.header = header
self.data = 0
def AddByte(self, position, byte):
if type(position) != int:
raise TypeError("position must be of type int")
if type(byte) != bytes:
raise TypeError("byte must be of type bytes")
byte = int.from_bytes(byte, byteorder="little", signed=False)
if (byte >> 7) == 1:
raise ValueError("Invalid Sync-Bit. Bit is set to 1 but should be 0 for data bytes!")
if position >= self.header.GetDataSize():
raise ValueError("Position of byte exceeds range of expected bytes regarding packet header")
self.data |= (int(byte&0x7F) << (position*7))
def ReadPacket(uart):
# 1.: Read Header (Skip byte if not header)
header = None
while True:
try:
byte = uart.read(1)
except Exception as e:
print("\033[1;31mReading byte from UART failed!\033[0m")
raise(e)
header = HEADER(byte)
if header.isValid():
break
print("\033[1;33mInvalid Header \033[1;35m%s\033[1;33m: "%(byte.hex()), end="")
if header.sync == 0:
print("\033[1;33mSync-Bit is 0 \033[1;30m(This is a data-byte. Will be dropped.)")
continue
if header.zero != 0:
print("\033[1;31mSync-Bit and Zero-Bit are 1 \033[1;30m(This should never happen! Physical error?)")
raise ValueError("Sync-Bit and Zero-Bit are 1")
packet = PACKET(header)
# 2.: Read data bytes
for i in range(header.GetDataSize()):
try:
byte = uart.read(1)
except Exception as e:
print("\033[1;31mReading byte from UART failed!\033[0m")
raise(e)
try:
packet.AddByte(i, byte)
except Exception as e:
print("\033[1;31mAdding byte to time value failed with error %s!\033[0m"%(str(e)))
raise(e)
return packet
if __name__ == '__main__':
# handle command line arguments
args = cli.parse_args()
DATADEVICE = args.datadevice
OUTFILE = args.outfile
N = int(args.n)
SILENT = bool(args.silent)
# Open terminal device
try:
datauart = Serial(
port = DATADEVICE,
baudrate= 115200,
xonxoff = 0,
rtscts = 0,
interCharTimeout=None
)
except Exception as e:
print("\033[1;31mAccessing \033[1;37m" + DEVICE + " \033[1;31mfailed with the following excpetion:\033[0m")
print(e)
exit(1)
try:
outfile = open(OUTFILE, "w")
except Exception as e:
print("\033[1;31mAccessing \033[1;37m" + OUTFILE + " \033[1;31mfailed with the following excpetion:\033[0m")
print(e)
exit(1)
fails = 0
for i in range(N+1):
# Check fails-state
if fails > 100:
print("\033[1;33mUnexpected high error rate of %i times in a row!\033[0m"%(fails))
print("\033[1;31mExiting...\033[0m")
datauart.close()
outfile.close()
exit(2)
# Show progress
if not SILENT:
print("\033[1;30mGetTime: \033[1;34m[\033[0;36m%2i%%\033[1;30m %7i\033[1;34m]\033[0m"%(int((i*100)/(N+1)), i), end=" ")
# Read Packet
try:
packet = ReadPacket(datauart)
except Exception as e:
fails += 1
if not SILENT:
print("\033[1;31m(%s)\033[0m"%(str(e)))
continue
# Create file entry
header = packet.header
value = packet.data
if header.hasErrorFlags():
errorlist = list()
if header.overflow:
errorlist.append("overflow")
if header.tmberror:
errorlist.append("tmberror")
if header.tmcerror:
errorlist.append("tmcerror")
fails += 1
line = ",".join(errorlist) + "\n"
else:
fails = 0
line = str(value) + "\n"
if not SILENT:
value = packet.data
print("\033[1;30m0x%X\033[1;35m -> \033[1;37m%i\033[0m"%(value, value), end="")
if header.first:
print(" \033[1;33mFirst Packet", end="")
sys.stdout.flush()
outfile.write(line)
if not SILENT:
print("\033[0m")
time.sleep(0.1);
datauart.close()
outfile.close()
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#!/usr/bin/env bash
#
# Version: 1.0.0
#
# Changelog:
# 1.0.0 - 11.03.19: First release
#
# Contributors:
# Ralf Stemmer - ralf.stemmer@uni-oldenburg.de
#
source ./scripts/settings.sh
# Check environment
if [ -d "$SDKDIR" ] ; then
echo -e "\e[1;31mSDK-Directory $SDKDIR does already exist."
echo -e "\e[1;30mTo create a new SDK, the old one must be removed manually."
exit 1
fi
if [ -d "$XSDKSDKDIR" ] ; then
echo -e "\e[1;31mXSDK-SDK-Directory $XSDKSDKDIR does already exist."
echo -e "\e[1;30mTo create a new SDK, the old one must be removed manually."
exit 1
fi
# Prepare environment
echo -e -n "\e[1;34mCreating SDK tree in \e[0;36m$SDKDIR\e[1;34m: "
mkdir -p $SDKDIR/lib
if [ $? -ne 0 ] ; then
echo -e "\e[1;31mFAILED!\e[0m"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
# Extract System Definitions from Vivado Project
echo -e -n "\e[1;34mFinding System Definition "
SYSDEF=$(find $OUTPUTDIR/$PROJECTNAME.runs -name "*.sysdef" -print)
cp $SYSDEF $SDKDIR/sysdef.zip
if [ $? -ne 0 ] ; then
echo -e "\e[1;31mFAILED!\e[0m"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
echo -e "\e[1;34mExtracting System Definition \e[0;36m$SYSDEF\e[0m"
unzip $SDKDIR/sysdef.zip -d $SDKDIR/.
if [ $? -ne 0 ] ; then
echo -e "\e[1;31munzip FAILED!\e[0m"
exit 1
fi
# Create Memorymap
echo -e -n "\e[1;34mCreating MemoyMap \e[0;36m$SDK_MEMORYMAP\e[1;34m: "
xsltproc ./scripts/memorymap.xslt $SDKDIR/$HARDWARENAME.hwh > $SDK_MEMORYMAP
if [ $? -ne 0 ] ; then
echo -e "\e[1;31mFAILED!\e[0m"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
# Check if the Synthesis process was successful
echo -e -n "\e[1;34m$HARDWAREDEF: "
if [ ! -f "$HARDWAREDEF" ] ; then
echo -e "\e[1;31m$HARDWAREDEF missing! Did you export the Hardware?"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
# Renaming Memory-Info file
MEMINFOR=$( find $SDKDIR -name "*.mmi" -print)
echo -e -n "\e[1;34m$SDK_MEMORYINFO: "
mv $MEMINFOR $SDK_MEMORYINFO
if [ $? -ne 0 ] ; then
echo -e "\e[1;31mFAILED!\e[0m"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
# Make everything clean
BITSTREAM=$(find $SDKDIR -name "*.bit" -print)
echo -e -n "\e[1;34m$SDK_BITFILE: "
mv $BITSTREAM $SDK_BITFILE
if [ $? -ne 0 ] ; then
echo -e "\e[1;31mFAILED!\e[0m"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
echo -e -n "\e[1;34m$SDK_HARDWAREDEF: "
cp $HARDWAREDEF $SDK_HARDWAREDEF
if [ $? -ne 0 ] ; then
echo -e "\e[1;31mFAILED!\e[0m"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
echo -e -n "\e[1;34mChecking Architecture "
# Get Architecture
# Source: https://stackoverflow.com/questions/25508512/shellscript-read-xml-attribute-value
ARCHITECTURE=$(echo 'cat //Project/SYSTEMINFO/@ARCH' | xmllint --shell "$SDK_SYSTEMDEF" | grep ARCH | grep -v cat | cut -d "\"" -f 2)
if [ "$ARCHITECTURE" == "zynq" ] ; then
ARMCOUNT=2
else
ARMCOUNT=0
fi
# Count microblazes
MICROBLAZECOUNT=$( grep InstPath $SDK_MEMORYINFO | grep -i microblaze | wc -l )
# Print architecture details
echo -e "\e[1;32m✔\e[1;34m ➔ \e[1;35m$ARCHITECTURE\e[0m"
echo -e "\e[1;34mCores:"
echo -e "\e[1;34m\tMicroBlazes: \e[0;36m$MICROBLAZECOUNT"
echo -e "\e[1;34m\tARM Cores: \e[0;36m$ARMCOUNT"
if [ "$ARCHITECTURE" == "zynq" ] ; then
# Create SDK for ARM core 0
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21:/usr/local/lib $XSDK -batch -source $CREATEARMSDK_SCRIPT -tclargs 0
# Compile SDK for ARM core 0
CWD=$(pwd)
cd $XSDKSDKDIR/board_arm0
echo -e "\e[1;34mBuilding Board-Driver for ARM CortexA9 0\e[0m"
make --silent > /dev/null
if [ $? -ne 0 ] ; then
echo -e "\e[1;31mmake FAILED!\e[0m"
exit 1
else
echo -e "\e[0;32mmake succeeded.\e[0m"
fi
cd $CWD
# Exporting SDK
LIBDIR=$SDKDIR/lib/arm0
INCDIR=$SDKDIR/include/arm0
mkdir -p $LIBDIR
mkdir -p $INCDIR
echo -e "\e[1;34mOrganize SDK directory for ARM CortexA9 0\e[0m"
echo -e -n "\t\e[1;34m$LIBDIR: "
cp -r $XSDKSDKDIR/board_arm0/ps7_cortexa9_0/lib/*.a $LIBDIR/.
if [ $? -ne 0 ] ; then
echo -e "\e[1;31mFAILED!\e[0m"
exit 1
else
echo -e "\e[1;32m✔\e[0m"
fi
echo -e -n "\t\e[1;34m$INCDIR: "
cp -r $XSDKSDKDIR/board_arm0/ps7_cortexa9_0/include/* $INCDIR/.
if [ $? -ne 0 ] ; then
echo -e "\e[1;31mFAILED!\e[0m"
exit 1