Commit 312aa166 authored by Maxime Perrotin's avatar Maxime Perrotin

Update Demo-opengeode

parent a32b3a33
#!/bin/bash #!/bin/bash -e
# This script will build your TASTE system. # This script will build your TASTE system.
# You should check it before running it to make it fit with your context: # You should not change this file as it was automatically generated.
# 1) You may need to fix some paths and filenames (path to interface/deployment views)
# 2) You may need to specify additional paths for the compiler to find .h file
# (e.g. "export C_INCLUDE_PATH=/usr/include/xenomai/analogy/:$C_INCLUDE_PATH")
# 3) You may need to link with pre-built libraries, using the -l option
# (e.g. -l /usr/lib/libanalogy.a,/usr/lib/librtdm.a)
# 4) You may need to change the runtime (add -p flag to select PolyORB-HI-C)
# etc.
# Note: TASTE will not overwrite your changes - if you need to update some parts # If you need additional preprocessing, there are three hook files
# you will have to merge the changes with the newly-created file. # that you can provide and that are called dring the build:
# user_init_pre.sh, user_init_post.sh and user_init_last.sh
# These files will never get overwritten by TASTE.'
# Inside these files you may set some environment variables:
# C_INCLUDE_PATH=/usr/include/xenomai/analogy/:${C_INCLUDE_PATH}
# unset USE_POHIC
CWD=$(pwd)
if [ -t 1 ] ; then
COLORON="\e[1m\e[32m"
COLOROFF="\e[0m"
else
COLORON=""
COLOROFF=""
fi
INFO="${COLORON}[INFO]${COLOROFF}"
if [ -f user_init_pre.sh ]
then
echo -e "${INFO} Executing user-defined init script"
source user_init_pre.sh
fi
# Set up the cache to limit the calls to ASN1SCC in DMT tools
mkdir -p .cache mkdir -p .cache
export PROJECT_CACHE=$(pwd)/.cache export PROJECT_CACHE=$(pwd)/.cache
# Use PolyORB-HI-C runtime
USE_POHIC=1
# Set Debug mode by default
DEBUG_MODE=--debug
# Detect models from Ellidiss tools v2, and convert them to 1.3
INTERFACEVIEW=InterfaceView.aadl
grep "version => \"2" InterfaceView.aadl >/dev/null && {
echo -e "${INFO} Converting interface view from V2 to V1.3"
TASTE --load-interface-view InterfaceView.aadl --export-interface-view-to-1_3 __iv_1_3.aadl
INTERFACEVIEW=__iv_1_3.aadl
};
if [ -z "$DEPLOYMENTVIEW" ] if [ -z "$DEPLOYMENTVIEW" ]
then then
DEPLOYMENTVIEW=DeploymentView.aadl DEPLOYMENTVIEW=DeploymentView.aadl
fi fi
# Detect models from Ellidiss tools v2, and convert them to 1.3
grep "version => \"2" "$DEPLOYMENTVIEW" >/dev/null && {
echo -e "${INFO} Converting deployment view from V2 to V1.3"
TASTE --load-deployment-view "$DEPLOYMENTVIEW" --export-deployment-view-to-1_3 __dv_1_3.aadl
DEPLOYMENTVIEW=__dv_1_3.aadl
};
SKELS="./" SKELS="./"
# Check if Dataview references existing files
mono $(which taste-extract-asn-from-design.exe) -i "$INTERFACEVIEW" -j /tmp/dv.asn
# Generate code for OpenGEODE function orchestrator # Generate code for OpenGEODE function orchestrator
cd "$SKELS"/orchestrator || exit 1 cd "$SKELS"/orchestrator && opengeode --toAda orchestrator.pr system_structure.pr && cd $OLDPWD || exit -1
opengeode --toAda orchestrator.pr system_structure.pr || exit 1
cd $OLDPWD
# Generate code for OpenGEODE function memoryscrub # Generate code for OpenGEODE function memoryscrub
cd "$SKELS"/memoryscrub || exit 1 cd "$SKELS"/memoryscrub && opengeode --toAda memoryscrub.pr system_structure.pr && cd $OLDPWD || exit -1
opengeode --toAda memoryscrub.pr system_structure.pr || exit 1
cd $OLDPWD
cd "$SKELS" || exit 1 cd "$SKELS" && rm -f orchestrator.zip && zip -r orchestrator orchestrator/* && cd $OLDPWD || exit -1
rm -f orchestrator.zip || exit 1
zip orchestrator orchestrator/* || exit 1
cd $OLDPWD
cd "$SKELS" || exit 1 cd "$SKELS" && rm -f passivefunction.zip && zip -r passivefunction passivefunction/* && cd $OLDPWD || exit -1
rm -f passivefunction.zip || exit 1
zip passivefunction passivefunction/* || exit 1
cd $OLDPWD || exit 1
cd "$SKELS" || exit 1 cd "$SKELS" && rm -f memoryscrub.zip && zip -r memoryscrub memoryscrub/* && cd $OLDPWD || exit -1
rm -f memoryscrub.zip || exit 1
zip memoryscrub memoryscrub/* || exit 1
cd $OLDPWD || exit 1
[ ! -z "$CLEANUP" ] && rm -rf binary* [ ! -z "$CLEANUP" ] && rm -rf binary*
if [ -f ConcurrencyView.pro ] if [ -f ConcurrencyView.pro ]
then then
ORCHESTRATOR_OPTIONS+=" -w ConcurrencyView.pro " ORCHESTRATOR_OPTIONS+=" -w ConcurrencyView.pro "
elif [ -f ConcurrencyView_Properties.aadl ]
then
ORCHESTRATOR_OPTIONS+=" -w ConcurrencyView_Properties.aadl "
fi
if [ -f user_init_post.sh ]
then
echo -e "${INFO} Executing user-defined post-init script"
source user_init_post.sh
fi fi
# This demo cannot be built with Ada runtime (no Check queue implemented) if [ -f additionalCommands.sh ]
export USE_POHIC=1 then
source additionalCommands.sh
fi
if [ ! -z "$USE_POHIC" ] if [ ! -z "$USE_POHIC" ]
then then
OUTPUTDIR=binary.pohic OUTPUTDIR=binary.c
ORCHESTRATOR_OPTIONS+=" -p " ORCHESTRATOR_OPTIONS+=" -p "
elif [ ! -z "$USE_POHIADA" ] elif [ ! -z "$USE_POHIADA" ]
then then
OUTPUTDIR=binary.pohiada OUTPUTDIR=binary.ada
else else
OUTPUTDIR=binary OUTPUTDIR=binary
fi fi
assert-builder-ocarina.py \
cd "$CWD" && assert-builder-ocarina.py \
--fast \ --fast \
--debug \ $DEBUG_MODE \
--aadlv2 \ --aadlv2 \
--keep-case \ --keep-case \
--interfaceView InterfaceView.aadl \ --interfaceView "$INTERFACEVIEW" \
--deploymentView "$DEPLOYMENTVIEW" \ --deploymentView "$DEPLOYMENTVIEW" \
-o "$OUTPUTDIR" \ -o "$OUTPUTDIR" \
--subAda orchestrator:"$SKELS"/orchestrator.zip \ --subAda orchestrator:"$SKELS"/orchestrator.zip \
--subC passivefunction:"$SKELS"/passivefunction.zip \ --subC passivefunction:"$SKELS"/passivefunction.zip \
--subAda memoryscrub:"$SKELS"/memoryscrub.zip \ --subAda memoryscrub:"$SKELS"/memoryscrub.zip \
$ORCHESTRATOR_OPTIONS $ORCHESTRATOR_OPTIONS
if [ -f user_init_last.sh ]
then
echo -e "${INFO} Executing user-defined post-build script"
source user_init_last.sh
fi
TASTE-BasicTypes DEFINITIONS ::=
BEGIN
-- Set of TASTE predefined basic types
T-Int32 ::= INTEGER (-2147483648 .. 2147483647)
T-UInt32 ::= INTEGER (0 .. 4294967295)
T-Int8 ::= INTEGER (-128 .. 127)
T-UInt8 ::= INTEGER (0 .. 255)
T-Boolean ::= BOOLEAN
END
TASTE-Dataview DEFINITIONS ::= TASTE-Dataview DEFINITIONS ::=
BEGIN BEGIN
...@@ -51,20 +68,3 @@ MyChoice2 ::= CHOICE { ...@@ -51,20 +68,3 @@ MyChoice2 ::= CHOICE {
END END
TASTE-BasicTypes DEFINITIONS ::=
BEGIN
-- Set of TASTE predefined basic types
T-Int32 ::= INTEGER (-2147483648 .. 2147483647)
T-UInt32 ::= INTEGER (0 .. 4294967295)
T-Int8 ::= INTEGER (-128 .. 127)
T-UInt8 ::= INTEGER (0 .. 255)
T-Boolean ::= BOOLEAN
END
This diff is collapsed.
TASTE-BasicTypes DEFINITIONS ::=
BEGIN
-- Set of TASTE predefined basic types
T-Int32 ::= INTEGER (-2147483648 .. 2147483647)
T-UInt32 ::= INTEGER (0 .. 4294967295)
T-Int8 ::= INTEGER (-128 .. 127)
T-UInt8 ::= INTEGER (0 .. 255)
T-Boolean ::= BOOLEAN
END
TASTE-Dataview DEFINITIONS ::= TASTE-Dataview DEFINITIONS ::=
BEGIN BEGIN
...@@ -51,20 +68,3 @@ MyChoice2 ::= CHOICE { ...@@ -51,20 +68,3 @@ MyChoice2 ::= CHOICE {
END END
TASTE-BasicTypes DEFINITIONS ::=
BEGIN
-- Set of TASTE predefined basic types
T-Int32 ::= INTEGER (-2147483648 .. 2147483647)
T-UInt32 ::= INTEGER (0 .. 4294967295)
T-Int8 ::= INTEGER (-128 .. 127)
T-UInt8 ::= INTEGER (0 .. 255)
T-Boolean ::= BOOLEAN
END
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