Commit bf3991ad authored by Maxime Perrotin's avatar Maxime Perrotin

Add Demo_PeekPoke_Linux

parent 72529929
TASTE-Dataview DEFINITIONS ::= BEGIN
MyInteger[]
MyReal[]
MyBool[]
MyEnum[]
MySeq[]
MyChoice[]
MySeqOf[]
MyOctStr[]
END
\ No newline at end of file
TASTE-Dataview DEFINITIONS ::=
BEGIN
IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes;
-- ASN.1 Type definitions must start with an uppercase
-- Field names in records (SEQUENCE) must start with a lowercase
-- Underscores are not allowed: use dash (hyphen)
-- Simple types:
MyInteger ::= INTEGER (0..255)
MyReal ::= REAL (0.0 .. 1000.0)
MyBool ::= BOOLEAN
MyEnum ::= ENUMERATED { hello, world, how-are-you }
-- Complex types:
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.1
-- TASTE type deploymentview
--
-- generated code: do not edit
---------------------------------------------------
PACKAGE deploymentview::DV::Node1
PUBLIC
WITH Taste;
WITH Deployment;
WITH TASTE_DV_Properties;
PROCESS x86_partition
END x86_partition;
PROCESS IMPLEMENTATION x86_partition.others
END x86_partition.others;
END deploymentview::DV::Node1;
PACKAGE deploymentview::DV
PUBLIC
WITH interfaceview::IV::Function1;
WITH interfaceview::IV::Function2;
WITH interfaceview::IV::Peek_Poke::TASTE_Probe;
WITH interfaceview::IV::Peek_Poke::TASTE_Probe_Console;
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_Function1 : SYSTEM interfaceview::IV::Function1::Function1.others {
Taste::FunctionName => "Function1";
};
IV_Function2 : SYSTEM interfaceview::IV::Function2::Function2.others {
Taste::FunctionName => "Function2";
};
IV_TASTE_Probe : SYSTEM interfaceview::IV::Peek_Poke::TASTE_Probe::TASTE_Probe.others {
Taste::FunctionName => "TASTE_Probe";
};
IV_TASTE_Probe_Console : SYSTEM interfaceview::IV::Peek_Poke::TASTE_Probe_Console::TASTE_Probe_Console.others {
Taste::FunctionName => "TASTE_Probe_Console";
};
x86_partition : PROCESS deploymentview::DV::Node1::x86_partition.others {
Taste::coordinates => "103490 75961 138866 95559";
Deployment::Port_Number => 0;
};
x86_native : PROCESSOR ocarina_processors_x86::x86.native {
Taste::coordinates => "99068 70361 143288 98359";
};
PROPERTIES
Taste::APLC_Binding => (reference (x86_partition)) APPLIES TO IV_Function1;
Taste::APLC_Binding => (reference (x86_partition)) APPLIES TO IV_Function2;
Taste::APLC_Binding => (reference (x86_partition)) APPLIES TO IV_TASTE_Probe;
Taste::APLC_Binding => (reference (x86_partition)) APPLIES TO IV_TASTE_Probe_Console;
Actual_Processor_Binding => (reference (x86_native)) APPLIES TO x86_partition;
END Node1.others;
SYSTEM deploymentview
END deploymentview;
SYSTEM IMPLEMENTATION deploymentview.others
SUBCOMPONENTS
Node1 : SYSTEM Node1.others {
Taste::coordinates => "93541 62361 148815 102359";
};
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::Function1
PUBLIC
WITH interfaceview::IV::Function2;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_pulse
END PI_pulse;
SUBPROGRAM IMPLEMENTATION PI_pulse.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 0 ms;
END PI_pulse.others;
SUBPROGRAM RI_doSomething
FEATURES
abc : IN PARAMETER DataView::MyBool {
Taste::encoding => NATIVE;
};
END RI_doSomething;
SUBPROGRAM IMPLEMENTATION RI_doSomething.others
END RI_doSomething.others;
SYSTEM Function1
FEATURES
PI_pulse : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Function1::PI_pulse.others {
Taste::coordinates => "103777 52283";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 1000 ms;
Taste::InterfaceName => "pulse";
};
RI_doSomething : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::Function2::PI_doSomething.others {
Taste::coordinates => "138579 52283";
Taste::RCMoperationKind => any;
Taste::InterfaceName => "doSomething";
Taste::labelInheritance => "true";
};
PROPERTIES
Source_Language => (C);
Taste::Active_Interfaces => any;
END Function1;
SYSTEM IMPLEMENTATION Function1.others
END Function1.others;
END interfaceview::IV::Function1;
PACKAGE interfaceview::IV::Function2
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_doSomething
FEATURES
abc : IN PARAMETER DataView::MyBool {
Taste::encoding => NATIVE;
};
END PI_doSomething;
SUBPROGRAM IMPLEMENTATION PI_doSomething.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 0 ms;
END PI_doSomething.others;
SYSTEM Function2
FEATURES
PI_doSomething : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Function2::PI_doSomething.others {
Taste::coordinates => "159209 55432";
Taste::RCMoperationKind => unprotected;
Taste::InterfaceName => "doSomething";
};
PROPERTIES
Source_Language => (C);
Taste::Active_Interfaces => any;
END Function2;
SYSTEM IMPLEMENTATION Function2.others
END Function2.others;
END interfaceview::IV::Function2;
PACKAGE interfaceview::IV::Peek_Poke::TASTE_Probe
PUBLIC
WITH interfaceview::IV::Peek_Poke::TASTE_Probe_Console;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_add_monitorings
FEATURES
monitorings : IN PARAMETER DataView::TASTE_Peek_list {
Taste::encoding => UPER;
};
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_add_monitorings;
SUBPROGRAM IMPLEMENTATION PI_add_monitorings.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 0 ms;
END PI_add_monitorings.others;
SUBPROGRAM PI_patch_memory
FEATURES
pokes : IN PARAMETER DataView::TASTE_Poke_list {
Taste::encoding => UPER;
};
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_patch_memory;
SUBPROGRAM IMPLEMENTATION PI_patch_memory.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 0 ms;
END PI_patch_memory.others;
SUBPROGRAM PI_remove_monitorings
FEATURES
ids : IN PARAMETER DataView::TASTE_Peek_id_list {
Taste::encoding => UPER;
};
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_remove_monitorings;
SUBPROGRAM IMPLEMENTATION PI_remove_monitorings.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 0 ms;
END PI_remove_monitorings.others;
SUBPROGRAM PI_periodic_monitoring
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_periodic_monitoring;
SUBPROGRAM IMPLEMENTATION PI_periodic_monitoring.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 0 ms;
END PI_periodic_monitoring.others;
SUBPROGRAM RI_update_monitorings
FEATURES
monitorings : IN PARAMETER DataView::TASTE_Monitoring_list {
Taste::encoding => UPER;
};
END RI_update_monitorings;
SUBPROGRAM IMPLEMENTATION RI_update_monitorings.others
END RI_update_monitorings.others;
SYSTEM TASTE_Probe
FEATURES
PI_add_monitorings : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Peek_Poke::TASTE_Probe::PI_add_monitorings.others {
Taste::coordinates => "149125 93209";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 0 ms;
Taste::Deadline => 1000 ms;
Taste::InterfaceName => "add_monitorings";
};
PI_patch_memory : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Peek_Poke::TASTE_Probe::PI_patch_memory.others {
Taste::coordinates => "149125 97934";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 0 ms;
Taste::Deadline => 0 ms;
Taste::InterfaceName => "patch_memory";
};
PI_remove_monitorings : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Peek_Poke::TASTE_Probe::PI_remove_monitorings.others {
Taste::coordinates => "149125 96359";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 1000 ms;
Taste::Deadline => 1000 ms;
Taste::InterfaceName => "remove_monitorings";
};
PI_periodic_monitoring : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Peek_Poke::TASTE_Probe::PI_periodic_monitoring.others {
Taste::coordinates => "157000 91634";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 100 ms;
Taste::Deadline => 100 ms;
Taste::InterfaceName => "periodic_monitoring";
};
RI_update_monitorings : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::Peek_Poke::TASTE_Probe_Console::PI_update_monitorings.others {
Taste::coordinates => "149125 102659";
Taste::RCMoperationKind => sporadic;
Taste::InterfaceName => "update_monitorings";
Taste::labelInheritance => "true";
};
PROPERTIES
Source_Language => (C);
Taste::Active_Interfaces => enabled;
Source_Text => ("/home/taste/tool-inst/share/components_library/peekpoke/taste_probe.zip");
END TASTE_Probe;
SYSTEM IMPLEMENTATION TASTE_Probe.others
SUBCOMPONENTS
max_monitoring_number : DATA DataView::TASTE_Peek_limit {
Taste::FS_Default_Value => "10";
};
END TASTE_Probe.others;
END interfaceview::IV::Peek_Poke::TASTE_Probe;
PACKAGE interfaceview::IV::Peek_Poke::TASTE_Probe_Console
PUBLIC
WITH interfaceview::IV::Peek_Poke::TASTE_Probe;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_update_monitorings
FEATURES
monitorings : IN PARAMETER DataView::TASTE_Monitoring_list {
Taste::encoding => UPER;
};
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_update_monitorings;
SUBPROGRAM IMPLEMENTATION PI_update_monitorings.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 0 ms;
END PI_update_monitorings.others;
SUBPROGRAM RI_add_monitorings
FEATURES
monitorings : IN PARAMETER DataView::TASTE_Peek_list {
Taste::encoding => UPER;
};
END RI_add_monitorings;
SUBPROGRAM IMPLEMENTATION RI_add_monitorings.others
END RI_add_monitorings.others;
SUBPROGRAM RI_patch_memory
FEATURES
pokes : IN PARAMETER DataView::TASTE_Poke_list {
Taste::encoding => UPER;
};
END RI_patch_memory;
SUBPROGRAM IMPLEMENTATION RI_patch_memory.others
END RI_patch_memory.others;
SUBPROGRAM RI_remove_monitorings
FEATURES
ids : IN PARAMETER DataView::TASTE_Peek_id_list {
Taste::encoding => UPER;
};
END RI_remove_monitorings;
SUBPROGRAM IMPLEMENTATION RI_remove_monitorings.others
END RI_remove_monitorings.others;
SYSTEM TASTE_Probe_Console
FEATURES
PI_update_monitorings : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Peek_Poke::TASTE_Probe_Console::PI_update_monitorings.others {
Taste::coordinates => "132027 103386";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 0 ms;
Taste::Deadline => 0 ms;
Taste::InterfaceName => "update_monitorings";
};
RI_add_monitorings : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::Peek_Poke::TASTE_Probe::PI_add_monitorings.others {
Taste::coordinates => "132027 92361";
Taste::RCMoperationKind => sporadic;
Taste::InterfaceName => "add_monitorings";
Taste::labelInheritance => "true";
};
RI_patch_memory : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::Peek_Poke::TASTE_Probe::PI_patch_memory.others {
Taste::coordinates => "132027 97086";
Taste::RCMoperationKind => sporadic;
Taste::InterfaceName => "patch_memory";
Taste::labelInheritance => "true";
};
RI_remove_monitorings : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::Peek_Poke::TASTE_Probe::PI_remove_monitorings.others {
Taste::coordinates => "132027 95511";
Taste::RCMoperationKind => sporadic;
Taste::InterfaceName => "remove_monitorings";
Taste::labelInheritance => "true";
};
PROPERTIES
Source_Language => (GUI);
Taste::Active_Interfaces => enabled;
END TASTE_Probe_Console;
SYSTEM IMPLEMENTATION TASTE_Probe_Console.others
END TASTE_Probe_Console.others;
END interfaceview::IV::Peek_Poke::TASTE_Probe_Console;
PACKAGE interfaceview::IV::Peek_Poke
PUBLIC
WITH interfaceview::IV::Peek_Poke::TASTE_Probe;
WITH interfaceview::IV::Peek_Poke::TASTE_Probe_Console;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SYSTEM Peek_Poke
PROPERTIES
Source_Language => (C);
Taste::Active_Interfaces => any;
END Peek_Poke;
SYSTEM IMPLEMENTATION Peek_Poke.others
SUBCOMPONENTS
TASTE_Probe : SYSTEM interfaceview::IV::Peek_Poke::TASTE_Probe::TASTE_Probe.others {
Taste::coordinates => "149125 91634 173430 111276";
};
TASTE_Probe_Console : SYSTEM interfaceview::IV::Peek_Poke::TASTE_Probe_Console::TASTE_Probe_Console.others {
Taste::coordinates => "109559 90786 132027 111135";
};
CONNECTIONS
TASTE_Probe_PI_add_monitorings_TASTE_Probe_Console_RI_add_monitorings : SUBPROGRAM ACCESS TASTE_Probe.PI_add_monitorings -> TASTE_Probe_Console.RI_add_monitorings {
Taste::coordinates => "132027 92361 140576 92361 140576 93209 149125 93209";
};
TASTE_Probe_PI_patch_memory_TASTE_Probe_Console_RI_patch_memory : SUBPROGRAM ACCESS TASTE_Probe.PI_patch_memory -> TASTE_Probe_Console.RI_patch_memory {
Taste::coordinates => "132027 97086 140576 97086 140576 97934 149125 97934";
};
TASTE_Probe_PI_remove_monitorings_TASTE_Probe_Console_RI_remove_monitorings : SUBPROGRAM ACCESS TASTE_Probe.PI_remove_monitorings -> TASTE_Probe_Console.RI_remove_monitorings {
Taste::coordinates => "132027 95511 140576 95511 140576 96359 149125 96359";
};
TASTE_Probe_Console_PI_update_monitorings_TASTE_Probe_RI_update_monitorings : SUBPROGRAM ACCESS TASTE_Probe_Console.PI_update_monitorings -> TASTE_Probe.RI_update_monitorings {
Taste::coordinates => "149125 102659 140576 102659 140576 103386 132027 103386";
};
END Peek_Poke.others;
END interfaceview::IV::Peek_Poke;
PACKAGE interfaceview::IV
PUBLIC
WITH interfaceview::IV::Function1;
WITH interfaceview::IV::Function2;
WITH interfaceview::IV::Peek_Poke;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SYSTEM interfaceview
END interfaceview;
SYSTEM IMPLEMENTATION interfaceview.others
SUBCOMPONENTS
Function1 : SYSTEM interfaceview::IV::Function1::Function1.others {
Taste::coordinates => "103777 49133 138579 74801";
};
Function2 : SYSTEM interfaceview::IV::Function2::Function2.others {
Taste::coordinates => "159209 50707 188184 74801";
};
Peek_Poke : SYSTEM interfaceview::IV::Peek_Poke::Peek_Poke.others {
Taste::coordinates => "105037 85982 179365 117635";
TASTE_IV_Properties::Version => "5";
Taste::Fill_Color => "#A3C4A4";
};
CONNECTIONS
Function2_PI_doSomething_Function1_RI_doSomething : SUBPROGRAM ACCESS Function2.PI_doSomething -> Function1.RI_doSomething {
Taste::coordinates => "138579 52283 148894 52283 148894 55432 159209 55432";
};
END interfaceview.others;
PROPERTIES
Taste::dataView => ("DataView");
Taste::dataViewPath => ("DataView.aadl");
Taste::coordinates => "0 0 297000 210000";
Taste::version => "2.0";
END interfaceview::IV;
Test the PeekPoke functionality with imported component from TASTE V2
Compile and link with -no-pie to make sure the symbols are absolute in the binaries
#!/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
# Use PolyORB-HI-C runtime
USE_POHIC=1
# 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
taste-extract-asn-from-design.exe -i "$INTERFACEVIEW" -j /tmp/dv.asn
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 [ -f user_init_post.sh ]
then
echo -e "${INFO} Executing user-defined post-init script"
source user_init_post.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 \
--aadlv2 \
--keep-case \
--interfaceView "$INTERFACEVIEW" \
--deploymentView "$DEPLOYMENTVIEW" \
-o "$OUTPUTDIR" \
--subC function1:"$SKELS"/function1.zip \
--subC function2:"$SKELS"/function2.zip \
--subC taste_probe:/home/taste/tool-inst/share/components_library/peekpoke/taste_probe.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
/* User code: This file will not be overwritten by TASTE. */
#include "function1.h"
int maxime;
int thanassis = 42;
void function1_startup()
{
maxime = 1;
/* Write your initialization code here,
but do not make any call to a required interface. */
}
void function1_PI_pulse()
{
puts("pulse");
maxime ++;
thanassis ++;
/* Write your code here! */
}
/* This file was generated automatically: DO NOT MODIFY IT ! */
/* Declaration of the functions that have to be provided by the user */
#ifndef __USER_CODE_H_function1__
#define __USER_CODE_H_function1__
#include "C_ASN1_Types.h"
#ifdef __cplusplus
extern "C" {
#endif
void function1_startup();