Commit 6f91059f authored by Maxime Perrotin's avatar Maxime Perrotin

Update Demo_Directive with V2 tools

parent d2475b4b
This diff is collapsed.
PACKAGE interfaceview::IV
PUBLIC
WITH DataView;
WITH interfaceview::FV;
WITH Taste;
---------------------------------------------------
-- TASTE Interface View
-- AADL2.1
-- TASTE type interfaceview
--
-- generated code: do not edit
---------------------------------------------------
SYSTEM interfaceview
END interfaceview;
SYSTEM IMPLEMENTATION interfaceview.others
SUBCOMPONENTS
Function0: SYSTEM interfaceview::IV::Function0.others
{ Taste::Coordinates => "841 257 2165 1411"; };
Function1: SYSTEM interfaceview::IV::Function1.others
{ Taste::Coordinates => "1166 1665 1986 2018"; };
CONNECTIONS
obj356 : SUBPROGRAM ACCESS Function0.pop_obj87 -> Function1.obj243_obj120
{ Taste::Coordinates => "1280 1665 1280 1488.9 708.6 1488.9 708.6 997 841 997"; };
END interfaceview.others;
---------------------------------------------------
-- TASTE Function: interfaceview::IV::Function0
---------------------------------------------------
SYSTEM Function0
FEATURES
plou_obj76 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::plou_obj76.others
{ Taste::Coordinates => "841 468";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 100 ms;
Taste::Deadline => 0 ms;
Taste::Importance => MEDIUM ;};
pop_obj87 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::pop_obj87.others
{ Taste::Coordinates => "841 997";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 0 ms;
Taste::Deadline => 0 ms;
Taste::Importance => MEDIUM ;};
PROPERTIES
Source_Language => C;
Taste::Instance_Name => "Function0";
END Function0;
SYSTEM IMPLEMENTATION Function0.others
SUBCOMPONENTS
hello_obj65 : DATA DataView::Taste_directive
{ Taste::FS_Default_Value => "simulink-script:{filename ""world""}"; };
plou_obj76_impl : SUBPROGRAM interfaceview::FV::plou_obj76.others
{ Compute_Execution_Time => 0ms..0ms ;};
pop_obj87_impl : SUBPROGRAM interfaceview::FV::pop_obj87.others
{ Compute_Execution_Time => 0ms..0ms ;};
CONNECTIONS
DATA ACCESS hello_obj65 -> plou_obj76_impl.hello_obj65;
SUBPROGRAM ACCESS plou_obj76_impl -> plou_obj76;
DATA ACCESS hello_obj65 -> pop_obj87_impl.hello_obj65;
SUBPROGRAM ACCESS pop_obj87_impl -> pop_obj87;
END Function0.others;
---------------------------------------------------
-- TASTE Function: interfaceview::IV::Function1
---------------------------------------------------
SYSTEM Function1
FEATURES
kok_obj109 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::kok_obj109.others
{ Taste::Coordinates => "1986 1888";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 0 ms;
Taste::Deadline => 0 ms;
Taste::Importance => MEDIUM ;};
obj243_obj120 : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::pop_obj87.others
{ Taste::Coordinates => "1280 1665";
Taste::RCMoperationKind => sporadic;};
PROPERTIES
Source_Language => C;
Taste::Instance_Name => "Function0";
END Function1;
SYSTEM IMPLEMENTATION Function1.others
SUBCOMPONENTS
kok_obj109_impl : SUBPROGRAM interfaceview::FV::kok_obj109.others
{ Compute_Execution_Time => 0ms..0ms ;};
CONNECTIONS
SUBPROGRAM ACCESS kok_obj109_impl -> kok_obj109;
END Function1.others;
PACKAGE interfaceview::IV::Function0
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_plou
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_plou;
SUBPROGRAM IMPLEMENTATION PI_plou.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 0 ms;
END PI_plou.others;
SUBPROGRAM PI_pop
FEATURES
ddf : IN PARAMETER DataView::MyInteger {
Taste::encoding => NATIVE;
};
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_pop;
SUBPROGRAM IMPLEMENTATION PI_pop.others
PROPERTIES
Taste::Coordinates => "0 0 2970 2100";
Taste::dataView => ("DataView","DataView");
Taste::dataViewPath => ("DataView.aadl");
Compute_Execution_Time => 0 ms .. 0 ms;
END PI_pop.others;
SYSTEM Function0
FEATURES
PI_plou : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Function0::PI_plou.others {
Taste::coordinates => "841 468";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 100 ms;
Taste::Deadline => 0 ms;
Taste::InterfaceName => "plou";
};
PI_pop : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Function0::PI_pop.others {
Taste::coordinates => "841 997";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 0 ms;
Taste::Deadline => 0 ms;
Taste::InterfaceName => "pop";
};
PROPERTIES
Source_Language => (C);
Taste::Active_Interfaces => enabled;
END Function0;
END interfaceview::IV;
SYSTEM IMPLEMENTATION Function0.others
SUBCOMPONENTS
hello : DATA DataView::Taste_directive {
Taste::FS_Default_Value => "simulink-script:{filename ""world""}";
};
END Function0.others;
END interfaceview::IV::Function0;
PACKAGE interfaceview::FV
PACKAGE interfaceview::IV::Function1
PUBLIC
WITH interfaceview::IV::Function0;
WITH Taste;
WITH DataView;
WITH TASTE;
SUBPROGRAM plou_obj76
FEATURES
hello_obj65 : REQUIRES DATA ACCESS DataView::Taste_directive;
END plou_obj76;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_kok
END PI_kok;
SUBPROGRAM IMPLEMENTATION plou_obj76.others
END plou_obj76.others;
SUBPROGRAM IMPLEMENTATION PI_kok.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 0 ms;
END PI_kok.others;
SUBPROGRAM RI_pop
FEATURES
ddf : IN PARAMETER DataView::MyInteger {
Taste::encoding => NATIVE;
};
END RI_pop;
SUBPROGRAM IMPLEMENTATION RI_pop.others
END RI_pop.others;
SYSTEM Function1
FEATURES
PI_kok : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Function1::PI_kok.others {
Taste::coordinates => "1986 1888";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 200 ms;
Taste::Deadline => 0 ms;
Taste::InterfaceName => "kok";
};
RI_pop : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::Function0::PI_pop.others {
Taste::coordinates => "1280 1665";
Taste::RCMoperationKind => sporadic;
Taste::InterfaceName => "pop";
Taste::labelInheritance => "true";
};
PROPERTIES
Source_Language => (C);
Taste::Active_Interfaces => enabled;
END Function1;
SUBPROGRAM pop_obj87
FEATURES
ddf : in PARAMETER DataView::MyInteger
{ Taste::encoding => NATIVE; };
hello_obj65 : REQUIRES DATA ACCESS DataView::Taste_directive;
PROPERTIES
Taste::Associated_Queue_Size => 1;
END pop_obj87;
SYSTEM IMPLEMENTATION Function1.others
END Function1.others;
SUBPROGRAM IMPLEMENTATION pop_obj87.others
END pop_obj87.others;
END interfaceview::IV::Function1;
SUBPROGRAM kok_obj109
END kok_obj109;
PACKAGE interfaceview::IV
PUBLIC
SUBPROGRAM IMPLEMENTATION kok_obj109.others
END kok_obj109.others;
WITH interfaceview::IV::Function0;
WITH interfaceview::IV::Function1;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SYSTEM interfaceview
END interfaceview;
SYSTEM IMPLEMENTATION interfaceview.others
SUBCOMPONENTS
Function0 : SYSTEM interfaceview::IV::Function0::Function0.others {
Taste::coordinates => "841 257 2165 1411";
};
Function1 : SYSTEM interfaceview::IV::Function1::Function1.others {
Taste::coordinates => "1166 1665 1986 2018";
};
CONNECTIONS
Function0_PI_pop_Function1_RI_pop : SUBPROGRAM ACCESS Function0.PI_pop -> Function1.RI_pop {
Taste::coordinates => "1280 1665 1280 1488.9 708.6 1488.9 708.6 997 841 997";
};
END interfaceview.others;
END interfaceview::FV;
PROPERTIES
Taste::dataView => ("DataView");
Taste::dataViewPath => ("DataView.aadl");
Taste::coordinates => "0 0 2970 2100";
Taste::version => "2.0";
END interfaceview::IV;
#!/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.
# 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.
taste-update-data-view || exit 1
rm -f function0.zip
zip function0 function0/*
rm -f function1.zip
zip function1 function1/*
[ ! -z "$CLEANUP" ] && rm -rf binary
echo Building the system with the Ada runtime
assert-builder-ocarina.py \
-f \
# You should not change this file as it was automatically generated.
# 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
# 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="./"
# Check if Dataview references existing files
mono $(which taste-extract-asn-from-design.exe) -i "$INTERFACEVIEW" -j /tmp/dv.asn
cd "$SKELS" && rm -f function0.zip && zip function0 function0/* && cd $OLDPWD
cd "$SKELS" && rm -f function1.zip && zip function1 function1/* && 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 \
--subC function0:function0.zip \
--subC function1:function1.zip
--interfaceView "$INTERFACEVIEW" \
--deploymentView "$DEPLOYMENTVIEW" \
-o "$OUTPUTDIR" \
--subC function0:"$SKELS"/function0.zip \
--subC function1:"$SKELS"/function1.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
/* Functions to be filled by the user (never overwritten by buildsupport tool) */
#include "function0.h"
#include <stdio.h>
void function0_startup()
{
printf("Function0 startup\n");
/* Write your initialization code here,
but do not make any call to a required interface!! */
}
void function0_PI_plou()
{
printf("Function0 periodic\n");
/* Write your code here! */
}
void function0_PI_pop(const asn1SccMyInteger *IN_ddf)
{
/* Write your code here! */
printf("Function0 got value from function1 : %lld\n", *IN_ddf);
}
......@@ -7,11 +7,19 @@
#include "C_ASN1_Types.h"
#ifdef __cplusplus
extern "C" {
#endif
void function0_startup();
void function0_PI_plou();
void function0_PI_pop(const asn1SccMyInteger *);
#ifdef __cplusplus
}
#endif
#endif
/* Functions to be filled by the user (never overwritten by buildsupport tool) */
#include "function1.h"
#include <stdio.h>
void function1_startup()
{
/* Write your initialization code here,
but do not make any call to a required interface!! */
printf("Function 1 startup\n");
}
void function1_PI_kok()
{
static asn1SccMyInteger hello = 0;
printf("Function 1 periodic\n");
function1_RI_pop(&hello);
hello ++;
/* Write your code here! */
}
......@@ -7,11 +7,19 @@
#include "C_ASN1_Types.h"
#ifdef __cplusplus
extern "C" {
#endif
void function1_startup();
void function1_PI_kok();
extern void function1_RI_pop(const asn1SccMyInteger *);
#ifdef __cplusplus
}
#endif
#endif
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