Commit 7125dcd3 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

As per Maxime's request - merging helper-scripts and component_library from crazyflie

parents 1e1fdcb0 c71cdae0
......@@ -43,3 +43,9 @@
[submodule "msc-editor"]
path = msc-editor
url = https://gitrepos.estec.esa.int/taste/msc-editor.git
[submodule "stlink"]
path = stlink
url = https://github.com/texane/stlink.git
[submodule "components_library"]
path = components_library
url = https://gitrepos.estec.esa.int/taste/components_library
Subproject commit 71f95c255643069dc6dfc40be7bbd009c34e9d95
......@@ -9,4 +9,4 @@ sudo apt-get update
if [ "${ARCH}" == "x86_64" ] ; then
sudo apt-get install -y --force-yes libc6:i386 libgcc1:i386 libxft2:i386 libxss1:i386 libcairo2:i386 libc6-dev-i386
fi
sudo apt-get install -y --force-yes autoconf automake curl exuberant-ctags gcc git gnat gtkwave kate lcov libacl1 libacl1-dev libarchive-dev libattr1 libattr1-dev libbonoboui2-0 libdbd-sqlite3-perl libdbi-perl libfile-copy-recursive-perl libglib2.0-0 libgnome2-0 libgnome2-perl libgnome2-vfs-perl libgnomeui-0 libgnomevfs2-0 libgnomevfs2-common libgtk2-gladexml-perl libgtk2-perl libgraphviz-dev libmono-system-data-linq4.0-cil libmono-system-numerics4.0-cil libmono-system-runtime-serialization-formatters-soap4.0-cil libmono-system-runtime4.0-cil libmono-system-web4.0-cil libmono-system-xml4.0-cil libmono-system4.0-cil libsqlite3-dev libtool libxenomai-dev libxml-libxml-perl libxml-libxml-simple-perl libxml-parser-perl libxml2-dev libxslt1-dev libzmq3-dev mono-mcs mono-reference-assemblies-2.0 mono-runtime nedit net-tools pgadmin3 postgresql postgresql-client postgresql-client-common postgresql-common python-antlr python-coverage python-gtk2-dev python-jinja2 python-lxml python-matplotlib python-pexpect python-pip python-ply python-psycopg2 python-pygraphviz python-pyside python3-pip qemu-system sqlite3 sudo tk8.5 tree vim-gtk wmctrl xenomai-system-tools xmldiff xpdf xterm xterm zip openjdk-8-jre python3-lxml bash-completion strace libtemplates-parser11.10.1-dev libusb-1.0-0-dev cmake
sudo apt-get install -y --force-yes autoconf automake curl exuberant-ctags gcc git gnat gtkwave kate lcov libacl1 libacl1-dev libarchive-dev libattr1 libattr1-dev libbonoboui2-0 libdbd-sqlite3-perl libdbi-perl libfile-copy-recursive-perl libglib2.0-0 libgnome2-0 libgnome2-perl libgnome2-vfs-perl libgnomeui-0 libgnomevfs2-0 libgnomevfs2-common libgtk2-gladexml-perl libgtk2-perl libgraphviz-dev libmono-system-data-linq4.0-cil libmono-system-numerics4.0-cil libmono-system-runtime-serialization-formatters-soap4.0-cil libmono-system-runtime4.0-cil libmono-system-web4.0-cil libmono-system-xml4.0-cil libmono-system4.0-cil libsqlite3-dev libtool libxenomai-dev libxml-libxml-perl libxml-libxml-simple-perl libxml-parser-perl libxml2-dev libxslt1-dev libzmq3-dev mono-mcs mono-reference-assemblies-2.0 mono-runtime nedit net-tools pgadmin3 postgresql postgresql-client postgresql-client-common postgresql-common python-antlr python-coverage python-gtk2-dev python-jinja2 python-lxml python-matplotlib python-pexpect python-pip python-ply python-psycopg2 python-pygraphviz python-pyside python3-pip qemu-system sqlite3 sudo tk8.5 tree vim-gtk wmctrl xenomai-system-tools xmldiff xpdf xterm xterm zip openjdk-8-jre python3-lxml bash-completion strace libtemplates-parser11.10.1-dev libusb-1.0-0-dev cmake dfu-util
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. ${DIR}/common.sh
# Setup the stlink tools (if not there)
cd $DIR/../stlink || exit 1
make release || exit 1
STUTIL_PATH=$(realpath "${DIR}/../stlink/build/Release/src/gdbserver")
PATH_CMD='export PATH=$PATH:'"${STUTIL_PATH}"
UpdatePATH
STFLASH_PATH=$(realpath "${DIR}/../stlink/build/Release")
PATH_CMD='export PATH=$PATH:'"${STFLASH_PATH}"
UpdatePATH
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. ${DIR}/common.sh
# Fetch and install latest ASN1SCC release
LIBDIR=${PREFIX}/share/components_library
mkdir -p ${LIBDIR} || exit 1
getver() {
grep TASTE_IV_Properties::Version "$@" | head -1 | \
awk -F\" '{print $(NF-1)}'
}
cd "${DIR}"/../components_library || exit 1
for i in * ; do
# Only check folders (the components folder has files, too)
cd "${DIR}"/../components_library || exit 1
[ ! -d "$i" ] && continue
# Is it already installed?
if [ ! -d ${LIBDIR}/"$i" ] ; then
# No, install component in library
echo "[-] Installing $i in component library..."
cp -a "$i" ${LIBDIR} || exit 1
cd ${LIBDIR}/"$i" || exit 1
echo "[-] Updating ASN.1 file paths..."
taste-update-data-view *asn
else
# Yes, it is - check for updates
cd "${DIR}"/../components_library/"$i" || exit 1
NEWVER=$(getver *aadl)
cd ${LIBDIR}/"$i" || exit 1
OLDVER=$(getver *aadl)
if [ "${OLDVER}" != "${NEWVER}" ] ; then
echo "[-] Updating $i in component library..."
rm -f *
cp -a "${DIR}"/../components_library/"$i"/* .
echo "[-] Updating ASN.1 file paths..."
taste-update-data-view *asn
fi
fi
done
#!/bin/bash -e
echo TASTE ACN Editor - Use only the SAVE button - not \"Save as..\" !
# TASTE ACN File creator
if [ -t 0 ] ; then
COLORON="\e[1m\e[32m"
REDCOLORON="\e[1m\e[31m"
COLOROFF="\e[0m"
else
COLORON=""
REDCOLORON=""
COLOROFF=""
fi
DATAVIEW=DataView.asn
......@@ -19,16 +30,17 @@ then
then
DATAVIEW="$1"
else
echo Invalid dataview filename - use $(basename "$0") \<filename.asn\>
echo -e -n "${ERROR} Invalid dataview filename - "
echo use $(basename "$0") \<filename.asn\>
exit -1
fi
fi
if [ -f "$DATAVIEW" ]
then
echo Creating dummy ACN file from existing DataView.asn
echo -e "${INFO} Creating dummy ACN file from existing DataView.asn"
else
echo First create your ASN.1 data model: run taste-create-data-view
echo -e "${INFO} First create your ASN.1 data model: run taste-create-data-view"
exit -1
fi
......@@ -44,6 +56,8 @@ fi
taste-update-data-view $1
echo 'Everything went fine.
If you want to edit your ACN model, run taste-edit-acn-model
'
if [ -z $NONINTERACTIVE ]
then
echo -e "${INFO} All OK"
echo -e "${INFO} If you want to edit your ACN model, run taste-edit-acn-model"
fi
#!/bin/bash -e
echo TASTE Dataview Editor - Use only the SAVE button - not \"Save as..\" !
# TASTE Dataview Editor
if [ -t 0 ] ; then
COLORON="\e[1m\e[32m"
REDCOLORON="\e[1m\e[31m"
COLOROFF="\e[0m"
else
COLORON=""
REDCOLORON=""
COLOROFF=""
fi
INFO="${COLORON}[INFO]${COLOROFF}"
ERROR="${REDCOLORON}[ERROR]${COLOROFF}"
# Find a suitable text editor, in order of priority: kate, gvim, vi
......@@ -14,22 +27,33 @@ else
EDITOR=vi
fi
if [ -f "DataView.asn" ];
then echo Opening existing DataView.asn;
if [ -f "DataView.asn" ]
then
if [ -z $NONINTERACTIVE ]
then
echo -e "${INFO} Opening existing DataView.asn"
fi
else
echo Creating a dummy ASN.1 file with a few type examples - feel free to add, edit, delete...
if [ -z $NONINTERACTIVE ]
then
echo -e "${INFO} Creating a dummy ASN.1 file with a few type examples - feel free to add, edit, delete..."
fi
echo 'TASTE-Dataview DEFINITIONS ::=
BEGIN
IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes;
-- A few simple types to start with ASN.1
MyInteger ::= T-UInt8
-- ASN.1 Type definitions must start with an uppercase
-- Field names in records (SEQUENCE) must start with a lowercase
-- Underscores are not allowed: use dash (hyphen)
MyReal ::= REAL (0.0 .. 1000.0)
-- Simple types:
MyInteger ::= INTEGER (0..255)
MyReal ::= REAL (0.0 .. 1000.0)
MyBool ::= BOOLEAN
MyEnum ::= ENUMERATED { hello, world, how-are-you }
MyEnum ::= ENUMERATED { hello, world, howareyou }
-- Complex types:
MySeq ::= SEQUENCE {
input-data MyInteger,
......@@ -56,7 +80,7 @@ fi
if [ -z $NONINTERACTIVE ]
then
$EDITOR DataView.asn
echo Converting the data view to AADL...
echo -e "${INFO} Converting the data view to AADL..."
fi
cp $(taste-config --prefix)/share/taste-types/taste-types.asn .
......@@ -65,8 +89,8 @@ taste-update-data-view
if [ -z $NONINTERACTIVE ]
then
echo 'Everything went fine.
You can now run taste-create-interface-view or if you want to edit your data view, run taste-edit-data-view
You can also create an ACN model of your data view by typing taste-create-acn-model
'
echo -e "${INFO} Data View created"
echo -e "${INFO} Run taste-edit-data-view to edit"
echo -e "${INFO} taste-create-acn-model to specify binary encodings with ACN"
echo -e "${INFO} taste-create-project to create a new TASTE project"
fi
#!/bin/bash -e
# TASTE MSC Editor
# Create a new MSC file for a given Provided interface of a function
if [ -t 0 ] ; then
COLORON="\e[1m\e[32m"
REDCOLORON="\e[1m\e[31m"
COLOROFF="\e[0m"
else
COLORON=""
REDCOLORON=""
COLOROFF=""
fi
INFO="${COLORON}[INFO]${COLOROFF}"
ERROR="${REDCOLORON}[ERROR]${COLOROFF}"
FUNC_NAME=$1
shift
PI_NAME=$1
shift
MSC_FILENAME=$1
shift
echo -e "${INFO} Creating new MSC..."
echo -e "${INFO} Function: ${FUNC_NAME} PI: ${PI_NAME} Output: ${MSC_FILENAME}"
EDITOR=taste-msc-editor
echo 'msc testcase;
end testcase;
' > $MSC_FILENAME
if [ -z $NONINTERACTIVE ]
then
$EDITOR -o $MSC_FILENAME
fi
if [ -z $NONINTERACTIVE ]
then
echo -e "${INFO} MSC created"
echo -e "${INFO} Run taste-edit-msc ${MSC_FILENAME} to edit"
fi
#!/bin/bash -e
echo 'TASTE Project Creator - Use only the SAVE button - not \"Save as..\" !'
echo 'TASTE Project Creator'
if [ -t 0 ] ; then
COLORON="\e[1m\e[32m"
REDCOLORON="\e[1m\e[31m"
COLOROFF="\e[0m"
else
COLORON=""
REDCOLORON=""
COLOROFF=""
fi
INFO="${COLORON}[INFO]${COLOROFF}"
ERROR="${REDCOLORON}[ERROR]${COLOROFF}"
if [ -f InterfaceView.aadl ]
then
echo 'InterfaceView.aadl already exists. Use taste-edit-project instead.'
exit 0
echo -e "${ERROR} InterfaceView.aadl already exists. Use taste-edit-project instead."
exit 1
fi
if [ ! -f DataView.aadl ]
then
echo 'Creating a default ASN.1 data model.'
echo -e "${INFO} Creating a default ASN.1 data model."
NONINTERACTIVE=1 taste-create-data-view
NONINTERACTIVE=1 taste-create-acn-model
else
echo Using existing DataView.aadl
echo -e "${INFO} Using existing DataView.aadl"
fi
# Add the components from the components library
FIRST=1
LIBDIR=$(taste-config --prefix)/share/components_library
for each in $LIBDIR/*
do
if [ $FIRST -eq 1 ]
then
EXTRA_CMD+='--edit-aadl '
else
EXTRA_CMD+=,
fi
EXTRA_CMD+=$each/interfaceview.aadl
FIRST=0
done
# Invoke the GUI from Ellidiss
TASTE --data-view DataView.aadl \
echo -e "${INFO} Running "
echo " TASTE $EXTRA_CMD
--data-view DataView.aadl
--load-interface-view InterfaceView.aadl
--load-deployment-view DeploymentView.aadl
--aadl-library $(taste-config --prefix)/share/ocarina/AADLv2/ocarina_components.aadl
"
TASTE $EXTRA_CMD \
--data-view DataView.aadl \
--load-interface-view InterfaceView.aadl \
--load-deployment-view DeploymentView.aadl \
--aadl-library $(taste-config --prefix)/share/ocarina/AADLv2/ocarina_components.aadl
......
#!/bin/bash -e
# TASTE MSC Editor
# Edit a MSC file
if [ -t 0 ] ; then
COLORON="\e[1m\e[32m"
REDCOLORON="\e[1m\e[31m"
COLOROFF="\e[0m"
else
COLORON=""
REDCOLORON=""
COLOROFF=""
fi
INFO="${COLORON}[INFO]${COLOROFF}"
ERROR="${REDCOLORON}[ERROR]${COLOROFF}"
MSC_FILENAME=$1
echo -e "${INFO} Opening MSC Editor..."
echo -e "${INFO} Filename: ${MSC_FILENAME}"
EDITOR=taste-msc-editor
if [ -z $NONINTERACTIVE ]
then
$EDITOR -o $MSC_FILENAME
fi
#!/bin/bash
if [ -t 0 ]
then
COLORON="\e[1m\e[32m"
REDCOLORON="\e[1m\e[31m"
COLOROFF="\e[0m"
else
COLORON=""
REDCOLORON=""
COLOROFF=""
fi
INFO="${COLORON}[INFO]${COLOROFF}"
ERROR="${REDCOLORON}[ERROR]${COLOROFF}"
if [ -f InterfaceView.aadl ]
then
echo 'Opening TASTE project'
echo -e "${INFO} Opening TASTE project"
INTERFACEVIEW=InterfaceView.aadl
else
echo Error: missing InterfaceView.aadl
echo First use taste-create-project to start a new project
echo -e "${ERROR} Missing InterfaceView.aadl"
echo -e "${ERROR} First use taste-create-project to start a new project"
exit 1
fi
grep -i taste-directives.aadl "$INTERFACEVIEW" >/dev/null && {
echo Your interface view needs to be upgraded\!
echo Please upgrade it with:
echo -e "${ERROR} Your interface view needs to be upgraded\!"
echo " Please upgrade it with:"
echo
echo " taste-upgrade-IF-view oldIFview newIFview"
echo " taste-upgrade-IF-view oldIFview newIFview"
echo
echo ...and use the newIFview instead.
echo " ...and use the newIFview instead."
exit 1
}
echo TASTE Project Editor - Use only the SAVE button - not \"Save as..\" !
# If there is no deployment view, only load interface view
EXTRA_CMD=
if [ ! -f DeploymentView.aadl ]
then
EXTRA_CMD+=--load-interface-view
EXTRA_CMD+=' InterfaceView.aadl'
EXTRA_CMD+=' --aadl-library $(taste-config --prefix)/share/ocarina/AADLv2/ocarina_components.aadl'
EXTRA_CMD+=' --aadl-library $(taste-config --prefix)/share/ocarina/AADLv2/ocarina_components.aadl '
else
EXTRA_CMD=
fi
echo TASTE $EXTRA_CMD --data-view DataView.aadl --load-deployment-view DeploymentView.aadl
TASTE $EXTRA_CMD --data-view DataView.aadl --load-deployment-view DeploymentView.aadl
# Add the components from the components library
FIRST=1
LIBDIR=$(taste-config --prefix)/share/components_library
for each in $LIBDIR/*
do
if [ $FIRST -eq 1 ]
then
EXTRA_CMD+='--edit-aadl '
else
EXTRA_CMD+=,
fi
EXTRA_CMD+=$each/interfaceview.aadl
FIRST=0
done
echo -e "${INFO} Running
TASTE $EXTRA_CMD
--load-deployment-view DeploymentView.aadl
"
TASTE $EXTRA_CMD --load-deployment-view DeploymentView.aadl
......@@ -10,9 +10,9 @@ if [ ! -f "$1" ]
then
if [ -f InterfaceView.aadl ]
then
INTERFACEVIEW=InterfaceView.aadl
INTERFACEVIEW=InterfaceView.aadl
else
echo 'Error: interface view not found
echo 'Error: interface view not found
Usage: [FORCE=1] taste-generate-skeletons [InterfaceView.aadl] [output-directory]'
exit -1
fi
......
......@@ -2,6 +2,19 @@
echo TASTE Data View Convertor - From ASN.1 to AADLV2
if [ -t 0 ] ; then
COLORON="\e[1m\e[32m"
REDCOLORON="\e[1m\e[31m"
COLOROFF="\e[0m"
else
COLORON=""
REDCOLORON=""
COLOROFF=""
fi
INFO="${COLORON}[INFO]${COLOROFF}"
ERROR="${REDCOLORON}[ERROR]${COLOROFF}"
# User may pass several ASN.1 files as parameters
for f in $@
do
......@@ -11,16 +24,16 @@ do
then
if [ ! -f "$f" ]
then
echo File not found: $f
echo -e "${INFO} File not found: ${f}"
exit 1
else
echo Using file: $f
echo -e "${INFO} Using file: ${f}"
filename=$(readlink -e "$f")
DATAVIEW+="$filename "
acnfile=$(readlink -e "${f%.*}.acn")
if [ -f "$acnfile" ]
then
echo Using ACN file: $acnfile
echo -e "${INFO} Using ACN file: ${acnfile}"
DATAVIEW+="$acnfile "
fi
fi
......@@ -32,16 +45,16 @@ if [ -z "$(echo -n $DATAVIEW)" ]
then
if [ -f DataView.asn ]
then
echo 'Using file: DataView.asn'
echo -e "${INFO} Using file: DataView.asn"
DATAVIEW=$(readlink -e DataView.asn)
else
echo Error: no data view found
echo 'Usage: taste-update-data-view <set of ASN.1 files>'
>&2 echo -e "${ERROR} No data view found"
echo -e "${INFO} Usage: taste-update-data-view <set of ASN.1 files>"
exit 1
fi
if [ -f DataView.acn ]
then
echo 'Using file: DataView.acn'
echo -e "${INFO} Using file: DataView.acn"
DATAVIEW+=" $(readlink -e DataView.acn)"
fi
fi
......@@ -51,26 +64,28 @@ AADL=DataView.aadl
if [ -f __ExtraTypes.asn ]
then
echo 'Using file: __ExtraTypes.asn'
echo -e "${INFO} Using file: __ExtraTypes.asn"
DATAVIEW+=" $(readlink -e "__ExtraTypes.asn")"
fi
if [ -f __ExtraTypes.acn ]
then
echo 'Using file: __ExtraTypes.acn'
echo -e "${INFO} Using file: __ExtraTypes.acn"
DATAVIEW+=" $(readlink -e "__ExtraTypes.acn")"
fi
DATAVIEW+=" $(taste-config --prefix)/share/taste-types/taste-types.asn"
asn2aadlPlus $DATAVIEW "$AADL" -aadlv2
if [ "$?" = "1" ]
then
echo 'ERROR: Impossible to convert the dataview from ASN.1 to AADL' > /dev/stderr
>&2 echo -e "${ERROR} Impossible to convert the dataview from ASN.1 to AADL"
echo -e "${INFO} Command: asn2aadlPlus ${DATAVIEW} ${AADL} -aadlv2"
exit 1
else
echo All OK
echo -e "${INFO} All OK"
exit 0
fi
Subproject commit 5c10d4b83a4703edb492c76f1427c4a4e1a568b1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment