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

Make test-simu more complex for VDM testing

parent 9b1bd15a
......@@ -12,6 +12,12 @@ MyChoice ::= CHOICE { a BOOLEAN, b ENUMERATED { aa, bb } }
MySeq ::= SEQUENCE { a BOOLEAN, b MyChoice }
MySetOf ::= SET (SIZE(1..3)) OF INTEGER (0..10)
MySeqOf ::= SEQUENCE (SIZE(1..3)) OF INTEGER (0..10)
MySimpleSeq ::= SEQUENCE { a INTEGER (0..255), b BOOLEAN, c MyEnum }
END
......
......@@ -2,7 +2,7 @@
PROCESS orchestrator
/* CIF COMMENT (407, 195), (78, 35) */
COMMENT 'Hello';
/* CIF TEXT (0, 138), (448, 328) */
/* CIF TEXT (0, 138), (448, 448) */
dcl seq tastE_Peek_id_list := { 1,2,3,4,5};
dcl a myEnum;
......@@ -11,6 +11,8 @@ dcl fixed fixedIntList := { 1,2,3};
dcl anInt T_UInt32 :=0;
dcl simpleseq MySimpleSeq := {a 42, b true, c three};
timer myTimer;
......@@ -18,73 +20,88 @@ procedure VDM comment '#hello';
fpar in inp fixedIntList,
in/out outp fixedIntList;
external comment '#vdm #classname=RemoteCall';
procedure VDM2;
fpar in inp T_Uint32,
in/out outp MySimpleSeq;
external comment '#vdm #classname=RemoteCall';
/* CIF ENDTEXT */
/* CIF START (940, 150), (80, 36) */
START;
/* CIF NEXTSTATE (944, 201), (72, 34) */
NEXTSTATE Wait;
/* CIF STATE (1210, 345), (74, 35) */
/* CIF STATE (1474, 345), (74, 35) */
STATE next;
/* CIF INPUT (1183, 400), (122, 35) */
/* CIF INPUT (1447, 400), (122, 35) */
INPUT pulse(a);
/* CIF PROCEDURECALL (1137, 450), (213, 35) */
/* CIF PROCEDURECALL (1401, 450), (213, 35) */
CALL reset_timer(mytimer);
/* CIF NEXTSTATE (1209, 500), (70, 35) */
/* CIF NEXTSTATE (1473, 500), (70, 35) */
NEXTSTATE wait;
ENDSTATE;
/* CIF STATE (1349, 125), (100, 35) */
/* CIF STATE (1468, 125), (100, 35) */
STATE timeout;
/* CIF INPUT (1334, 180), (147, 35) */
/* CIF INPUT (1453, 180), (147, 35) */
INPUT Paramless_TC;
/* CIF PROCEDURECALL (1283, 230), (249, 35) */
/* CIF PROCEDURECALL (1402, 230), (249, 35) */
CALL SET_timer(1000, mytimer);
/* CIF NEXTSTATE (1370, 280), (74, 35) */
/* CIF NEXTSTATE (1489, 280), (74, 35) */
NEXTSTATE next;
ENDSTATE;
/* CIF STATE (944, 201), (72, 34) */
STATE Wait;
/* CIF INPUT (693, 255), (101, 35) */
/* CIF INPUT (666, 255), (101, 35) */
INPUT pulse(a);
/* CIF TASK (658, 305), (170, 48) */
/* CIF TASK (631, 305), (170, 48) */
TASK seq := {0,1,0,1,0},
anint := 478;
/* CIF PROCEDURECALL (614, 368), (259, 35) */
/* CIF PROCEDURECALL (587, 368), (259, 35) */
CALL writeln('Input param', anint);
/* CIF PROCEDURECALL (624, 418), (238, 35) */
/* CIF PROCEDURECALL (597, 418), (238, 35) */
CALL ExternalProc(anint, anint);
/* CIF PROCEDURECALL (606, 468), (275, 35) */
/* CIF PROCEDURECALL (579, 468), (275, 35) */
CALL writeln('Output param', anint);
/* CIF PROCEDURECALL (600, 518), (286, 35) */
CALL writeln('Calling VDM with data');
/* CIF TASK (554, 568), (378, 35) */
TASK for each in fixed: call writeln(each); endfor;
/* CIF PROCEDURECALL (657, 618), (172, 35) */
/* CIF PROCEDURECALL (573, 518), (286, 35) */
CALL write('Calling VDM with data');
/* CIF TASK (523, 568), (386, 48) */
TASK for each in fixed: call write(each, ' '); endfor;
/* CIF PROCEDURECALL (631, 631), (170, 40) */
CALL writeln('');
/* CIF PROCEDURECALL (630, 686), (172, 35) */
CALL vdm(fixed, fixed);
/* CIF PROCEDURECALL (658, 668), (170, 40) */
CALL writeln('Result:');
/* CIF TASK (554, 723), (378, 35) */
TASK for each in fixed: call writeln(each); endfor;
/* CIF OUTPUT (674, 773), (138, 35) */
/* CIF PROCEDURECALL (631, 736), (170, 40) */
CALL write('Result:');
/* CIF TASK (525, 791), (383, 35) */
TASK for each in fixed: call write(each, ' '); endfor;
/* CIF PROCEDURECALL (658, 841), (116, 40) */
CALL writeln('');
/* CIF PROCEDURECALL (526, 896), (381, 35) */
CALL writeln('Calling VDM2 with value', fixed(0));
/* CIF PROCEDURECALL (595, 946), (242, 35) */
CALL vdm2(fixed(0), simpleseq);
/* CIF PROCEDURECALL (521, 996), (391, 40) */
CALL writeln('Result:', simpleseq!a, ' ', simpleseq!b);
/* CIF OUTPUT (647, 1051), (138, 35) */
OUTPUT telemetry(a);
/* CIF OUTPUT (670, 823), (147, 35) */
/* CIF OUTPUT (643, 1101), (147, 35) */
OUTPUT peek_list(seq);
/* CIF OUTPUT (655, 873), (177, 35) */
/* CIF OUTPUT (628, 1151), (177, 35) */
OUTPUT peek_fixed(fixed);
/* CIF NEXTSTATE (706, 923), (74, 35) */
/* CIF NEXTSTATE (679, 1201), (74, 35) */
NEXTSTATE next;
/* CIF INPUT (1000, 255), (147, 35) */
/* CIF INPUT (1078, 255), (147, 35) */
INPUT Paramless_TC;
/* CIF PROCEDURECALL (947, 305), (253, 35) */
/* CIF PROCEDURECALL (1025, 305), (253, 35) */
CALL writeln('Got Paramless TC');
/* CIF PROCEDURECALL (949, 355), (249, 35) */
/* CIF PROCEDURECALL (1027, 355), (249, 35) */
CALL SET_timer(1000, mytimer);
/* CIF OUTPUT (998, 405), (150, 35) */
/* CIF OUTPUT (1076, 405), (150, 35) */
OUTPUT Paramless_TM;
/* CIF NEXTSTATE (1038, 455), (70, 35) */
/* CIF NEXTSTATE (1116, 455), (70, 35) */
NEXTSTATE wait;
/* CIF INPUT (1174, 255), (104, 35) */
/* CIF INPUT (1288, 255), (104, 35) */
INPUT mytimer;
/* CIF NEXTSTATE (1175, 305), (102, 35) */
/* CIF NEXTSTATE (1289, 305), (102, 35) */
NEXTSTATE Timeout;
ENDSTATE;
ENDPROCESS orchestrator;
\ No newline at end of file
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