Commits (11)
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
@@ELSE@@ @@ELSE@@
@@IF@@ @_Block_Is_Shared_Type_@ @@IF@@ @_Block_Is_Shared_Type_@
@@-- instance of a shared type stored in a shared folder @@-- instance of a shared type stored in a shared folder
${wildcard @_Shared_Lib_Dir_@/@_LOWER:Block_Names_@/SDL/code/@_LOWER:Block_Instance_Of_@_datamodel.asn} ${wildcard ../@_LOWER:Block_Names_@/SDL/code/@_LOWER:Block_Instance_Of_@_datamodel.asn}
@@-- context parameters of the function type must be added too @@-- context parameters of the function type must be added too
${wildcard @_Shared_Lib_Dir_@/@_LOWER:Block_Instance_Of_@/SDL/Context*.asn} ${wildcard @_Shared_Lib_Dir_@/@_LOWER:Block_Instance_Of_@/@_LOWER:Block_Instance_Of_@/SDL/Context*.asn}
@@ELSE@@ @@ELSE@@
${wildcard ../@_LOWER:Block_Names_@/SDL/code/@_LOWER:Block_Instance_Of_@_datamodel.asn} ${wildcard ../@_LOWER:Block_Names_@/SDL/code/@_LOWER:Block_Instance_Of_@_datamodel.asn}
@@-- context parameters of the function type must be added too @@-- context parameters of the function type must be added too
......
...@@ -143,7 +143,6 @@ project @_CAPITALIZE:Name_@ is ...@@ -143,7 +143,6 @@ project @_CAPITALIZE:Name_@ is
"-ffunction-sections", "-ffunction-sections",
"-fdiagnostics-color=always", "-fdiagnostics-color=always",
"-Wno-cast-function-type", "-Wno-cast-function-type",
"-Wmissing-prototypes",
@@IF@@ @_Coverage_@ @@IF@@ @_Coverage_@
"-fprofile-arcs", "-fprofile-arcs",
"-ftest-coverage", "-ftest-coverage",
...@@ -164,7 +163,7 @@ project @_CAPITALIZE:Name_@ is ...@@ -164,7 +163,7 @@ project @_CAPITALIZE:Name_@ is
case Build is case Build is
when "Release" => when "Release" =>
for Default_Switches ("C") use Common_C_Switches & ("-O2", "-DNDEBUG"); for Default_Switches ("C") use Common_C_Switches & ("-O2", "-DNDEBUG" ,"-Wmissing-prototypes");
for Default_Switches ("C++") use Common_C_Switches & ("-O2", "-DNDEBUG"); for Default_Switches ("C++") use Common_C_Switches & ("-O2", "-DNDEBUG");
for Default_Switches ("Ada") use Common_Ada_Switches & ("-O2", "-DNDEBUG"); for Default_Switches ("Ada") use Common_Ada_Switches & ("-O2", "-DNDEBUG");
when "Debug" => when "Debug" =>
...@@ -185,6 +184,7 @@ project @_CAPITALIZE:Name_@ is ...@@ -185,6 +184,7 @@ project @_CAPITALIZE:Name_@ is
"-lm", "-lm",
@@IF@@ @_CPU_Platform_@ = PLATFORM_RPI @@IF@@ @_CPU_Platform_@ = PLATFORM_RPI
"-lgnat", "-lgnat",
"-lstdc++",
@@END_IF@@ @@END_IF@@
@@IF@@ @_Coverage_@ @@IF@@ @_Coverage_@
"-fprofile-arcs", "-fprofile-arcs",
......
...@@ -116,8 +116,8 @@ configuration project Raspberry_PI is ...@@ -116,8 +116,8 @@ configuration project Raspberry_PI is
for Export_File_Switch use "-Wl,--version-script="; for Export_File_Switch use "-Wl,--version-script=";
for Map_File_Option use "-Wl,-Map,"; for Map_File_Option use "-Wl,-Map,";
for Default_Switches ("C") use Common_C_Linker_Switches; for Default_Switches ("C") use Common_C_Linker_Switches;
for Default_Switches ("C++") use Common_C_Linker_Switches; for Default_Switches ("C++") use Common_C_Linker_Switches & ("-lstdc++");
for Default_Switches ("Ada") use ("-pipe", "-g", "-lm"); for Default_Switches ("Ada") use ("-pipe", "-g", "-lm", "-lgnat");
end Linker; end Linker;
package Clean is package Clean is
......
...@@ -54,10 +54,14 @@ void init_@_LOWER:Name_@(void) ...@@ -54,10 +54,14 @@ void init_@_LOWER:Name_@(void)
{ {
if (0 == @_LOWER:Name_@_initialized) { if (0 == @_LOWER:Name_@_initialized) {
@_LOWER:Name_@_initialized = 1; @_LOWER:Name_@_initialized = 1;
@@IF@@ @_Language_@ /= "Ada" and @_Language_@ /= "QGenAda" and @_Language_@ /= "QGenC" and @_Language_@ /= "SDL" @@IF@@ @_Language_@ /= "Ada" and @_Language_@ /= "SDL" and @_Language_@ /= "QGenAda"
// Call user code startup function // Call user code startup function
@@IF@@ @_Language_@ = "QGenC"
@_LOWER:Name_@_PI_@_List_Of_PIs_@_startup();
@@ELSE@@
extern void @_LOWER:Name_@_startup(void); extern void @_LOWER:Name_@_startup(void);
@_LOWER:Name_@_startup(); @_LOWER:Name_@_startup();
@@END_IF@@
@@ELSIF@@ @_Language_@ = Ada or @_Language_@ = SDL @@ELSIF@@ @_Language_@ = Ada or @_Language_@ = SDL
@@IF@@ @_SDL_Target_Language_@ = "Ada" @@IF@@ @_SDL_Target_Language_@ = "Ada"
// Initialize Ada runtime to call elaboration functions // Initialize Ada runtime to call elaboration functions
......
...@@ -19,7 +19,7 @@ DATAVIEW_ACN := ...@@ -19,7 +19,7 @@ DATAVIEW_ACN :=
@@END_IF@@ @@END_IF@@
DATAVIEW_AADLV1 := ${DATAVIEW_PATH}/dataview_aadlv1.aadl DATAVIEW_AADLV1 := ${DATAVIEW_PATH}/dataview_aadlv1.aadl
DATAVIEW_AADLV2 := ${DATAVIEW_PATH}/dataview_aadlv2.aadl DATAVIEW_AADLV2 := ${DATAVIEW_PATH}/dataview_aadlv2.aadl
TASTE_SHARED_TYPES?=${TOOL-INST}/share/SharedTypes TASTE_SHARED_TYPES?=${TOOL_INST}/share/SharedTypes
# Project cache folder is used to speed up all ASN.1-related processing # Project cache folder is used to speed up all ASN.1-related processing
export PROJECT_CACHE=${HOME}/.taste_AST_cache export PROJECT_CACHE=${HOME}/.taste_AST_cache
...@@ -68,7 +68,7 @@ dataview: dataview/C/built ...@@ -68,7 +68,7 @@ dataview: dataview/C/built
@@-- Function is an instance of a type @@-- Function is an instance of a type
@@IF@@ @_Is_Shared_Type_@ @@IF@@ @_Is_Shared_Type_@
@@-- function type is stored in the shared library folder @@-- function type is stored in the shared library folder
sed -e '$$s/$$/\n/' -s ${DATAVIEW_UNIQ} @_LOWER:Function_Names_@/SDL/Context-@_LOWER:REPLACE_ALL(_/-):Function_Names_@.asn ${TASTE_SHARED_TYPES}/@_LOWER:Instance_Of_@/SDL/Context*.asn > @_LOWER:Function_Names_@/SDL/src/dataview-uniq.asn sed -e '$$s/$$/\n/' -s ${DATAVIEW_UNIQ} @_LOWER:Function_Names_@/SDL/Context-@_LOWER:REPLACE_ALL(_/-):Function_Names_@.asn ${TASTE_SHARED_TYPES}/@_LOWER:Instance_Of_@/@_LOWER:Instance_Of_@/SDL/Context*.asn > @_LOWER:Function_Names_@/SDL/src/dataview-uniq.asn
@@ELSE@@ @@ELSE@@
sed -e '$$s/$$/\n/' -s ${DATAVIEW_UNIQ} @_LOWER:Function_Names_@/SDL/Context-@_LOWER:REPLACE_ALL(_/-):Function_Names_@.asn @_LOWER:Instance_Of_@/SDL/Context*.asn > @_LOWER:Function_Names_@/SDL/src/dataview-uniq.asn sed -e '$$s/$$/\n/' -s ${DATAVIEW_UNIQ} @_LOWER:Function_Names_@/SDL/Context-@_LOWER:REPLACE_ALL(_/-):Function_Names_@.asn @_LOWER:Instance_Of_@/SDL/Context*.asn > @_LOWER:Function_Names_@/SDL/src/dataview-uniq.asn
@@END_IF@@ @@END_IF@@
......
system my_observer; system my_observer;
/* CIF TEXT (145, 177), (483, 168) */ /* CIF TEXT (145, 177), (507, 168) */
use datamodel comment 'observer.asn'; use datamodel comment 'observer.asn';
exported procedure observe; exported procedure observe;
...@@ -8,17 +8,23 @@ system my_observer; ...@@ -8,17 +8,23 @@ system my_observer;
referenced; referenced;
signal pre_in_orchestrator_pulse (t_int) renames input pulse to orchestrator; signal pre_in_orchestrator_pulse (t_int) renames input pulse to orchestrator;
signal foo renames input pulse to orchestrator;
/* CIF ENDTEXT */ /* CIF ENDTEXT */
channel c channel c
from env to my_observer with observe; from env to my_observer with observe,
pre_in_orchestrator_pulse,
foo;
endchannel; endchannel;
block my_observer; block my_observer;
signalroute r signalroute r
from env to my_observer with observe; from env to my_observer with observe,
pre_in_orchestrator_pulse,
foo;
connect c and r; connect c and r;
/* CIF PROCESS (250, 87), (150, 75) */ /* CIF PROCESS (250, 87), (150, 75) */
process my_observer; process my_observer;
/* CIF TEXT (46, 57), (256, 184) */ /* CIF TEXT (0, 57), (256, 184) */
monitor st System_State; monitor st System_State;
monitor event Observable_Event; monitor event Observable_Event;
...@@ -31,23 +37,23 @@ system my_observer; ...@@ -31,23 +37,23 @@ system my_observer;
dcl p1 T_Int; dcl p1 T_Int;
/* CIF ENDTEXT */ /* CIF ENDTEXT */
/* CIF procedure (1794, 152), (70, 35) */ /* CIF procedure (2060, 152), (70, 35) */
procedure observe; procedure observe;
/* CIF TEXT (132, 48), (313, 120) */ /* CIF TEXT (140, 48), (313, 120) */
-- this procedure could be generated automatically, -- this procedure could be generated automatically,
-- and be read-only. -- and be read-only.
fpar in/out model System_State, fpar in/out model System_State,
in/out last_event Observable_Event; in/out last_event Observable_Event;
/* CIF ENDTEXT */ /* CIF ENDTEXT */
/* CIF START (456, 153), (70, 35) */ /* CIF START (464, 153), (70, 35) */
START; START;
/* CIF task (422, 208), (137, 40) */ /* CIF task (430, 208), (137, 40) */
task st := model, task st := model,
Event := Last_Event; Event := Last_Event;
/* CIF PROCEDURECALL (337, 268), (308, 35) */ /* CIF PROCEDURECALL (345, 268), (308, 35) */
call writeln('[observer] Event: ', present(event)); call writeln('[observer] Event: ', present(event));
/* CIF decision (434, 323), (113, 50) */ /* CIF decision (442, 323), (113, 50) */
decision present(event); decision present(event);
/* CIF ANSWER (97, 393), (93, 24) */ /* CIF ANSWER (97, 393), (93, 24) */
(input_event): (input_event):
...@@ -70,111 +76,124 @@ Event := Last_Event; ...@@ -70,111 +76,124 @@ Event := Last_Event;
/* CIF PROCEDURECALL (780, 437), (169, 35) */ /* CIF PROCEDURECALL (780, 437), (169, 35) */
call writeln('no_event'); call writeln('no_event');
enddecision; enddecision;
/* CIF return (473, 543), (35, 35) */ /* CIF return (481, 543), (35, 35) */
return ; return ;
endprocedure; endprocedure;
/* CIF START (440, 86), (70, 35) */ /* CIF START (683, 86), (70, 35) */
START; START;
/* CIF PROCEDURECALL (395, 141), (159, 35) */ /* CIF PROCEDURECALL (638, 141), (159, 35) */
call writeln ('observer init'); call writeln ('observer init');
/* CIF NEXTSTATE (433, 191), (83, 35) */ /* CIF NEXTSTATE (676, 191), (83, 35) */
NEXTSTATE first_state; NEXTSTATE first_state;
/* CIF state (299, 430), (101, 34) */ /* CIF state (662, 434), (101, 34) */
state second_state; state second_state;
/* CIF provided (230, 485), (239, 45) */ /* CIF provided (594, 489), (239, 45) */
provided st.orchestrator.magic_number = 42; provided st.orchestrator.magic_number = 42;
/* CIF NEXTSTATE (299, 550), (101, 35) */ /* CIF NEXTSTATE (663, 554), (101, 35) */
NEXTSTATE third_state; NEXTSTATE third_state;
endstate; endstate;
/* CIF state (299, 320), (101, 35) */ /* CIF state (663, 324), (101, 35) */
state Wait_count; state Wait_count;
/* CIF provided (307, 375), (85, 35) */ /* CIF provided (671, 379), (85, 35) */
provided count = 3 provided count = 3
/* CIF comment (416, 372), (104, 40) */ /* CIF comment (780, 376), (104, 40) */
comment 'Called AFTER comment 'Called AFTER
the input'; the input';
/* CIF NEXTSTATE (299, 430), (101, 34) */ /* CIF NEXTSTATE (662, 434), (101, 34) */
NEXTSTATE second_state; NEXTSTATE second_state;
endstate; endstate;
/* CIF state (433, 191), (83, 35) */ /* CIF state (676, 191), (83, 35) */
state first_state; state first_state;
/* CIF provided (280, 246), (139, 54) */ /* CIF provided (644, 248), (139, 56) */
provided input pulse provided input pulse
to orchestrator to orchestrator
/* CIF comment (446, 253), (111, 40) */ /* CIF comment (810, 256), (111, 40) */
comment 'Called BEFORE comment 'Called BEFORE
the input'; the input';
/* CIF NEXTSTATE (299, 320), (101, 35) */ /* CIF NEXTSTATE (663, 324), (101, 35) */
NEXTSTATE Wait_count; NEXTSTATE Wait_count;
/* CIF input (568, 246), (70, 35) */
input d;
endstate; endstate;
/* CIF state (844, 237), (97, 40) */ /* CIF state (992, 237), (97, 40) */
state fourth_state; state fourth_state;
/* CIF provided (795, 297), (193, 79) */ /* CIF provided (943, 297), (193, 79) */
provided output do_something(p) provided output do_something(p)
from orchestrator from orchestrator
to another_function to another_function
/* CIF comment (1011, 308), (146, 56) */ /* CIF comment (1159, 308), (146, 56) */
comment 'intercept the output comment 'intercept the output
and modify the value and modify the value
of the parameter'; of the parameter';
/* CIF decision (856, 396), (70, 50) */ /* CIF decision (1005, 396), (70, 50) */
decision p = 42; decision p = 42;
/* CIF ANSWER (791, 466), (70, 24) */ /* CIF ANSWER (939, 466), (70, 24) */
(true): (true):
/* CIF task (791, 510), (70, 35) */ /* CIF task (939, 510), (70, 35) */
task p := 99; task p := 99;
/* CIF NEXTSTATE (783, 565), (85, 35) */ /* CIF NEXTSTATE (932, 565), (85, 35) */
NEXTSTATE fifth_state; NEXTSTATE fifth_state;
/* CIF ANSWER (891, 466), (70, 24) */ /* CIF ANSWER (1039, 466), (70, 24) */
(false): (false):
/* CIF NEXTSTATE (880, 510), (92, 35) */ /* CIF NEXTSTATE (1028, 510), (92, 35) */
NEXTSTATE unexpected; NEXTSTATE unexpected;
enddecision; enddecision;
endstate; endstate;
/* CIF state (845, 90), (88, 35) */ /* CIF state (1286, 90), (88, 35) */
state third_state; state third_state;
/* CIF provided (806, 145), (173, 72) */ /* CIF provided (954, 145), (173, 72) */
provided output paramesstogui provided output paramesstogui
from orchestrator; from orchestrator;
/* CIF NEXTSTATE (844, 237), (97, 40) */ /* CIF NEXTSTATE (992, 237), (97, 40) */
NEXTSTATE fourth_state; NEXTSTATE fourth_state;
/* CIF input (1317, 145), (218, 49) */
input pre_in_orchestrator_pulse(toto)
/* CIF comment (1555, 152), (127, 56) */
comment 'alias for
input pulse to
orchestrator';
/* CIF decision (1391, 214), (70, 50) */
decision toto;
/* CIF ANSWER (1335, 284), (70, 24) */
(1):
/* CIF ANSWER (1425, 284), (70, 24) */
else:
enddecision;
/* CIF NEXTSTATE (1391, 324), (70, 35) */
NEXTSTATE -;
endstate; endstate;
/* CIF state (0, 262), (95, 35) */ /* CIF state (154, 262), (95, 35) */
state end_success; state end_success;
endstate; endstate;
/* CIF state (3, 314), (92, 35) */ /* CIF state (157, 314), (92, 35) */
state unexpected; state unexpected;
endstate; endstate;
/* CIF state (1279, 437), (87, 35) */ /* CIF state (1710, 437), (87, 35) */
state sixth_state; state sixth_state;
/* CIF provided (1263, 492), (121, 50) */ /* CIF provided (1694, 492), (121, 50) */
provided actual_val = 100; provided actual_val = 100;
/* CIF NEXTSTATE (1276, 562), (95, 35) */ /* CIF NEXTSTATE (1706, 562), (95, 35) */
NEXTSTATE end_success; NEXTSTATE end_success;
endstate; endstate;
/* CIF state (1297, 88), (145, 57) */ /* CIF state (1728, 88), (145, 57) */
state fifth_state; state fifth_state;
/* CIF provided (1277, 165), (184, 68) */ /* CIF provided (1708, 165), (184, 68) */
provided input do_something(val) provided input do_something(val)
to another_function to another_function
/* CIF comment (1484, 163), (134, 72) */ /* CIF comment (1915, 163), (134, 72) */
comment 'intercept the input comment 'intercept the input
before execution before execution
(=post-output) (=post-output)
alter it again'; alter it again';
/* CIF decision (1319, 253), (99, 68) */ /* CIF decision (1750, 253), (99, 68) */
decision val = 99; decision val = 99;
/* CIF ANSWER (1292, 343), (62, 24) */ /* CIF ANSWER (1723, 343), (62, 24) */
(true): (true):
/* CIF task (1276, 387), (93, 35) */ /* CIF task (1707, 387), (93, 35) */
task val := val + 1; task val := val + 1;
/* CIF NEXTSTATE (1279, 437), (87, 35) */ /* CIF NEXTSTATE (1710, 437), (87, 35) */
NEXTSTATE sixth_state; NEXTSTATE sixth_state;
/* CIF ANSWER (1408, 343), (70, 24) */ /* CIF ANSWER (1839, 343), (70, 24) */
(false): (false):
/* CIF NEXTSTATE (1397, 387), (92, 35) */ /* CIF NEXTSTATE (1827, 387), (92, 35) */
NEXTSTATE unexpected; NEXTSTATE unexpected;
enddecision; enddecision;
endstate; endstate;
......
...@@ -77,6 +77,6 @@ PROPERTIES ...@@ -77,6 +77,6 @@ PROPERTIES
Taste::coordinates => "0 0 297000 210000"; Taste::coordinates => "0 0 297000 210000";
Taste::version => "2.4"; Taste::version => "2.4";
Taste::interfaceView => "InterfaceView.aadl"; 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; END deploymentview::DV;
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "function1.h" #include "function1.h"
#include "function1_state.h" #include "function1_state.h"
//#include <iostream> #include <iostream>
// Define and use function state inside this context structure // Define and use function state inside this context structure
// avoid defining global/static variable elsewhere // avoid defining global/static variable elsewhere
...@@ -20,7 +20,7 @@ function1_state ctxt_function1; ...@@ -20,7 +20,7 @@ function1_state ctxt_function1;
void function1_startup(void) void function1_startup(void)
{ {
// Write your initialisation code, but DO NOT CALL REQUIRED INTERFACES // Write your initialisation code, but DO NOT CALL REQUIRED INTERFACES
// std::cout << "[Function1] Startup" << std::endl; std::cout << "[Function1] Startup" << std::endl;
} }
void function1_PI_pulse(void) void function1_PI_pulse(void)
......