Commit c0c8ecd9 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add state composition to test-simu

parent ec98902b
...@@ -2,6 +2,27 @@ ...@@ -2,6 +2,27 @@
PROCESS orchestrator PROCESS orchestrator
/* CIF COMMENT (407, 195), (78, 35) */ /* CIF COMMENT (407, 195), (78, 35) */
COMMENT 'Hello'; COMMENT 'Hello';
STATE wait;
SUBSTRUCTURE
/* CIF START (116, 38), (70, 35) */
START;
/* CIF NEXTSTATE (88, 88), (124, 35) */
NEXTSTATE entering_wait;
/* CIF STATE (83, 193), (134, 35) */
STATE waiting_in_wait;
/* CIF INPUT (114, 248), (73, 35) */
INPUT other;
/* CIF NEXTSTATE (83, 298), (134, 35) */
NEXTSTATE entering_wait;
ENDSTATE;
/* CIF STATE (88, 88), (124, 35) */
STATE entering_wait;
/* CIF INPUT (114, 143), (73, 35) */
INPUT other;
/* CIF NEXTSTATE (83, 193), (134, 35) */
NEXTSTATE waiting_in_wait;
ENDSTATE;
ENDSUBSTRUCTURE;
/* CIF TEXT (0, 138), (448, 448) */ /* CIF TEXT (0, 138), (448, 448) */
dcl seq tastE_Peek_id_list := { 1,2,3,4,5}; dcl seq tastE_Peek_id_list := { 1,2,3,4,5};
...@@ -34,7 +55,7 @@ external comment '#vdm #classname=RemoteCall'; ...@@ -34,7 +55,7 @@ external comment '#vdm #classname=RemoteCall';
STATE next; STATE next;
/* CIF INPUT (1643, 400), (122, 35) */ /* CIF INPUT (1643, 400), (122, 35) */
INPUT pulse(a); INPUT pulse(a);
/* CIF PROCEDURECALL (1598, 450), (213, 35) */ /* CIF PROCEDURECALL (1597, 450), (213, 35) */
CALL reset_timer(mytimer); CALL reset_timer(mytimer);
/* CIF NEXTSTATE (1669, 500), (70, 35) */ /* CIF NEXTSTATE (1669, 500), (70, 35) */
NEXTSTATE wait; NEXTSTATE wait;
...@@ -45,65 +66,65 @@ external comment '#vdm #classname=RemoteCall'; ...@@ -45,65 +66,65 @@ external comment '#vdm #classname=RemoteCall';
INPUT Paramless_TC; INPUT Paramless_TC;
/* CIF PROCEDURECALL (1598, 230), (249, 35) */ /* CIF PROCEDURECALL (1598, 230), (249, 35) */
CALL SET_timer(1000, mytimer); CALL SET_timer(1000, mytimer);
/* CIF NEXTSTATE (1686, 280), (74, 35) */ /* CIF NEXTSTATE (1685, 280), (74, 35) */
NEXTSTATE next; NEXTSTATE next;
ENDSTATE; ENDSTATE;
/* CIF STATE (1085, 201), (72, 34) */ /* CIF STATE (1085, 201), (72, 34) */
STATE Wait; STATE Wait;
/* CIF INPUT (807, 255), (101, 35) */ /* CIF INPUT (797, 255), (101, 35) */
INPUT pulse(a); INPUT pulse(a);
/* CIF TASK (772, 305), (170, 48) */ /* CIF TASK (762, 305), (170, 48) */
TASK seq := {0,1,0,1,0}, TASK seq := {0,1,0,1,0},
anint := 478; anint := 478;
/* CIF PROCEDURECALL (728, 368), (259, 35) */ /* CIF PROCEDURECALL (718, 368), (259, 35) */
CALL writeln('Input param', anint); CALL writeln('Input param', anint);
/* CIF PROCEDURECALL (738, 418), (238, 35) */ /* CIF PROCEDURECALL (728, 418), (238, 35) */
CALL ExternalProc(anint, anint); CALL ExternalProc(anint, anint);
/* CIF PROCEDURECALL (720, 468), (275, 35) */ /* CIF PROCEDURECALL (710, 468), (275, 35) */
CALL writeln('Output param', anint); CALL writeln('Output param', anint);
/* CIF PROCEDURECALL (714, 518), (286, 35) */ /* CIF PROCEDURECALL (704, 518), (286, 35) */
CALL write('Calling VDM with data'); CALL write('Calling VDM with data');
/* CIF TASK (664, 568), (386, 48) */ /* CIF TASK (654, 568), (386, 48) */
TASK for each in fixed: call write(each, ' '); endfor; TASK for each in fixed: call write(each, ' '); endfor;
/* CIF PROCEDURECALL (772, 631), (170, 40) */ /* CIF PROCEDURECALL (762, 631), (170, 40) */
CALL writeln(''); CALL writeln('');
/* CIF PROCEDURECALL (771, 686), (172, 35) */ /* CIF PROCEDURECALL (761, 686), (172, 35) */
CALL vdm(fixed, fixed); CALL vdm(fixed, fixed);
/* CIF PROCEDURECALL (772, 736), (170, 40) */ /* CIF PROCEDURECALL (762, 736), (170, 40) */
CALL write('Result:'); CALL write('Result:');
/* CIF TASK (666, 791), (383, 35) */ /* CIF TASK (656, 791), (383, 35) */
TASK for each in fixed: call write(each, ' '); endfor; TASK for each in fixed: call write(each, ' '); endfor;
/* CIF PROCEDURECALL (799, 841), (116, 40) */ /* CIF PROCEDURECALL (789, 841), (116, 40) */
CALL writeln(''); CALL writeln('');
/* CIF PROCEDURECALL (667, 896), (381, 35) */ /* CIF PROCEDURECALL (657, 896), (381, 35) */
CALL writeln('Calling VDM2 with value', fixed(0)); CALL writeln('Calling VDM2 with value', fixed(0));
/* CIF PROCEDURECALL (736, 946), (242, 35) */ /* CIF PROCEDURECALL (726, 946), (242, 35) */
CALL vdm2(fixed(0), simpleseq); CALL vdm2(fixed(0), simpleseq);
/* CIF PROCEDURECALL (602, 996), (511, 40) */ /* CIF PROCEDURECALL (592, 996), (511, 40) */
CALL writeln('Result:', simpleseq!a, ' ', simpleseq!b, ' ', simpleseq!c); CALL writeln('Result:', simpleseq!a, ' ', simpleseq!b, ' ', simpleseq!c);
/* CIF OUTPUT (788, 1051), (138, 35) */ /* CIF OUTPUT (778, 1051), (138, 35) */
OUTPUT telemetry(a); OUTPUT telemetry(a);
/* CIF OUTPUT (784, 1101), (147, 35) */ /* CIF OUTPUT (774, 1101), (147, 35) */
OUTPUT peek_list(seq); OUTPUT peek_list(seq);
/* CIF OUTPUT (769, 1151), (177, 35) */ /* CIF OUTPUT (759, 1151), (177, 35) */
OUTPUT peek_fixed(fixed); OUTPUT peek_fixed(fixed);
/* CIF NEXTSTATE (820, 1201), (74, 35) */ /* CIF NEXTSTATE (810, 1201), (74, 35) */
NEXTSTATE next; NEXTSTATE next;
/* CIF INPUT (1219, 255), (147, 35) */ /* CIF INPUT (1209, 255), (147, 35) */
INPUT Paramless_TC; INPUT Paramless_TC;
/* CIF PROCEDURECALL (1166, 305), (253, 35) */ /* CIF PROCEDURECALL (1156, 305), (253, 35) */
CALL writeln('Got Paramless TC'); CALL writeln('Got Paramless TC');
/* CIF PROCEDURECALL (1168, 355), (249, 35) */ /* CIF PROCEDURECALL (1158, 355), (249, 35) */
CALL SET_timer(1000, mytimer); CALL SET_timer(1000, mytimer);
/* CIF OUTPUT (1217, 405), (150, 35) */ /* CIF OUTPUT (1207, 405), (150, 35) */
OUTPUT Paramless_TM; OUTPUT Paramless_TM;
/* CIF TASK (1191, 455), (202, 35) */ /* CIF TASK (1181, 455), (202, 35) */
TASK anint := (anint + 1) mod 100; TASK anint := (anint + 1) mod 100;
/* CIF NEXTSTATE (1257, 505), (70, 35) */ /* CIF NEXTSTATE (1247, 505), (70, 35) */
NEXTSTATE wait; NEXTSTATE wait;
/* CIF INPUT (1429, 255), (104, 35) */ /* CIF INPUT (1419, 255), (104, 35) */
INPUT mytimer; INPUT mytimer;
/* CIF NEXTSTATE (1430, 305), (102, 35) */ /* CIF NEXTSTATE (1420, 305), (102, 35) */
NEXTSTATE Timeout; NEXTSTATE Timeout;
ENDSTATE; ENDSTATE;
ENDPROCESS orchestrator; ENDPROCESS orchestrator;
\ No newline at end of file
...@@ -9,6 +9,7 @@ SYSTEM orchestrator; ...@@ -9,6 +9,7 @@ SYSTEM orchestrator;
SIGNAL peek_fixed(fixedintlist); SIGNAL peek_fixed(fixedintlist);
SIGNAL Paramless_TC; SIGNAL Paramless_TC;
SIGNAL Paramless_TM; SIGNAL Paramless_TM;
signal other;
PROCEDURE ExternalProc; PROCEDURE ExternalProc;
FPAR FPAR
...@@ -17,14 +18,14 @@ SYSTEM orchestrator; ...@@ -17,14 +18,14 @@ SYSTEM orchestrator;
EXTERNAL; EXTERNAL;
CHANNEL c CHANNEL c
FROM ENV TO orchestrator WITH pulse, Paramless_TC; FROM ENV TO orchestrator WITH pulse, Paramless_TC, other;
FROM orchestrator TO ENV WITH telemetry, peek_list, peek_fixed, Paramless_TM; FROM orchestrator TO ENV WITH telemetry, peek_list, peek_fixed, Paramless_TM;
ENDCHANNEL; ENDCHANNEL;
BLOCK orchestrator; BLOCK orchestrator;
SIGNALROUTE r SIGNALROUTE r
FROM ENV TO orchestrator WITH pulse, Paramless_TC; FROM ENV TO orchestrator WITH pulse, Paramless_TC, other;
FROM orchestrator TO ENV WITH telemetry, peek_list, peek_fixed, Paramless_TM; FROM orchestrator TO ENV WITH telemetry, peek_list, peek_fixed, Paramless_TM;
CONNECT c and r; CONNECT c and r;
......
Supports Markdown
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