Commit e8b5e2b9 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
parents d1b85ea4 6784d11c
#!/bin/bash
#!/bin/bash -e
# This script will build your TASTE system.
# You must check it before running it: it may need to be adapted to your context:
# 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.
# You should not change this file as it was automatically generated.
# Note: TASTE will not overwrite your changes - if you need to update some parts
# you will have to merge the changes with the newly-created "build-script.new.sh" file.
# If you need additional preprocessing, there are three hook files
# 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
export PROJECT_CACHE=$(pwd)/.cache
rm -f lift_model.zip
zip lift_model lift_model/*
[ ! -z "$CLEANUP" ] && rm -rf binary
# 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" ]
then
DEPLOYMENTVIEW=DeploymentView.aadl
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="./"
echo Building the system with the Ada runtime
assert-builder-ocarina.py \
-f -p -g \
# Check if Dataview references existing files
mono $(which taste-extract-asn-from-design.exe) -i "$INTERFACEVIEW" -j /tmp/dv.asn
cd "$SKELS" && rm -f lift_model.zip && zip lift_model lift_model/* && cd $OLDPWD
[ ! -z "$CLEANUP" ] && rm -rf binary*
if [ -f ConcurrencyView.pro ]
then
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
if [ -f additionalCommands.sh ]
then
source additionalCommands.sh
fi
if [ ! -z "$USE_POHIC" ]
then
OUTPUTDIR=binary.c
ORCHESTRATOR_OPTIONS+=" -p "
elif [ ! -z "$USE_POHIADA" ]
then
OUTPUTDIR=binary.ada
else
OUTPUTDIR=binary
fi
cd "$CWD" && assert-builder-ocarina.py \
--fast \
$DEBUG_MODE \
--aadlv2 \
--keep-case \
--interfaceView InterfaceView.aadl \
--deploymentView DeploymentView.aadl \
-o binary \
--subRTDS controller:controller/controller.zip \
--subSIMULINK lift_model:lift_model.zip
--interfaceView "$INTERFACEVIEW" \
--deploymentView "$DEPLOYMENTVIEW" \
-o "$OUTPUTDIR" \
--subRTDS controller:"$SKELS"/controller/controller.zip \
--subSIMULINK lift_model:"$SKELS"/lift_model.zip \
$ORCHESTRATOR_OPTIONS
if [ -f user_init_last.sh ]
then
echo -e "${INFO} Executing user-defined post-build script"
source user_init_last.sh
fi
This diff is collapsed.
#ifndef _INC_DATAVIEW_UNIQ_H
#define _INC_DATAVIEW_UNIQ_H
/*
Code automatically generated by asn1scc tool
*/
#include "asn1crt.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef asn1SccSint asn1SccT_POS_first_choice;
#define asn1SccT_POS_first_choice_REQUIRED_BYTES_FOR_ENCODING 1
#define asn1SccT_POS_first_choice_REQUIRED_BITS_FOR_ENCODING 4
#define asn1SccT_POS_first_choice_REQUIRED_BYTES_FOR_ACN_ENCODING 1
#define asn1SccT_POS_first_choice_REQUIRED_BITS_FOR_ACN_ENCODING 4
#define asn1SccT_POS_first_choice_REQUIRED_BYTES_FOR_XER_ENCODING 61
void asn1SccT_POS_first_choice_Initialize(asn1SccT_POS_first_choice* pVal);
flag asn1SccT_POS_first_choice_IsConstraintValid(const asn1SccT_POS_first_choice* val, int* pErrCode);
flag asn1SccT_POS_first_choice_Encode(const asn1SccT_POS_first_choice* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints);
flag asn1SccT_POS_first_choice_Decode(asn1SccT_POS_first_choice* pVal, BitStream* pBitStrm, int* pErrCode);
#ifndef ERR_asn1SccT_POS_first_choice
#define ERR_asn1SccT_POS_first_choice 1001 /*(0 .. 10)*/
#endif
typedef asn1SccSint asn1SccT_POS_second_choice_intVal;
#define asn1SccT_POS_second_choice_intVal_REQUIRED_BYTES_FOR_ENCODING 1
#define asn1SccT_POS_second_choice_intVal_REQUIRED_BITS_FOR_ENCODING 5
#define asn1SccT_POS_second_choice_intVal_REQUIRED_BYTES_FOR_ACN_ENCODING 1
#define asn1SccT_POS_second_choice_intVal_REQUIRED_BITS_FOR_ACN_ENCODING 5
#define asn1SccT_POS_second_choice_intVal_REQUIRED_BYTES_FOR_XER_ENCODING 77
void asn1SccT_POS_second_choice_intVal_Initialize(asn1SccT_POS_second_choice_intVal* pVal);
flag asn1SccT_POS_second_choice_intVal_IsConstraintValid(const asn1SccT_POS_second_choice_intVal* val, int* pErrCode);
flag asn1SccT_POS_second_choice_intVal_Encode(const asn1SccT_POS_second_choice_intVal* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints);
flag asn1SccT_POS_second_choice_intVal_Decode(asn1SccT_POS_second_choice_intVal* pVal, BitStream* pBitStrm, int* pErrCode);
#ifndef ERR_asn1SccT_POS_second_choice_intVal
#define ERR_asn1SccT_POS_second_choice_intVal 1002 /*(-10 .. 10)*/
#endif
typedef struct {
asn1SccT_POS_second_choice_intVal intVal;
flag boolVal;
} asn1SccT_POS_second_choice;
#define asn1SccT_POS_second_choice_REQUIRED_BYTES_FOR_ENCODING 1
#define asn1SccT_POS_second_choice_REQUIRED_BITS_FOR_ENCODING 6
#define asn1SccT_POS_second_choice_REQUIRED_BYTES_FOR_ACN_ENCODING 1
#define asn1SccT_POS_second_choice_REQUIRED_BITS_FOR_ACN_ENCODING 6
#define asn1SccT_POS_second_choice_REQUIRED_BYTES_FOR_XER_ENCODING 112
void asn1SccT_POS_second_choice_Initialize(asn1SccT_POS_second_choice* pVal);
flag asn1SccT_POS_second_choice_IsConstraintValid(const asn1SccT_POS_second_choice* val, int* pErrCode);
flag asn1SccT_POS_second_choice_Encode(const asn1SccT_POS_second_choice* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints);
flag asn1SccT_POS_second_choice_Decode(asn1SccT_POS_second_choice* pVal, BitStream* pBitStrm, int* pErrCode);
typedef struct {
enum {
T_POS_NONE,
first_choice_PRESENT,
second_choice_PRESENT
} kind;
union {
asn1SccT_POS_first_choice first_choice;
asn1SccT_POS_second_choice second_choice;
} u;
} asn1SccT_POS;
#define asn1SccT_POS_REQUIRED_BYTES_FOR_ENCODING 1
#define asn1SccT_POS_REQUIRED_BITS_FOR_ENCODING 8
#define asn1SccT_POS_REQUIRED_BYTES_FOR_ACN_ENCODING 1
#define asn1SccT_POS_REQUIRED_BITS_FOR_ACN_ENCODING 8
#define asn1SccT_POS_REQUIRED_BYTES_FOR_XER_ENCODING 115
void asn1SccT_POS_Initialize(asn1SccT_POS* pVal);
flag asn1SccT_POS_IsConstraintValid(const asn1SccT_POS* val, int* pErrCode);
flag asn1SccT_POS_Encode(const asn1SccT_POS* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints);
flag asn1SccT_POS_Decode(asn1SccT_POS* pVal, BitStream* pBitStrm, int* pErrCode);
#ifndef ERR_asn1SccT_POS_unknown_choice_index
#define ERR_asn1SccT_POS_unknown_choice_index 1003 /**/
#endif
#ifdef __cplusplus
}
#define CHOICE_first_choice_PRESENT asn1SccT_POS::first_choice_PRESENT
#define CHOICE_second_choice_PRESENT asn1SccT_POS::second_choice_PRESENT
#endif
#endif
This diff is collapsed.
#ifndef _INC_DATAVIEW_UNIQ_H
#define _INC_DATAVIEW_UNIQ_H
/*
Code automatically generated by asn1scc tool
*/
#include "asn1crt.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef asn1SccSint asn1SccT_POS_first_choice;
#define asn1SccT_POS_first_choice_REQUIRED_BYTES_FOR_ENCODING 1
#define asn1SccT_POS_first_choice_REQUIRED_BITS_FOR_ENCODING 4
#define asn1SccT_POS_first_choice_REQUIRED_BYTES_FOR_ACN_ENCODING 1
#define asn1SccT_POS_first_choice_REQUIRED_BITS_FOR_ACN_ENCODING 4
#define asn1SccT_POS_first_choice_REQUIRED_BYTES_FOR_XER_ENCODING 61
void asn1SccT_POS_first_choice_Initialize(asn1SccT_POS_first_choice* pVal);
flag asn1SccT_POS_first_choice_IsConstraintValid(const asn1SccT_POS_first_choice* val, int* pErrCode);
flag asn1SccT_POS_first_choice_Encode(const asn1SccT_POS_first_choice* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints);
flag asn1SccT_POS_first_choice_Decode(asn1SccT_POS_first_choice* pVal, BitStream* pBitStrm, int* pErrCode);
#ifndef ERR_asn1SccT_POS_first_choice
#define ERR_asn1SccT_POS_first_choice 1001 /*(0 .. 10)*/
#endif
typedef asn1SccSint asn1SccT_POS_second_choice_intVal;
#define asn1SccT_POS_second_choice_intVal_REQUIRED_BYTES_FOR_ENCODING 1
#define asn1SccT_POS_second_choice_intVal_REQUIRED_BITS_FOR_ENCODING 5
#define asn1SccT_POS_second_choice_intVal_REQUIRED_BYTES_FOR_ACN_ENCODING 1
#define asn1SccT_POS_second_choice_intVal_REQUIRED_BITS_FOR_ACN_ENCODING 5
#define asn1SccT_POS_second_choice_intVal_REQUIRED_BYTES_FOR_XER_ENCODING 77
void asn1SccT_POS_second_choice_intVal_Initialize(asn1SccT_POS_second_choice_intVal* pVal);
flag asn1SccT_POS_second_choice_intVal_IsConstraintValid(const asn1SccT_POS_second_choice_intVal* val, int* pErrCode);
flag asn1SccT_POS_second_choice_intVal_Encode(const asn1SccT_POS_second_choice_intVal* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints);
flag asn1SccT_POS_second_choice_intVal_Decode(asn1SccT_POS_second_choice_intVal* pVal, BitStream* pBitStrm, int* pErrCode);
#ifndef ERR_asn1SccT_POS_second_choice_intVal
#define ERR_asn1SccT_POS_second_choice_intVal 1002 /*(-10 .. 10)*/
#endif
typedef struct {
asn1SccT_POS_second_choice_intVal intVal;
flag boolVal;
} asn1SccT_POS_second_choice;
#define asn1SccT_POS_second_choice_REQUIRED_BYTES_FOR_ENCODING 1
#define asn1SccT_POS_second_choice_REQUIRED_BITS_FOR_ENCODING 6
#define asn1SccT_POS_second_choice_REQUIRED_BYTES_FOR_ACN_ENCODING 1
#define asn1SccT_POS_second_choice_REQUIRED_BITS_FOR_ACN_ENCODING 6
#define asn1SccT_POS_second_choice_REQUIRED_BYTES_FOR_XER_ENCODING 112
void asn1SccT_POS_second_choice_Initialize(asn1SccT_POS_second_choice* pVal);
flag asn1SccT_POS_second_choice_IsConstraintValid(const asn1SccT_POS_second_choice* val, int* pErrCode);
flag asn1SccT_POS_second_choice_Encode(const asn1SccT_POS_second_choice* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints);
flag asn1SccT_POS_second_choice_Decode(asn1SccT_POS_second_choice* pVal, BitStream* pBitStrm, int* pErrCode);
typedef struct {
enum {
T_POS_NONE,
first_choice_PRESENT,
second_choice_PRESENT
} kind;
union {
asn1SccT_POS_first_choice first_choice;
asn1SccT_POS_second_choice second_choice;
} u;
} asn1SccT_POS;
#define asn1SccT_POS_REQUIRED_BYTES_FOR_ENCODING 1
#define asn1SccT_POS_REQUIRED_BITS_FOR_ENCODING 8
#define asn1SccT_POS_REQUIRED_BYTES_FOR_ACN_ENCODING 1
#define asn1SccT_POS_REQUIRED_BITS_FOR_ACN_ENCODING 8
#define asn1SccT_POS_REQUIRED_BYTES_FOR_XER_ENCODING 115
void asn1SccT_POS_Initialize(asn1SccT_POS* pVal);
flag asn1SccT_POS_IsConstraintValid(const asn1SccT_POS* val, int* pErrCode);
flag asn1SccT_POS_Encode(const asn1SccT_POS* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints);
flag asn1SccT_POS_Decode(asn1SccT_POS* pVal, BitStream* pBitStrm, int* pErrCode);
#ifndef ERR_asn1SccT_POS_unknown_choice_index
#define ERR_asn1SccT_POS_unknown_choice_index 1003 /**/
#endif
#ifdef __cplusplus
}
#define CHOICE_first_choice_PRESENT asn1SccT_POS::first_choice_PRESENT
#define CHOICE_second_choice_PRESENT asn1SccT_POS::second_choice_PRESENT
#endif
#endif
#!/bin/bash
#!/bin/bash -e
# This script will build your TASTE system.
# You should check it before running it to make it fit with your context:
# 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.
# You should not change this file as it was automatically generated.
# Note: TASTE will not overwrite your changes - if you need to update some parts
# you will have to merge the changes with the newly-created file.
# If you need additional preprocessing, there are three hook files
# 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
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
};
mkdir -p .cache
export PROJECT_CACHE=$(pwd)/.cache
......@@ -23,19 +57,41 @@ then
DEPLOYMENTVIEW=DeploymentView.aadl
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="./"
cd "$SKELS"
rm -f a.zip
zip a a/*
rm -f b.zip
zip b b/*
cd "$OLDPWD"
[ ! -z "$CLEANUP" ] && rm -rf binary
# Check if Dataview references existing files
mono $(which taste-extract-asn-from-design.exe) -i "$INTERFACEVIEW" -j /tmp/dv.asn
cd "$SKELS" && rm -f a.zip && zip a a/* && cd $OLDPWD
cd "$SKELS" && rm -f b.zip && zip b b/* && cd $OLDPWD
[ ! -z "$CLEANUP" ] && rm -rf binary*
if [ -f ConcurrencyView.pro ]
then
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
if [ -f additionalCommands.sh ]
then
source additionalCommands.sh
fi
if [ ! -z "$USE_POHIC" ]
......@@ -48,14 +104,22 @@ then
else
OUTPUTDIR=binary
fi
assert-builder-ocarina.py \
cd "$CWD" && assert-builder-ocarina.py \
--fast \
--debug \
$DEBUG_MODE \
--aadlv2 \
--keep-case \
--interfaceView InterfaceView.aadl \
--interfaceView "$INTERFACEVIEW" \
--deploymentView "$DEPLOYMENTVIEW" \
-o "$OUTPUTDIR" \
--subC a:"$SKELS"/a.zip \
--subC b:"$SKELS"/b.zip \
$ORCHESTRATOR_OPTIONS
if [ -f user_init_last.sh ]
then
echo -e "${INFO} Executing user-defined post-build script"
source user_init_last.sh
fi
......@@ -4,7 +4,7 @@ import sys
timeout = 5
binaries = [
"binary/binaries/demo"
"binary.c/binaries/demo"
]
expected = [
......
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