Commit 8afaa6eb authored by Maxime Perrotin's avatar Maxime Perrotin

Add test for the crazyflie target

..Just blinking leds
parent 3ce86c50
This diff is collapsed.
TASTE-Dataview DEFINITIONS ::=
BEGIN
IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes;
-- A few simple types to start with ASN.1
MyInteger ::= T-UInt8
MyReal ::= REAL (0.0 .. 1000.0)
MyBool ::= BOOLEAN
MyEnum ::= ENUMERATED { hello, world, howareyou }
MySeq ::= SEQUENCE {
input-data MyInteger,
output-data MyInteger,
validity ENUMERATED { valid, invalid }
}
MyChoice ::= CHOICE {
a BOOLEAN,
b MySeq
}
MySeqOf ::= SEQUENCE (SIZE (2)) OF MyEnum
MyOctStr ::= OCTET STRING (SIZE (3))
-- You can also declare constants
myVar MySeqOf ::= { hello, world }
END
---------------------------------------------------
-- AADL2.0
-- TASTE
--
--
---------------------------------------------------
PACKAGE deploymentview::DV::Node1
PUBLIC
WITH Taste;
WITH Deployment;
WITH TASTE_DV_Properties;
PROCESS cortex_m_partition
END cortex_m_partition;
PROCESS IMPLEMENTATION cortex_m_partition.others
END cortex_m_partition.others;
END deploymentview::DV::Node1;
PACKAGE deploymentview::DV
PUBLIC
WITH ocarina_processors_arm;
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_Function1 : SYSTEM interfaceview::IV::Function1.others {
Taste::coordinates => "708 975 1103 1303";
Taste::FunctionName => "Function1";
};
IV_Function2 : SYSTEM interfaceview::IV::Function2.others {
Taste::coordinates => "1195 928 1565 1334";
Taste::FunctionName => "Function2";
};
cortex_m_partition : PROCESS deploymentview::DV::Node1::cortex_m_partition.others {
Taste::coordinates => "653 746 1769 1453";
Deployment::Port_Number => 0;
};
cortex_m_i : PROCESSOR ocarina_processors_arm::cortex_m.i {
Taste::coordinates => "513 544 1909 1554";
};
PROPERTIES
Taste::APLC_Binding => (reference (cortex_m_partition)) APPLIES TO IV_Function1;
Taste::APLC_Binding => (reference (cortex_m_partition)) APPLIES TO IV_Function2;
Actual_Processor_Binding => (reference (cortex_m_i)) APPLIES TO cortex_m_partition;
END Node1.others;
SYSTEM deploymentview
END deploymentview;
SYSTEM IMPLEMENTATION deploymentview.others
SUBCOMPONENTS
Node1 : SYSTEM Node1.others {
Taste::coordinates => "339 256 2083 1698";
};
interfaceview : SYSTEM interfaceview::IV::interfaceview.others;
END deploymentview.others;
PROPERTIES
Taste::coordinates => "0 0 2970 2100";
Taste::version => "1.3.19";
Taste::interfaceView => "InterfaceView.aadl";
Taste::HWLibraries => ("../../tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
END deploymentview::DV;
---------------------------------------------------
-- AADL2.0
-- TASTE
--
--
---------------------------------------------------
PACKAGE interfaceview::FV::Function1
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_pulse
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_pulse;
SUBPROGRAM IMPLEMENTATION PI_pulse.others
END PI_pulse.others;
SUBPROGRAM RI_Blink
FEATURES
EnableDisable : IN PARAMETER DataView::MyBool {
Taste::encoding => NATIVE;
};
END RI_Blink;
SUBPROGRAM IMPLEMENTATION RI_Blink.others
END RI_Blink.others;
END interfaceview::FV::Function1;
PACKAGE interfaceview::FV::Function2
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_Blink
FEATURES
EnableDisable : IN PARAMETER DataView::MyBool {
Taste::encoding => NATIVE;
};
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_Blink;
SUBPROGRAM IMPLEMENTATION PI_Blink.others
END PI_Blink.others;
END interfaceview::FV::Function2;
PACKAGE interfaceview::IV
PUBLIC
WITH interfaceview::FV::Function1;
WITH interfaceview::FV::Function2;
WITH interfaceview::FV;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SYSTEM Function1
FEATURES
PI_pulse : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::Function1::PI_pulse.others {
Taste::coordinates => "308 559";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 1000 ms;
Taste::Deadline => 0 ms;
Taste::InterfaceName => "pulse";
};
RI_Blink : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::Function2::PI_Blink.others {
Taste::coordinates => "1165 595";
Taste::RCMoperationKind => any;
Taste::InterfaceName => "Blink";
Taste::labelInheritance => "true";
};
PROPERTIES
Source_Language => (SDL);
END Function1;
SYSTEM IMPLEMENTATION Function1.others
SUBCOMPONENTS
pulse_impl : SUBPROGRAM interfaceview::FV::Function1::PI_pulse.others {
Compute_Execution_Time => 0 ms .. 0 ms;
};
CONNECTIONS
OpToPICnx_pulse_impl : SUBPROGRAM ACCESS pulse_impl -> PI_pulse;
END Function1.others;
SYSTEM Function2
FEATURES
PI_Blink : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::Function2::PI_Blink.others {
Taste::coordinates => "1534 616";
Taste::RCMoperationKind => unprotected;
Taste::RCMperiod => 0 ms;
Taste::Deadline => 0 ms;
Taste::InterfaceName => "Blink";
};
PROPERTIES
Source_Language => (Ada);
END Function2;
SYSTEM IMPLEMENTATION Function2.others
SUBCOMPONENTS
Blink_impl : SUBPROGRAM interfaceview::FV::Function2::PI_Blink.others {
Compute_Execution_Time => 0 ms .. 0 ms;
};
CONNECTIONS
OpToPICnx_Blink_impl : SUBPROGRAM ACCESS Blink_impl -> PI_Blink;
END Function2.others;
SYSTEM interfaceview
END interfaceview;
SYSTEM IMPLEMENTATION interfaceview.others
SUBCOMPONENTS
Function1 : SYSTEM interfaceview::IV::Function1.others {
Taste::coordinates => "308 421 1165 1247";
};
Function2 : SYSTEM interfaceview::IV::Function2.others {
Taste::coordinates => "1534 415 2334 1205";
};
CONNECTIONS
Function2_Blink_Function1_Blink : SUBPROGRAM ACCESS Function2.PI_Blink -> Function1.RI_Blink {
Taste::coordinates => "1165 595 1347 595 1347 616 1534 616";
};
END interfaceview.others;
PROPERTIES
Taste::dataView => ("DataView");
Taste::dataViewPath => ("DataView.aadl");
Taste::coordinates => "0 0 2970 2100";
Taste::version => "1.3.19";
END interfaceview::IV;
PACKAGE interfaceview::FV
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
END interfaceview::FV;
#!/bin/bash
# This script will build your TASTE system (by default with the C runtime).
# You should not change this file as it was automatically generated.
# If you need additional preprocessing, create a file named 'user_init_pre.sh'
# and/or 'user_init_post.sh - They will never get overwritten.'
# 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 0 ] ; 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
# 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="./"
# Update the data view with local paths
taste-update-data-view
# Generate code for OpenGEODE function function1
cd "$SKELS"/function1 && opengeode --toAda function1.pr system_structure.pr && cd $OLDPWD
cd "$SKELS" && rm -f function1.zip && zip function1 function1/* && cd $OLDPWD
cd "$SKELS" && rm -f function2.zip && zip function2 function2/* && cd $OLDPWD
[ ! -z "$CLEANUP" ] && rm -rf binary*
if [ -f ConcurrencyView.pro ]
then
ORCHESTRATOR_OPTIONS+=" -w ConcurrencyView.pro "
fi
if [ ! -z "$USE_POHIC" ]
then
OUTPUTDIR=binary.c
ORCHESTRATOR_OPTIONS+=" -p "
elif [ ! -z "$USE_POHIADA" ]
then
OUTPUTDIR=binary.ada
else
OUTPUTDIR=binary
fi
if [ -f user_init_post.sh ]
then
echo -e "${INFO} Executing user-defined init script"
source user_init_post.sh
fi
cd "$CWD" && assert-builder-ocarina.py \
--fast \
--aadlv2 \
--keep-case \
--interfaceView "$INTERFACEVIEW" \
--deploymentView "$DEPLOYMENTVIEW" \
-o "$OUTPUTDIR" \
--subAda function1:"$SKELS"/function1.zip \
--subAda function2:"$SKELS"/function2.zip \
$ORCHESTRATOR_OPTIONS
TASTE-Dataview DEFINITIONS ::=
BEGIN
IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes;
-- A few simple types to start with ASN.1
MyInteger ::= T-UInt8
MyReal ::= REAL (0.0 .. 1000.0)
MyBool ::= BOOLEAN
MyEnum ::= ENUMERATED { hello, world, howareyou }
MySeq ::= SEQUENCE {
input-data MyInteger,
output-data MyInteger,
validity ENUMERATED { valid, invalid }
}
MyChoice ::= CHOICE {
a BOOLEAN,
b MySeq
}
MySeqOf ::= SEQUENCE (SIZE (2)) OF MyEnum
MyOctStr ::= OCTET STRING (SIZE (3))
-- You can also declare constants
myVar MySeqOf ::= { hello, world }
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 function1;
/* CIF TEXT (670, 174), (270, 140) */
dcl mode MyBool := false;
/* CIF ENDTEXT */
/* CIF START (409, 22), (70, 35) */
START;
/* CIF NEXTSTATE (409, 72), (70, 35) */
NEXTSTATE Wait;
/* CIF state (409, 72), (70, 35) */
state Wait;
/* CIF input (409, 127), (70, 35) */
input pulse;
/* CIF PROCEDURECALL (394, 182), (99, 35) */
call Blink(mode);
/* CIF task (378, 237), (131, 35) */
task mode := not mode;
/* CIF NEXTSTATE (409, 292), (70, 35) */
NEXTSTATE Wait;
endstate;
endprocess function1;
\ No newline at end of file
/* CIF Keep Specific Geode ASNFilename 'dataview-uniq.asn' */
USE Datamodel;
SYSTEM function1;
SIGNAL pulse;
PROCEDURE Blink COMMENT '#c_predef';
FPAR
IN EnableDisable MyBool;
EXTERNAL;
CHANNEL c
FROM ENV TO function1 WITH pulse;
ENDCHANNEL;
BLOCK function1;
SIGNALROUTE r
FROM ENV TO function1 WITH pulse;
CONNECT c and r;
PROCESS function1 REFERENCED;
ENDBLOCK;
ENDSYSTEM;
\ No newline at end of file
-- User implementation of the function2 function
-- This file will never be overwritten once edited and modified
-- Only the interface of functions is regenerated (in the .ads file)
pragma style_checks (off);
pragma warnings (off);
with adaasn1rtl;
use adaasn1rtl;
with TASTE_Dataview;
use TASTE_Dataview;
with STM32.Board;
use STM32.Board;
with STM32.GPIO;
use STM32.GPIO;
with STM32.Device;
use STM32.Device;
package body function2 is
---------------------------------------------------------
-- Provided interface "Blink"
---------------------------------------------------------
procedure Blink(EnableDisable: access asn1sccMyBool) is
pragma suppress (all_checks);
My_Led : User_LED renames PD5;
begin
if boolean(EnableDisable.all) then
All_LEDs_On;
else
All_LEDs_Off;
end if;
end Blink;
begin
STM32.Board.Initialize_LEDs;
end function2;
-- This file was generated automatically: DO NOT MODIFY IT !
-- Declaration of the provided and required interfaces
pragma style_checks (off);
pragma warnings (off);
with adaasn1rtl;
use adaasn1rtl;
with TASTE_Dataview;
use TASTE_Dataview;
package function2 is
---------------------------------------------------------
-- Provided interface "Blink"
---------------------------------------------------------
procedure Blink(EnableDisable: access asn1sccMyBool);
pragma export(C, Blink, "function2_PI_Blink");
---------------------------------------------------------
-- Provided interface "pulse"
---------------------------------------------------------
procedure pulse;
pragma export(C, pulse, "function2_PI_pulse");
end function2;
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
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