Commit 3420e26d authored by Maxime Perrotin's avatar Maxime Perrotin

Add Demo_ACN

parent d9e9b94c
This diff is collapsed.
MY-MODULE DEFINITIONS ::= BEGIN
T-POS[] {
first-choice [size 16, encoding pos-int] ,
second-choice [] {
intVal [size 5, encoding twos-complement] ,
boolVal [true-value '1'B]
}
}
END
MY-MODULE DEFINITIONS AUTOMATIC TAGS ::= BEGIN
T-POS ::= CHOICE {
first-choice INTEGER (0..10),
second-choice SEQUENCE {
intVal INTEGER (-10..10),
boolVal BOOLEAN
}
}
END
---------------------------------------------------
-- AADL2.0
-- TASTE
-- (c)Ellidiss Technologies
--
---------------------------------------------------
PACKAGE deploymentview::DV::pb
PUBLIC
WITH Taste;
WITH Deployment;
WITH TASTE_DV_Properties;
PROCESS demo
END demo;
PROCESS IMPLEMENTATION demo.others
END demo.others;
END deploymentview::DV::pb;
PACKAGE deploymentview::DV
PUBLIC
WITH ocarina_processors_x86;
WITH deploymentview::DV::pb;
WITH Taste;
WITH Deployment;
WITH interfaceview::IV;
WITH TASTE_DV_Properties;
SYSTEM pb
END pb;
SYSTEM IMPLEMENTATION pb.others
SUBCOMPONENTS
IV_A : SYSTEM interfaceview::IV::A.others {
Taste::coordinates => "841 503 1067 708";
Taste::FunctionName => "A";
};
IV_B : SYSTEM interfaceview::IV::B.others {
Taste::coordinates => "1185 559 1313 759";
Taste::FunctionName => "B";
};
IV_some_GUI : SYSTEM interfaceview::IV::some_GUI.others {
Taste::coordinates => "759 785 1154 944";
Taste::FunctionName => "some_GUI";
};
demo : PROCESS deploymentview::DV::pb::demo.others {
Taste::coordinates => "727 380 1501 995";
Deployment::Port_Number => 0;
};
native_proc : PROCESSOR ocarina_processors_x86::x86.linux {
Taste::coordinates => "652 291 1682 1031";
};
PROPERTIES
Taste::APLC_Binding => (reference (demo)) APPLIES TO IV_A;
Taste::APLC_Binding => (reference (demo)) APPLIES TO IV_B;
Taste::APLC_Binding => (reference (demo)) APPLIES TO IV_some_GUI;
Actual_Processor_Binding => (reference (native_proc)) APPLIES TO demo;
END pb.others;
SYSTEM deploymentview
END deploymentview;
SYSTEM IMPLEMENTATION deploymentview.others
SUBCOMPONENTS
pb : SYSTEM pb.others {
Taste::coordinates => "634 269 2021 2031";
};
interfaceview : SYSTEM interfaceview::IV::interfaceview.others;
END deploymentview.others;
PROPERTIES
Taste::coordinates => "0 0 2970 2100";
Taste::version => "1.3.13";
Taste::interfaceView => "InterfaceView.aadl";
Taste::HWLibraries => ("../../../../tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
END deploymentview::DV;
-- copied aadl libraries
\ No newline at end of file
---------------------------------------------------
-- AADL2.0
-- TASTE
-- (c)Ellidiss Technologies
--
---------------------------------------------------
PACKAGE interfaceview::FV::A
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_Cyclic_Run
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_Cyclic_Run;
SUBPROGRAM IMPLEMENTATION PI_Cyclic_Run.others
END PI_Cyclic_Run.others;
SUBPROGRAM PI_from_gui
FEATURES
position : IN PARAMETER DataView::T_POS {
Taste::encoding => NATIVE;
};
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_from_gui;
SUBPROGRAM IMPLEMENTATION PI_from_gui.others
END PI_from_gui.others;
SUBPROGRAM RI_Hi
END RI_Hi;
SUBPROGRAM IMPLEMENTATION RI_Hi.others
END RI_Hi.others;
SUBPROGRAM RI_to_gui
FEATURES
position : IN PARAMETER DataView::T_POS {
Taste::encoding => NATIVE;
};
END RI_to_gui;
SUBPROGRAM IMPLEMENTATION RI_to_gui.others
END RI_to_gui.others;
END interfaceview::FV::A;
PACKAGE interfaceview::FV::B
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_Hello
FEATURES
in_param : IN PARAMETER DataView::T_POS {
Taste::encoding => ACN;
};
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_Hello;
SUBPROGRAM IMPLEMENTATION PI_Hello.others
END PI_Hello.others;
END interfaceview::FV::B;
PACKAGE interfaceview::FV::some_GUI
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_to_gui
FEATURES
position : IN PARAMETER DataView::T_POS {
Taste::encoding => NATIVE;
};
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_to_gui;
SUBPROGRAM IMPLEMENTATION PI_to_gui.others
END PI_to_gui.others;
SUBPROGRAM RI_from_gui
FEATURES
position : IN PARAMETER DataView::T_POS {
Taste::encoding => NATIVE;
};
END RI_from_gui;
SUBPROGRAM IMPLEMENTATION RI_from_gui.others
END RI_from_gui.others;
END interfaceview::FV::some_GUI;
PACKAGE interfaceview::IV
PUBLIC
WITH interfaceview::FV::A;
WITH interfaceview::FV::B;
WITH interfaceview::FV::some_GUI;
WITH interfaceview::FV;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SYSTEM A
FEATURES
PI_Cyclic_Run : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::A::PI_Cyclic_Run.others {
Taste::coordinates => "229 490";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 2000 ms;
Taste::Deadline => 0 ms;
Taste::InterfaceName => "Cyclic_Run";
};
PI_from_gui : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::A::PI_from_gui.others {
Taste::coordinates => "508 1015";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 0 ms;
Taste::Deadline => 0 ms;
Taste::InterfaceName => "from_gui";
};
RI_Hi : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::B::PI_Hello.others {
Taste::coordinates => "1019 413";
Taste::RCMoperationKind => sporadic;
Taste::InterfaceName => "Hi";
Taste::labelInheritance => "true";
};
RI_to_gui : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::some_GUI::PI_to_gui.others {
Taste::coordinates => "882 1015";
Taste::RCMoperationKind => any;
Taste::InterfaceName => "to_gui";
Taste::labelInheritance => "true";
};
PROPERTIES
Source_Language => (C);
END A;
SYSTEM IMPLEMENTATION A.others
SUBCOMPONENTS
Cyclic_Run_impl : SUBPROGRAM interfaceview::FV::A::PI_Cyclic_Run.others {
Compute_Execution_Time => 0 ms .. 0 ms;
};
from_gui_impl : SUBPROGRAM interfaceview::FV::A::PI_from_gui.others {
Compute_Execution_Time => 0 ms .. 0 ms;
};
CONNECTIONS
OpToPICnx_Cyclic_Run_impl : SUBPROGRAM ACCESS Cyclic_Run_impl -> PI_Cyclic_Run;
OpToPICnx_from_gui_impl : SUBPROGRAM ACCESS from_gui_impl -> PI_from_gui;
END A.others;
SYSTEM B
FEATURES
PI_Hello : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::B::PI_Hello.others {
Taste::coordinates => "1719 413";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 0 ms;
Taste::Deadline => 0 ms;
Taste::InterfaceName => "Hello";
};
PROPERTIES
Source_Language => (C);
END B;
SYSTEM IMPLEMENTATION B.others
SUBCOMPONENTS
Hello_impl : SUBPROGRAM interfaceview::FV::B::PI_Hello.others {
Compute_Execution_Time => 0 ms .. 0 ms;
};
CONNECTIONS
OpToPICnx_Hello_impl : SUBPROGRAM ACCESS Hello_impl -> PI_Hello;
END B.others;
SYSTEM some_GUI
FEATURES
PI_to_gui : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::some_GUI::PI_to_gui.others {
Taste::coordinates => "887 1308";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 0 ms;
Taste::Deadline => 0 ms;
Taste::InterfaceName => "to_gui";
};
RI_from_gui : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::A::PI_from_gui.others {
Taste::coordinates => "513 1308";
Taste::RCMoperationKind => any;
Taste::InterfaceName => "from_gui";
Taste::labelInheritance => "true";
};
PROPERTIES
Source_Language => (GUI);
END some_GUI;
SYSTEM IMPLEMENTATION some_GUI.others
SUBCOMPONENTS
to_gui_impl : SUBPROGRAM interfaceview::FV::some_GUI::PI_to_gui.others {
Compute_Execution_Time => 0 ms .. 0 ms;
};
CONNECTIONS
OpToPICnx_to_gui_impl : SUBPROGRAM ACCESS to_gui_impl -> PI_to_gui;
END some_GUI.others;
SYSTEM interfaceview
END interfaceview;
SYSTEM IMPLEMENTATION interfaceview.others
SUBCOMPONENTS
A : SYSTEM interfaceview::IV::A.others {
Taste::coordinates => "229 257 1019 1015";
};
B : SYSTEM interfaceview::IV::B.others {
Taste::coordinates => "1719 308 2433 1029";
};
-- { interfaceview::IV::interfaceview.others.some_GUI - 543 1713 1538 1857
--Gui is there to test the Python backend with ACN
--}
some_GUI : SYSTEM interfaceview::IV::some_GUI.others {
Taste::coordinates => "200 1308 1723 1903";
};
CONNECTIONS
A_from_gui_some_GUI_from_gui : SUBPROGRAM ACCESS A.PI_from_gui -> some_GUI.RI_from_gui {
Taste::coordinates => "513 1308 513 1161 508 1161 508 1015";
};
B_Hello_A_Hi : SUBPROGRAM ACCESS B.PI_Hello -> A.RI_Hi {
Taste::coordinates => "1019 413 1365 413 1365 413 1719 413";
};
some_GUI_to_gui_A_to_gui : SUBPROGRAM ACCESS some_GUI.PI_to_gui -> A.RI_to_gui {
Taste::coordinates => "882 1015 882 1161 887 1161 887 1308";
};
END interfaceview.others;
PROPERTIES
Taste::dataView => ("DataView");
Taste::dataViewPath => ("DataView.aadl");
Taste::coordinates => "0 0 2970 2100";
Taste::version => "1.3.13";
END interfaceview::IV;
PACKAGE interfaceview::FV
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
END interfaceview::FV;
KAZOO=../../kazoo
all: c
ada: test-parse-ada
make -C output.ada
cp a/a.c output.pohic/a/C/src
cp b/b.c output.pohic/b/C/src
cd output.ada/build && \
ocarina -x main.aadl && \
make -f Makefile.taste
c: test-parse-c # Polyorb_HI_C output
cp a/a.c output.pohic/a/C/src
cp b/b.c output.pohic/b/C/src
make -C output.pohic
test-parse-ada: clean-ada
$(KAZOO) --gw \
-o output.ada \
--glue \
--debug
test-parse-c: clean-c
$(KAZOO) -p --gw \
-o output.pohic \
--glue -g
buildsupport_pohic:
buildsupport -o output.buildsupport.pohic -p --aadlv2 --glue -i InterfaceView.aadl -c DeploymentView.aadl -d DataView.aadl ../common/ocarina_components.aadl ../common/TASTE_IV_Properties.aadl ../common/TASTE_DV_Properties.aadl
buildsupport_pohiada:
buildsupport -o output.buildsupport.ada --aadlv2 --glue -i InterfaceView.aadl -c DeploymentView.aadl -d DataView.aadl ../common/ocarina_components.aadl ../common/TASTE_IV_Properties.aadl ../common/TASTE_DV_Properties.aadl
gdb: clean
gdb --args $(KAZOO) --gw \
-o output.pohic \
--glue \
--debug
clean-ada:
rm -rf output.ada
clean-c:
rm -rf output.pohic
skeletons:
$(KAZOO) -p --gw --glue -o code && make -C code dataview
clean-skeletons:
rm -rf code
clean: clean-ada clean-c clean-skeletons
.PHONY: clean clean-ada clean-c test-parse-ada gdb test-parse-c buildsupport_pohic buildsupport_pohiada c skeletons clean-skeletons
Demo_ACN
Tests the ACN feature of the ASN.1 Compiler inside TASTE
/* Functions to be filled by the user (never overwritten by buildsupport tool) */
#include "a.h"
#include <stdio.h>
void a_startup()
{
/* Write your initialization code here,
but do not make any call to a required interface!! */
printf("[A] startup\n");
}
void a_PI_Cyclic_Run()
{
static asn1SccT_POS p = { .kind = first_choice_PRESENT, .u={.first_choice = 1}};
// p.kind = first_choice_PRESENT;
// p.u.first_choice = 1;
/* Write your code here! */
printf ("[A] Cyclic_Run (value = %lld)\n", p.u.first_choice);
a_RI_Hi (&p);
p.u.first_choice ++;
if (p.u.first_choice > 10)
p.u.first_choice = 1;
}
void a_PI_from_gui(const asn1SccT_POS *toto)
{
}
/* Functions to be filled by the user (never overwritten by buildsupport tool) */
#include "b.h"
#include <stdio.h>
void b_startup()
{
/* Write your initialization code here,
but do not make any call to a required interface!! */
printf ("[B] startup\n");
}
void b_PI_Hello(const asn1SccT_POS *IN_in_param)
{
/* Write your code here! */
printf ("[B] Hello (value = %lld)\n", IN_in_param->u.first_choice);
}
#!/bin/bash -e
# This script will build your TASTE system.
# 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
mkdir -p .cache
export PROJECT_CACHE=$HOME/.taste_AST_cache
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=$HOME/.taste_AST_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=$HOME/.taste_AST_cache
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 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" ]
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" \
--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
#!/usr/bin/env python
import sys
timeout = 5
binaries = [
"binary.c/binaries/demo"
]
expected = [
["\[A\] startup", "\[B\] startup"],
["\[B\] startup", "\[A\] startup"],
"\[A\] Cyclic_Run \(value = 1\)",
"\[B\] Hello \(value = 1\)",
"\[A\] Cyclic_Run \(value = 2\)",
"\[B\] Hello \(value = 2\)",
"\[A\] Cyclic_Run \(value = 3\)",
"\[B\] Hello \(value = 3\)",
"\[A\] Cyclic_Run \(value = 4\)",
"\[B\] Hello \(value = 4\)",
"\[A\] Cyclic_Run \(value = 5\)",
"\[B\] Hello \(value = 5\)",
"\[A\] Cyclic_Run \(value = 6\)",
"\[B\] Hello \(value = 6\)",
"\[A\] Cyclic_Run \(value = 7\)",
"\[B\] Hello \(value = 7\)",
"\[A\] Cyclic_Run \(value = 8\)",
"\[B\] Hello \(value = 8\)",
"\[A\] Cyclic_Run \(value = 9\)",
"\[B\] Hello \(value = 9\)",
"\[A\] Cyclic_Run \(value = 10\)",
"\[B\] Hello \(value = 10\)",
"\[A\] Cyclic_Run \(value = 1\)",
"\[B\] Hello \(value = 1\)"
]
sys.path.append("..")
import commonRegression
result = commonRegression.test(binaries, expected, timeout)
sys.exit(result)
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