Commit a32b3a33 authored by Maxime Perrotin's avatar Maxime Perrotin

Add testcase for the support of OPTIONAL fields

parent 9f937c62
TASTE-Dataview DEFINITIONS ::= BEGIN
-- In this ACN model, you can specify custom binary encoding rules for
-- your data types. For example if you require a specific memory layout
-- for a record, or need to add padding fields, define endianness, etc.
-- you can do that with ACN. Refer to the ACN user manual for details.
-- TASTE-Boolean []
END
TASTE-Dataview DEFINITIONS ::=
BEGIN
IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes;
TASTE-Boolean ::= BOOLEAN
MySeq ::= SEQUENCE {
a BOOLEAN OPTIONAL,
b CHOICE {
a BOOLEAN,
b SEQUENCE (SIZE (1..3)) OF BOOLEAN
},
c BOOLEAN OPTIONAL,
d BOOLEAN OPTIONAL
}
Foo ::= MySeq (WITH COMPONENTS {..., c PRESENT, d ABSENT })
END
---------------------------------------------------
-- AADL2.1
-- TASTE type deploymentview
--
-- generated code: do not edit
---------------------------------------------------
PACKAGE deploymentview::DV::Node1
PUBLIC
WITH Taste;
WITH Deployment;
WITH TASTE_DV_Properties;
PROCESS demo
END demo;
PROCESS IMPLEMENTATION demo.others
END demo.others;
END deploymentview::DV::Node1;
PACKAGE deploymentview::DV
PUBLIC
WITH interfaceview::IV::ground;
WITH interfaceview::IV::Flight;
WITH ocarina_processors_x86;
WITH deploymentview::DV::Node1;
WITH Taste;
WITH Deployment;
WITH interfaceview::IV;
WITH TASTE_DV_Properties;
SYSTEM Node1
END Node1;
SYSTEM IMPLEMENTATION Node1.others
SUBCOMPONENTS
IV_ground : SYSTEM interfaceview::IV::ground::ground.others {
Taste::FunctionName => "ground";
};
IV_Flight : SYSTEM interfaceview::IV::Flight::Flight.others {
Taste::FunctionName => "Flight";
};
demo : PROCESS deploymentview::DV::Node1::demo.others {
Taste::coordinates => "98252 78123 120676 96329";
Deployment::Port_Number => 0;
};
x86_linux : PROCESSOR ocarina_processors_x86::x86.linux {
Taste::coordinates => "95449 72921 123479 98930";
};
PROPERTIES
Taste::APLC_Binding => (reference (demo)) APPLIES TO IV_ground;
Taste::APLC_Binding => (reference (demo)) APPLIES TO IV_Flight;
Actual_Processor_Binding => (reference (x86_linux)) APPLIES TO demo;
END Node1.others;
SYSTEM deploymentview
END deploymentview;
SYSTEM IMPLEMENTATION deploymentview.others
SUBCOMPONENTS
Node1 : SYSTEM Node1.others {
Taste::coordinates => "91945 65490 126983 102645";
};
interfaceview : SYSTEM interfaceview::IV::interfaceview.others;
END deploymentview.others;
PROPERTIES
Taste::coordinates => "0 0 297000 210000";
Taste::version => "2.0";
Taste::interfaceView => "InterfaceView.aadl";
Taste::HWLibraries => ("../../../tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
END deploymentview::DV;
---------------------------------------------------
-- AADL2.1
-- TASTE type interfaceview
--
-- generated code: do not edit
---------------------------------------------------
PACKAGE interfaceview::IV::ground
PUBLIC
WITH interfaceview::IV::Flight;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_didSomething
FEATURES
a : IN PARAMETER DataView::Foo {
Taste::encoding => NATIVE;
};
END PI_didSomething;
SUBPROGRAM IMPLEMENTATION PI_didSomething.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 0 ms;
END PI_didSomething.others;
SUBPROGRAM RI_doSomething
FEATURES
a : IN PARAMETER DataView::Foo {
Taste::encoding => NATIVE;
};
END RI_doSomething;
SUBPROGRAM IMPLEMENTATION RI_doSomething.others
END RI_doSomething.others;
SYSTEM ground
FEATURES
PI_didSomething : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::ground::PI_didSomething.others {
Taste::coordinates => "110879 64667";
Taste::RCMoperationKind => sporadic;
Taste::InterfaceName => "didSomething";
};
RI_doSomething : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::Flight::PI_doSomething.others {
Taste::coordinates => "97943 64667";
Taste::RCMoperationKind => any;
Taste::InterfaceName => "doSomething";
Taste::labelInheritance => "true";
};
PROPERTIES
Source_Language => (GUI);
Taste::Active_Interfaces => any;
END ground;
SYSTEM IMPLEMENTATION ground.others
END ground.others;
END interfaceview::IV::ground;
PACKAGE interfaceview::IV::Flight
PUBLIC
WITH interfaceview::IV::ground;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_doSomething
FEATURES
a : IN PARAMETER DataView::Foo {
Taste::encoding => NATIVE;
};
END PI_doSomething;
SUBPROGRAM IMPLEMENTATION PI_doSomething.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 0 ms;
END PI_doSomething.others;
SUBPROGRAM RI_didSomething
FEATURES
a : IN PARAMETER DataView::Foo {
Taste::encoding => NATIVE;
};
END RI_didSomething;
SUBPROGRAM IMPLEMENTATION RI_didSomething.others
END RI_didSomething.others;
SYSTEM Flight
FEATURES
PI_doSomething : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Flight::PI_doSomething.others {
Taste::coordinates => "98882 57730";
Taste::RCMoperationKind => sporadic;
Taste::InterfaceName => "doSomething";
};
RI_didSomething : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::ground::PI_didSomething.others {
Taste::coordinates => "113109 57730";
Taste::RCMoperationKind => any;
Taste::InterfaceName => "didSomething";
Taste::labelInheritance => "true";
};
PROPERTIES
Source_Language => (SDL);
Taste::Active_Interfaces => any;
END Flight;
SYSTEM IMPLEMENTATION Flight.others
END Flight.others;
END interfaceview::IV::Flight;
PACKAGE interfaceview::IV
PUBLIC
WITH interfaceview::IV::ground;
WITH interfaceview::IV::Flight;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SYSTEM interfaceview
PROPERTIES
Taste::dataView => ("DataView");
Taste::dataViewPath => ("DataView.aadl");
END interfaceview;
SYSTEM IMPLEMENTATION interfaceview.others
SUBCOMPONENTS
ground : SYSTEM interfaceview::IV::ground::ground.others {
Taste::coordinates => "94415 64667 116754 83950";
};
Flight : SYSTEM interfaceview::IV::Flight::Flight.others {
Taste::coordinates => "92768 41152 117342 57730";
};
CONNECTIONS
ground_PI_didSomething_Flight_RI_didSomething : SUBPROGRAM ACCESS ground.PI_didSomething -> Flight.RI_didSomething {
Taste::coordinates => "113109 57730 113109 61198 110879 61198 110879 64667";
};
Flight_PI_doSomething_ground_RI_doSomething : SUBPROGRAM ACCESS Flight.PI_doSomething -> ground.RI_doSomething {
Taste::coordinates => "97943 64667 97943 61198 98882 61198 98882 57730";
};
END interfaceview.others;
PROPERTIES
Taste::dataView => ("DataView");
Taste::dataViewPath => ("DataView.aadl");
Taste::coordinates => "0 0 297000 210000";
Taste::version => "2.0";
END interfaceview::IV;
This project is used to validate the support of OPTIONAL fields in the GUI
#!/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
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
};
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
# Generate code for OpenGEODE function flight
cd "$SKELS"/flight && opengeode --toAda flight.pr system_structure.pr && cd $OLDPWD || exit -1
cd "$SKELS" && rm -f flight.zip && zip -r flight flight/* && cd $OLDPWD || exit -1
[ ! -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" \
--subAda flight:"$SKELS"/flight.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
TASTE-Dataview DEFINITIONS ::=
BEGIN
IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes;
TASTE-Boolean ::= BOOLEAN
MySeq ::= SEQUENCE {
a BOOLEAN OPTIONAL,
b CHOICE {
a BOOLEAN,
b SEQUENCE (SIZE (1..3)) OF BOOLEAN
},
c BOOLEAN OPTIONAL,
d BOOLEAN OPTIONAL
}
Foo ::= MySeq (WITH COMPONENTS {..., c PRESENT, d ABSENT })
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
/* CIF PROCESS (250, 150), (150, 75) */
process flight;
/* CIF TEXT (611, 113), (290, 200) */
-- Text area for declarations and comments
dcl a Foo;
/* CIF ENDTEXT */
/* CIF START (320, 10), (70, 35) */
START;
/* CIF NEXTSTATE (320, 60), (70, 35) */
NEXTSTATE Wait;
/* CIF state (320, 60), (70, 35) */
state Wait;
/* CIF input (292, 115), (125, 35) */
input doSomething(a);
/* CIF output (291, 170), (128, 35) */
output didSomething(a);
/* CIF NEXTSTATE (320, 225), (70, 35) */
NEXTSTATE -;
endstate;
endprocess flight;
\ No newline at end of file
/* CIF Keep Specific Geode ASNFilename 'dataview-uniq.asn' */
USE Datamodel;
SYSTEM flight;
/* CIF Keep Specific Geode PARAMNAMES a */
SIGNAL doSomething (Foo);
/* CIF Keep Specific Geode PARAMNAMES a */
SIGNAL didSomething (Foo);
CHANNEL c
FROM ENV TO flight WITH doSomething;
FROM flight TO ENV WITH didSomething;
ENDCHANNEL;
BLOCK flight;
SIGNALROUTE r
FROM ENV TO flight WITH doSomething;
FROM flight TO ENV WITH didSomething;
CONNECT c and r;
PROCESS flight REFERENCED;
ENDBLOCK;
ENDSYSTEM;
\ No newline at end of file
#!/bin/bash
taste-update-data-view
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