Commits (3)
......@@ -68,7 +68,7 @@ configuration project Raspberry_PI is
for Driver ("C++") use "arm-linux-gnueabihf-g++";
for Leading_Required_Switches ("C") use ("-c", "-x", "c");
for Leading_Required_Switches ("C++") use ("-c", "-x", "c");
for Leading_Required_Switches ("C++") use ("-c", "-x", "c++");
for Required_Switches("Ada") use ("-c", "-x", "ada");
Common_C_Switches :=
......
......@@ -77,6 +77,6 @@ PROPERTIES
Taste::coordinates => "0 0 297000 210000";
Taste::version => "2.4";
Taste::interfaceView => "InterfaceView.aadl";
Taste::HWLibraries => ("../../../../tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
Taste::HWLibraries => ("/home/taste/tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
END deploymentview::DV;
......@@ -128,7 +128,7 @@ IMPORTS
T-Null, T-Int, T-SeqOf FROM Iterators-Types
T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean, T-Null-Record FROM TASTE-BasicTypes;
Orchestrator-States ::= ENUMERATED {wait, all-done, step-2}
Orchestrator-States ::= ENUMERATED {step-2, all-done, wait}
Orchestrator-Context ::= SEQUENCE {
state Orchestrator-States,
......
system my_observer;
/* CIF TEXT (147, 177), (432, 136) */
/* CIF TEXT (145, 177), (483, 168) */
use datamodel comment 'observer.asn';
exported procedure observe;
......@@ -7,20 +7,18 @@ system my_observer;
in/out last_event Observable_Event;
referenced;
signal foo;
signal pre_in_orchestrator_pulse (t_int) renames input pulse to orchestrator;
/* CIF ENDTEXT */
channel c
from env to my_observer with foo,
observe;
from env to my_observer with observe;
endchannel;
block my_observer;
signalroute r
from env to my_observer with foo,
observe;
from env to my_observer with observe;
connect c and r;
/* CIF PROCESS (250, 87), (150, 75) */
process my_observer;
/* CIF TEXT (0, 57), (256, 152) */
/* CIF TEXT (46, 57), (256, 184) */
monitor st System_State;
monitor event Observable_Event;
......@@ -30,24 +28,26 @@ observe;
dcl actual_val T_UInt32
renames st.another_function.param1;
dcl p1 T_Int;
/* CIF ENDTEXT */
/* CIF procedure (1390, 63), (70, 35) */
/* CIF procedure (1794, 152), (70, 35) */
procedure observe;
/* CIF TEXT (120, 48), (313, 120) */
/* CIF TEXT (132, 48), (313, 120) */
-- this procedure could be generated automatically,
-- and be read-only.
fpar in/out model System_State,
in/out last_event Observable_Event;
/* CIF ENDTEXT */
/* CIF START (444, 153), (70, 35) */
/* CIF START (456, 153), (70, 35) */
START;
/* CIF task (410, 208), (137, 40) */
/* CIF task (422, 208), (137, 40) */
task st := model,
Event := Last_Event;
/* CIF PROCEDURECALL (325, 268), (308, 35) */
/* CIF PROCEDURECALL (337, 268), (308, 35) */
call writeln('[observer] Event: ', present(event));
/* CIF decision (422, 323), (113, 50) */
/* CIF decision (434, 323), (113, 50) */
decision present(event);
/* CIF ANSWER (97, 393), (93, 24) */
(input_event):
......@@ -70,120 +70,114 @@ Event := Last_Event;
/* CIF PROCEDURECALL (780, 437), (169, 35) */
call writeln('no_event');
enddecision;
/* CIF return (461, 543), (35, 35) */
/* CIF return (473, 543), (35, 35) */
return ;
endprocedure;
/* CIF START (333, 88), (70, 35) */
/* CIF START (440, 86), (70, 35) */
START;
/* CIF PROCEDURECALL (288, 143), (159, 35) */
/* CIF PROCEDURECALL (395, 141), (159, 35) */
call writeln ('observer init');
/* CIF NEXTSTATE (326, 193), (83, 35) */
/* CIF NEXTSTATE (433, 191), (83, 35) */
NEXTSTATE first_state;
/* CIF state (586, 370), (88, 35) */
state third_state;
/* CIF provided (548, 425), (173, 72) */
provided output paramesstogui
from orchestrator;
/* CIF PROCEDURECALL (455, 517), (359, 35) */
call writeln('[observer] detected output paramesstogui');
/* CIF NEXTSTATE (585, 567), (97, 40) */
NEXTSTATE fourth_state;
endstate;
/* CIF state (1149, 111), (101, 35) */
/* CIF state (299, 430), (101, 34) */
state second_state;
/* CIF provided (1085, 166), (241, 35) */
/* CIF provided (230, 485), (239, 45) */
provided st.orchestrator.magic_number = 42;
/* CIF PROCEDURECALL (1026, 221), (359, 35) */
call writeln ('[observer] step 2 passed (magic_number =42)');
/* CIF NEXTSTATE (1155, 271), (101, 35) */
/* CIF NEXTSTATE (299, 550), (101, 35) */
NEXTSTATE third_state;
endstate;
/* CIF state (49, 262), (95, 35) */
state end_success;
endstate;
/* CIF state (683, 128), (92, 35) */
state Wait_Count;
/* CIF provided (686, 183), (85, 35) */
/* CIF state (299, 320), (101, 35) */
state Wait_count;
/* CIF provided (307, 375), (85, 35) */
provided count = 3
/* CIF comment (793, 179), (104, 40) */
/* CIF comment (416, 372), (104, 40) */
comment 'Called AFTER
the input';
/* CIF PROCEDURECALL (578, 238), (300, 35) */
call writeln ('[observer] step 1 passed (counter=3)');
/* CIF NEXTSTATE (677, 293), (101, 35) */
/* CIF NEXTSTATE (299, 430), (101, 34) */
NEXTSTATE second_state;
endstate;
/* CIF state (242, 503), (92, 35) */
/* CIF state (433, 191), (83, 35) */
state first_state;
/* CIF provided (280, 246), (139, 54) */
provided input pulse
to orchestrator
/* CIF comment (446, 253), (111, 40) */
comment 'Called BEFORE
the input';
/* CIF NEXTSTATE (299, 320), (101, 35) */
NEXTSTATE Wait_count;
/* CIF input (568, 246), (70, 35) */
input d;
endstate;
/* CIF state (844, 237), (97, 40) */
state fourth_state;
/* CIF provided (795, 297), (193, 79) */
provided output do_something(p)
from orchestrator
to another_function
/* CIF comment (1011, 308), (146, 56) */
comment 'intercept the output
and modify the value
of the parameter';
/* CIF decision (856, 396), (70, 50) */
decision p = 42;
/* CIF ANSWER (791, 466), (70, 24) */
(true):
/* CIF task (791, 510), (70, 35) */
task p := 99;
/* CIF NEXTSTATE (783, 565), (85, 35) */
NEXTSTATE fifth_state;
/* CIF ANSWER (891, 466), (70, 24) */
(false):
/* CIF NEXTSTATE (880, 510), (92, 35) */
NEXTSTATE unexpected;
enddecision;
endstate;
/* CIF state (845, 90), (88, 35) */
state third_state;
/* CIF provided (806, 145), (173, 72) */
provided output paramesstogui
from orchestrator;
/* CIF NEXTSTATE (844, 237), (97, 40) */
NEXTSTATE fourth_state;
endstate;
/* CIF state (0, 262), (95, 35) */
state end_success;
endstate;
/* CIF state (3, 314), (92, 35) */
state unexpected;
endstate;
/* CIF state (1320, 358), (85, 35) */
/* CIF state (1279, 437), (87, 35) */
state sixth_state;
/* CIF provided (1263, 492), (121, 50) */
provided actual_val = 100;
/* CIF NEXTSTATE (1276, 562), (95, 35) */
NEXTSTATE end_success;
endstate;
/* CIF state (1297, 88), (145, 57) */
state fifth_state;
/* CIF provided (1278, 413), (168, 40) */
/* CIF provided (1277, 165), (184, 68) */
provided input do_something(val)
to another_function
/* CIF comment (1468, 397), (134, 72) */
/* CIF comment (1484, 163), (134, 72) */
comment 'intercept the input
before execution
(=post-output)
alter it again';
/* CIF decision (1328, 473), (70, 50) */
/* CIF decision (1319, 253), (99, 68) */
decision val = 99;
/* CIF ANSWER (1284, 543), (62, 24) */
/* CIF ANSWER (1292, 343), (62, 24) */
(true):
/* CIF task (1268, 587), (93, 35) */
/* CIF task (1276, 387), (93, 35) */
task val := val + 1;
/* CIF NEXTSTATE (1271, 637), (87, 35) */
/* CIF NEXTSTATE (1279, 437), (87, 35) */
NEXTSTATE sixth_state;
/* CIF ANSWER (1376, 543), (70, 24) */
(false):
/* CIF NEXTSTATE (1364, 587), (92, 35) */
NEXTSTATE unexpected;
enddecision;
endstate;
/* CIF state (1674, 356), (87, 35) */
state sixth_state;
/* CIF provided (1659, 411), (124, 35) */
provided actual_val = 100;
/* CIF NEXTSTATE (1673, 466), (95, 35) */
NEXTSTATE end_success;
endstate;
/* CIF state (953, 357), (97, 35) */
state fourth_state;
/* CIF provided (917, 412), (176, 56) */
provided output do_something(p)
from orchestrator
to another_function
/* CIF comment (1112, 421), (146, 56) */
comment 'intercept the output
and modify the value
of the parameter';
/* CIF PROCEDURECALL (825, 488), (359, 35) */
call writeln('[observer] detected output do_something');
/* CIF decision (970, 538), (70, 50) */
decision p = 42;
/* CIF ANSWER (925, 608), (70, 24) */
(true):
/* CIF task (925, 652), (70, 35) */
task p := 99;
/* CIF NEXTSTATE (917, 707), (85, 35) */
NEXTSTATE fifth_state;
/* CIF ANSWER (1025, 608), (70, 24) */
/* CIF ANSWER (1408, 343), (70, 24) */
(false):
/* CIF NEXTSTATE (1013, 652), (92, 35) */
/* CIF NEXTSTATE (1397, 387), (92, 35) */
NEXTSTATE unexpected;
enddecision;
endstate;
/* CIF state (326, 193), (83, 35) */
state first_state;
/* CIF provided (305, 249), (113, 40) */
provided input pulse
to orchestrator
/* CIF comment (445, 249), (111, 40) */
comment 'Called BEFORE
the input';
/* CIF NEXTSTATE (312, 309), (101, 35) */
NEXTSTATE Wait_count;
endstate;
endprocess my_observer;
endblock;
endsystem;
\ No newline at end of file
......@@ -27,6 +27,7 @@ PUBLIC
WITH interfaceview::IV::HELLO_WORLD;
WITH interfaceview::IV::SdlFunction;
WITH interfaceview::IV::Function1;
WITH ocarina_processors_arm;
WITH deploymentview::DV::Node1;
WITH Taste;
......@@ -44,16 +45,20 @@ SUBCOMPONENTS
IV_SdlFunction : SYSTEM interfaceview::IV::SdlFunction::SdlFunction.others {
Taste::FunctionName => "SdlFunction";
};
IV_Function1 : SYSTEM interfaceview::IV::Function1::Function1.others {
Taste::FunctionName => "Function1";
};
rpi_partition : PROCESS deploymentview::DV::Node1::rpi_partition.others {
Taste::coordinates => "97518 93988 142671 127004";
Taste::coordinates => "90791 74134 135944 107150";
Deployment::Port_Number => 0;
};
rpi_posix : PROCESSOR ocarina_processors_arm::rpi.posix {
Taste::coordinates => "91874 84555 148315 131721";
Taste::coordinates => "85147 64701 141588 111867";
};
PROPERTIES
Taste::APLC_Binding => (reference (rpi_partition)) APPLIES TO IV_HELLO_WORLD;
Taste::APLC_Binding => (reference (rpi_partition)) APPLIES TO IV_SdlFunction;
Taste::APLC_Binding => (reference (rpi_partition)) APPLIES TO IV_Function1;
Actual_Processor_Binding => (reference (rpi_posix)) APPLIES TO rpi_partition;
END Node1.others;
......@@ -63,7 +68,7 @@ END deploymentview;
SYSTEM IMPLEMENTATION deploymentview.others
SUBCOMPONENTS
Node1 : SYSTEM Node1.others {
Taste::coordinates => "84819 71079 155370 138459";
Taste::coordinates => "78092 51225 148643 118605";
};
interfaceview : SYSTEM interfaceview::IV::interfaceview.others;
END deploymentview.others;
......@@ -72,6 +77,6 @@ PROPERTIES
Taste::coordinates => "0 0 297000 210000";
Taste::version => "2.4";
Taste::interfaceView => "InterfaceView.aadl";
Taste::HWLibraries => ("../../../tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
Taste::HWLibraries => ("../../../../tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
END deploymentview::DV;
......@@ -60,6 +60,8 @@ WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_doSomething
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_doSomething;
SUBPROGRAM IMPLEMENTATION PI_doSomething.others
......@@ -72,6 +74,8 @@ FEATURES
PI_doSomething : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::SdlFunction::PI_doSomething.others {
Taste::coordinates => "166726 84097";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 0 ms;
Taste::Deadline => 0 ms;
Taste::InterfaceName => "doSomething";
};
PROPERTIES
......@@ -84,11 +88,44 @@ END SdlFunction.others;
END interfaceview::IV::SdlFunction;
PACKAGE interfaceview::IV::Function1
PUBLIC
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;
SYSTEM Function1
FEATURES
PI_pulse : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Function1::PI_pulse.others {
Taste::coordinates => "157569 49878";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 1000 ms;
Taste::InterfaceName => "pulse";
};
PROPERTIES
Source_Language => (CPP);
Taste::Active_Interfaces => any;
END Function1;
SYSTEM IMPLEMENTATION Function1.others
END Function1.others;
END interfaceview::IV::Function1;
PACKAGE interfaceview::IV
PUBLIC
WITH interfaceview::IV::HELLO_WORLD;
WITH interfaceview::IV::SdlFunction;
WITH interfaceview::IV::Function1;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
......@@ -106,6 +143,9 @@ SUBCOMPONENTS
SdlFunction : SYSTEM interfaceview::IV::SdlFunction::SdlFunction.others {
Taste::coordinates => "166726 79793 194177 106706";
};
Function1 : SYSTEM interfaceview::IV::Function1::Function1.others {
Taste::coordinates => "157569 40286 188960 64876";
};
CONNECTIONS
HELLO_WORLD_RI_doSomething_SdlFunction_PI_doSomething : SUBPROGRAM ACCESS SdlFunction.PI_doSomething -> HELLO_WORLD.RI_doSomething {
Taste::coordinates => "140435 82271 159232 82271 159232 84097 166726 84097";
......
// Body file for function Function1
// Generated by TASTE on 2021-04-26 12:27:34
// You can edit this file, it will not be overwritten
// Provided interfaces : pulse
// Required interfaces :
// User-defined properties for this function:
// |_ Taste::Active_Interfaces = any
// |_ Taste::coordinates = 157569 40286 188960 64876
// Timers :
#include "function1.h"
#include "function1_state.h"
//#include <iostream>
// Define and use function state inside this context structure
// avoid defining global/static variable elsewhere
function1_state ctxt_function1;
void function1_startup(void)
{
// Write your initialisation code, but DO NOT CALL REQUIRED INTERFACES
// std::cout << "[Function1] Startup" << std::endl;
}
void function1_PI_pulse(void)
{
// Write your code here
}