Commit d4b87c85 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix RTDS demo

parent a4a67181
This diff is collapsed.
PACKAGE interfaceview::IV
---------------------------------------------------
-- AADL2.0
-- TASTE
--
--
---------------------------------------------------
PACKAGE interfaceview::FV::my_rtds_system
PUBLIC
WITH Taste;
WITH DataView;
WITH interfaceview::FV;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_ping
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_ping;
SUBPROGRAM IMPLEMENTATION PI_ping.others
END PI_ping.others;
SUBPROGRAM PI_hello
FEATURES
in_mode : IN PARAMETER DataView::T_POS {
Taste::encoding => UPER;
};
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_hello;
SUBPROGRAM IMPLEMENTATION PI_hello.others
END PI_hello.others;
SUBPROGRAM RI_pong
FEATURES
speed : IN PARAMETER DataView::T_POS {
Taste::encoding => NATIVE;
};
END RI_pong;
SUBPROGRAM IMPLEMENTATION RI_pong.others
END RI_pong.others;
SUBPROGRAM RI_compute
FEATURES
inp : IN PARAMETER DataView::T_POS {
Taste::encoding => NATIVE;
};
inp2 : IN PARAMETER DataView::T_POS {
Taste::encoding => UPER;
};
outp : OUT PARAMETER DataView::T_POS {
Taste::encoding => NATIVE;
};
END RI_compute;
SUBPROGRAM IMPLEMENTATION RI_compute.others
END RI_compute.others;
END interfaceview::FV::my_rtds_system;
PACKAGE interfaceview::FV::mygui
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_pong
FEATURES
speed : IN PARAMETER DataView::T_POS {
Taste::encoding => NATIVE;
};
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_pong;
---------------------------------------------------
-- TASTE Interface View
---------------------------------------------------
SUBPROGRAM IMPLEMENTATION PI_pong.others
END PI_pong.others;
SUBPROGRAM RI_hello
FEATURES
in_mode : IN PARAMETER DataView::T_POS {
Taste::encoding => UPER;
};
END RI_hello;
SUBPROGRAM IMPLEMENTATION RI_hello.others
END RI_hello.others;
END interfaceview::FV::mygui;
PACKAGE interfaceview::FV::mysyncfunction
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_compute
FEATURES
inp : IN PARAMETER DataView::T_POS {
Taste::encoding => NATIVE;
};
inp2 : IN PARAMETER DataView::T_POS {
Taste::encoding => UPER;
};
outp : OUT PARAMETER DataView::T_POS {
Taste::encoding => NATIVE;
};
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_compute;
SUBPROGRAM IMPLEMENTATION PI_compute.others
END PI_compute.others;
END interfaceview::FV::mysyncfunction;
SYSTEM interfaceview
END interfaceview;
SYSTEM IMPLEMENTATION interfaceview.others
SUBCOMPONENTS
my_rtds_system: SYSTEM interfaceview::IV::my_rtds_system.others
{ Taste::Coordinates => "1617 192 2702 968"; };
mygui: SYSTEM interfaceview::IV::mygui.others
{ Taste::Coordinates => "279 283 903 729"; };
mysyncfunction: SYSTEM interfaceview::IV::mysyncfunction.others
{ Taste::Coordinates => "457 1041 1135 1418"; };
CONNECTIONS
obj490 : SUBPROGRAM ACCESS mygui.pong_obj129 -> my_rtds_system.obj403_obj98
{ Taste::Coordinates => "1617 740 1260 740 1260 638 903 638"; };
obj725 : SUBPROGRAM ACCESS mysyncfunction.compute_obj162 -> my_rtds_system.obj640_obj108
{ Taste::Coordinates => "1795 968 1795 1139 1135 1139"; };
obj325 : SUBPROGRAM ACCESS my_rtds_system.hello_obj86 -> mygui.obj266_obj141
{ Taste::Coordinates => "903 439 1260 439 1260 511 1617 511"; };
END interfaceview.others;
---------------------------------------------------
-- TASTE Function: interfaceview::IV::my_rtds_system
---------------------------------------------------
SYSTEM my_rtds_system
FEATURES
ping_obj75 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::ping_obj75.others
{ Taste::Coordinates => "1617 305";
PACKAGE interfaceview::IV
PUBLIC
WITH interfaceview::FV::my_rtds_system;
WITH interfaceview::FV::mygui;
WITH interfaceview::FV::mysyncfunction;
WITH interfaceview::FV;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SYSTEM my_rtds_system
FEATURES
PI_ping : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::my_rtds_system::PI_ping.others {
Taste::coordinates => "1617 305";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 1000 ms;
Taste::Deadline => 1000 ms;
Taste::Importance => MEDIUM ;};
hello_obj86 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::hello_obj86.others
{ Taste::Coordinates => "1617 511";
Taste::InterfaceName => "ping";
};
PI_hello : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::my_rtds_system::PI_hello.others {
Taste::coordinates => "1617 511";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 100 ms;
Taste::Deadline => 100 ms;
Taste::Importance => MEDIUM ;};
obj403_obj98 : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::pong_obj129.others
{ Taste::Coordinates => "1617 740";
Taste::RCMoperationKind => sporadic;};
obj640_obj108 : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::compute_obj162.others
{ Taste::Coordinates => "1795 968";
Taste::RCMoperationKind => unprotected;};
PROPERTIES
Source_Language => RTDS;
Taste::Instance_Name => "Function0";
END my_rtds_system;
SYSTEM IMPLEMENTATION my_rtds_system.others
SUBCOMPONENTS
ping_obj75_impl : SUBPROGRAM interfaceview::FV::ping_obj75.others
{ Compute_Execution_Time => 0ms..1000ms ;};
hello_obj86_impl : SUBPROGRAM interfaceview::FV::hello_obj86.others
{ Compute_Execution_Time => 0ms..100ms ;};
CONNECTIONS
SUBPROGRAM ACCESS ping_obj75_impl -> ping_obj75;
SUBPROGRAM ACCESS hello_obj86_impl -> hello_obj86;
END my_rtds_system.others;
---------------------------------------------------
-- TASTE Function: interfaceview::IV::mygui
---------------------------------------------------
SYSTEM mygui
FEATURES
pong_obj129 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::pong_obj129.others
{ Taste::Coordinates => "903 638";
Taste::InterfaceName => "hello";
};
RI_pong : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::mygui::PI_pong.others {
Taste::coordinates => "1617 740";
Taste::RCMoperationKind => sporadic;
Taste::InterfaceName => "pong";
Taste::labelInheritance => "true";
};
RI_compute : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::mysyncfunction::PI_compute.others {
Taste::coordinates => "1795 968";
Taste::RCMoperationKind => unprotected;
Taste::InterfaceName => "compute";
Taste::labelInheritance => "true";
};
PROPERTIES
Source_Language => (RTDS);
END my_rtds_system;
SYSTEM IMPLEMENTATION my_rtds_system.others
SUBCOMPONENTS
ping_impl : SUBPROGRAM interfaceview::FV::my_rtds_system::PI_ping.others {
Compute_Execution_Time => 0 ms .. 1000 ms;
};
hello_impl : SUBPROGRAM interfaceview::FV::my_rtds_system::PI_hello.others {
Compute_Execution_Time => 0 ms .. 100 ms;
};
CONNECTIONS
OpToPICnx_ping_impl : SUBPROGRAM ACCESS ping_impl -> PI_ping;
OpToPICnx_hello_impl : SUBPROGRAM ACCESS hello_impl -> PI_hello;
END my_rtds_system.others;
SYSTEM mygui
FEATURES
PI_pong : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::mygui::PI_pong.others {
Taste::coordinates => "965 628";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 100 ms;
Taste::Deadline => 100 ms;
Taste::Importance => MEDIUM ;};
obj266_obj141 : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::hello_obj86.others
{ Taste::Coordinates => "903 439";
Taste::RCMoperationKind => sporadic;};
PROPERTIES
Source_Language => GUI;
Taste::Instance_Name => "Function1";
END mygui;
SYSTEM IMPLEMENTATION mygui.others
SUBCOMPONENTS
pong_obj129_impl : SUBPROGRAM interfaceview::FV::pong_obj129.others
{ Compute_Execution_Time => 0ms..100ms ;};
CONNECTIONS
SUBPROGRAM ACCESS pong_obj129_impl -> pong_obj129;
END mygui.others;
---------------------------------------------------
-- TASTE Function: interfaceview::IV::mysyncfunction
---------------------------------------------------
SYSTEM mysyncfunction
FEATURES
compute_obj162 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::compute_obj162.others
{ Taste::Coordinates => "1135 1139";
Taste::InterfaceName => "pong";
};
RI_hello : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::my_rtds_system::PI_hello.others {
Taste::coordinates => "965 429";
Taste::RCMoperationKind => sporadic;
Taste::InterfaceName => "hello";
Taste::labelInheritance => "true";
};
PROPERTIES
Source_Language => (GUI);
END mygui;
SYSTEM IMPLEMENTATION mygui.others
SUBCOMPONENTS
pong_impl : SUBPROGRAM interfaceview::FV::mygui::PI_pong.others {
Compute_Execution_Time => 0 ms .. 100 ms;
};
CONNECTIONS
OpToPICnx_pong_impl : SUBPROGRAM ACCESS pong_impl -> PI_pong;
END mygui.others;
SYSTEM mysyncfunction
FEATURES
PI_compute : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::mysyncfunction::PI_compute.others {
Taste::coordinates => "1135 1139";
Taste::RCMoperationKind => unprotected;
Taste::RCMperiod => 0 ms;
Taste::Deadline => 100 ms;
Taste::Importance => MEDIUM ;};
PROPERTIES
Source_Language => C;
Taste::Instance_Name => "Function2";
END mysyncfunction;
Taste::InterfaceName => "compute";
};
PROPERTIES
Source_Language => (C);
END mysyncfunction;
SYSTEM IMPLEMENTATION mysyncfunction.others
SUBCOMPONENTS
compute_obj162_impl : SUBPROGRAM interfaceview::FV::compute_obj162.others
{ Compute_Execution_Time => 0ms..100ms ;};
CONNECTIONS
SUBPROGRAM ACCESS compute_obj162_impl -> compute_obj162;
END mysyncfunction.others;
SYSTEM IMPLEMENTATION mysyncfunction.others
SUBCOMPONENTS
compute_impl : SUBPROGRAM interfaceview::FV::mysyncfunction::PI_compute.others {
Compute_Execution_Time => 0 ms .. 100 ms;
};
CONNECTIONS
OpToPICnx_compute_impl : SUBPROGRAM ACCESS compute_impl -> PI_compute;
END mysyncfunction.others;
SYSTEM interfaceview
END interfaceview;
SYSTEM IMPLEMENTATION interfaceview.others
SUBCOMPONENTS
my_rtds_system : SYSTEM interfaceview::IV::my_rtds_system.others {
Taste::coordinates => "1617 192 2702 968";
};
mygui : SYSTEM interfaceview::IV::mygui.others {
Taste::coordinates => "341 273 965 719";
};
mysyncfunction : SYSTEM interfaceview::IV::mysyncfunction.others {
Taste::coordinates => "457 1041 1135 1418";
};
CONNECTIONS
my_rtds_system_hello_mygui_hello : SUBPROGRAM ACCESS my_rtds_system.PI_hello -> mygui.RI_hello {
Taste::coordinates => "965 429 1260 429 1260 511 1617 511";
};
mygui_pong_my_rtds_system_pong : SUBPROGRAM ACCESS mygui.PI_pong -> my_rtds_system.RI_pong {
Taste::coordinates => "1617 740 1260 740 1260 628 965 628";
};
mysyncfunction_compute_my_rtds_system_compute : SUBPROGRAM ACCESS mysyncfunction.PI_compute -> my_rtds_system.RI_compute {
Taste::coordinates => "1795 968 1795 1139 1135 1139";
};
END interfaceview.others;
PROPERTIES
Taste::Coordinates => "0 0 2970 2100";
Taste::dataView => ("DataView");
Taste::dataViewPath => ("DataView.aadl");
Taste::coordinates => "0 0 2970 2100";
Taste::version => "1.3.20";
END interfaceview::IV;
PACKAGE interfaceview::FV
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE;
SUBPROGRAM ping_obj75
END ping_obj75;
SUBPROGRAM IMPLEMENTATION ping_obj75.others
END ping_obj75.others;
SUBPROGRAM hello_obj86
FEATURES
in_mode : IN PARAMETER DataView::T_POS
{ Taste::encoding => UPER; };
PROPERTIES
Taste::Associated_Queue_Size => 1;
END hello_obj86;
SUBPROGRAM IMPLEMENTATION hello_obj86.others
END hello_obj86.others;
SUBPROGRAM pong_obj129
FEATURES
speed : IN PARAMETER DataView::T_POS
{ Taste::encoding => NATIVE; };
PROPERTIES
Taste::Associated_Queue_Size => 1;
END pong_obj129;
SUBPROGRAM IMPLEMENTATION pong_obj129.others
END pong_obj129.others;
SUBPROGRAM compute_obj162
FEATURES
inp : IN PARAMETER DataView::T_POS
{ Taste::encoding => NATIVE; };
inp2 : IN PARAMETER DataView::T_POS
{ Taste::encoding => UPER; };
outp : OUT PARAMETER DataView::T_POS
{ Taste::encoding => NATIVE; };
END compute_obj162;
SUBPROGRAM IMPLEMENTATION compute_obj162.others
END compute_obj162.others;
WITH TASTE_IV_Properties;
END interfaceview::FV;
#!/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.
rm -f mysyncfunction.zip
zip mysyncfunction mysyncfunction/*
[ ! -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 mysyncfunction.zip && zip mysyncfunction mysyncfunction/* && 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 my_rtds_system:my_rtds_system.zip \
--subC mysyncfunction:mysyncfunction.zip
--interfaceView "$INTERFACEVIEW" \
--deploymentView "$DEPLOYMENTVIEW" \
-o "$OUTPUTDIR" \
--subRTDS my_rtds_system:"$SKELS"/my_rtds_system/my_rtds_system.zip \
--subC mysyncfunction:"$SKELS"/mysyncfunction.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
--------------------------------------------------------
--! File generated by asn2aadl v1.2128: DO NOT EDIT !
--------------------------------------------------------
package DataView
public
with Data_Model;
with Taste;
with Base_Types;
with Deployment;
-- No more private heap required (we use the space certified compiler)
-- Memory_Required: 0
data Stream_Element_Buffer
-- Root type for buffer elements
properties
Data_Model::Data_Representation => Character;
end Stream_Element_Buffer;
DATA T_POS
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("TPOS_Dataview.asn");
TASTE::Ada_Package_Name => "MY_MODULE";
Deployment::ASN1_Module_Name => "MY-MODULE";
Source_Language => ASN1;
-- Size of a buffer to cover all forms of message representation:
-- Real message size is 16; suggested aligned message buffer is...
Source_Data_Size => 16 Bytes;
-- name of the corresponding data type in the source file:
Type_Source_Name => "T-POS";
-- what kind of type is this?
TASTE::ASN1_Basic_Type =>aCHOICE;
END T_POS;
DATA T_POS_Buffer_Max
END T_POS_Buffer_Max;
DATA IMPLEMENTATION T_POS_Buffer_Max.impl
-- Buffer to hold a marshalled data of type T_POS
PROPERTIES
Data_Model::Data_Representation => array;
Data_Model::Dimension => (16); -- Size of the buffer
Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer));
END T_POS_Buffer_Max.impl;
DATA T_POS_Buffer
END T_POS_Buffer;
DATA IMPLEMENTATION T_POS_Buffer.impl
-- Buffer to hold a marshalled data of type T_POS
SUBCOMPONENTS
Buffer : data T_POS_Buffer_Max.impl;
Length : data Base_Types::Unsigned_16;
PROPERTIES
Data_Model::Data_Representation => Struct;
END T_POS_Buffer.impl;
end DataView;
RTDSdataView DEFINITIONS ::= BEGIN
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)