Commit 9d4787d1 authored by Maxime Perrotin's avatar Maxime Perrotin

Add test case

parent 7cde9b4d
include ../shared.mk
ROOT_MODEL=controller.pr
all: test-ada test-llvm
edit:
$(OPENGEODE) controller.pr system_structure.pr
test-parse:
$(OPENGEODE) controller.pr system_structure.pr --check
test-qgen-parse:
$(TESTQGEN_PARSE) $(ROOT_MODEL)
test-qgen-ada:
$(TESTQGEN_ADA) $(ROOT_MODEL)
test-qgen-c:
$(TESTQGEN_C) $(ROOT_MODEL)
test-qgen-gt-ada:
$(TESTQGEN_GT_ADA) $(ROOT_MODEL)
test-qgen-gt-c:
$(TESTQGEN_GT_C) $(ROOT_MODEL)
test-ada:
$(OPENGEODE) controller.pr system_structure.pr --toAda
mono $(ASN1SCC) -Ada -typePrefix asn1Scc -equal dataview-uniq.asn
test-c:
$(OPENGEODE) controller.pr system_structure.pr --toC
mono $(ASN1SCC) -c -typePrefix asn1Scc -equal dataview-uniq.asn
$(CC) -O$(O) -c *.c
test-llvm:
$(OPENGEODE) controller.pr system_strucure.pr --llvm -O$(O)
$(LLC) *.ll
$(CC) -O$(O) -c *.s
coverage:
coverage run -p $(OPENGEODE) controller.pr system_structure.pr --toAda
.PHONY: all edit test-parse test-ada test-llvm coverage
/* CIF PROCESS (250, 150), (150, 75) */
process Controller;
state Red;
substructure
out (Go_Green);
/* CIF START (59, 69), (59, 35) */
START;
/* CIF NEXTSTATE (15, 119), (147, 35) */
NEXTSTATE Everybody_Stopped;
/* CIF state (237, 112), (73, 35) */
state Walking;
/* CIF input (238, 167), (70, 35) */
input Clock;
/* CIF output (211, 222), (124, 35) */
output Info_User (Wait);
/* CIF PROCEDURECALL (184, 277), (178, 35) */
call Set_Timer (2000, Clock);
/* CIF NEXTSTATE (210, 332), (127, 35) */
NEXTSTATE Walking_Is_Over;
endstate;
/* CIF state (430, 116), (127, 35) */
state Walking_Is_Over;
/* CIF input (373, 171), (70, 35) */
input Clock;
/* CIF return (391, 226), (35, 35) */
return Go_Green;
/* CIF input (477, 171), (123, 35) */
input Button (cmd);
/* CIF task (453, 226), (172, 35) */
task Walk_Requested := True;
/* CIF NEXTSTATE (504, 281), (70, 35) */
NEXTSTATE -;
endstate;
/* CIF state (15, 119), (147, 35) */
state Everybody_Stopped;
/* CIF input (53, 174), (70, 35) */
input Clock;
/* CIF output (32, 229), (112, 35) */
output Info_User (Go);
/* CIF PROCEDURECALL (3, 284), (171, 35) */
call Set_Timer (5000, Clock);
/* CIF task (0, 339), (177, 35) */
task Walk_Requested := False;
/* CIF NEXTSTATE (52, 389), (73, 35) */
NEXTSTATE Walking;
endstate;
endsubstructure;
state Green;
substructure
in (short);
out (Go_Orange);
/* CIF START (604, 136), (70, 35) */
START short ;
/* CIF NEXTSTATE (583, 191), (110, 35) */
NEXTSTATE Second_Delay;
/* CIF START (343, 131), (70, 35) */
START;
/* CIF NEXTSTATE (331, 186), (93, 35) */
NEXTSTATE First_Delay;
/* CIF state (583, 191), (110, 35) */
state Second_Delay;
/* CIF input (604, 246), (70, 35) */
input Clock;
/* CIF return (621, 301), (35, 35) */
return Go_Orange;
endstate;
/* CIF state (331, 186), (93, 35) */
state First_Delay;
/* CIF input (206, 241), (70, 35) */
input Clock;
/* CIF PROCEDURECALL (155, 296), (171, 35) */
call Set_Timer (5000, Clock);
/* CIF NEXTSTATE (185, 351), (111, 35) */
NEXTSTATE Second_Delay;
/* CIF input (361, 241), (123, 35) */
input Button (cmd);
/* CIF PROCEDURECALL (336, 296), (171, 35) */
call Set_Timer (5000, Clock);
/* CIF NEXTSTATE (364, 346), (117, 35) */
NEXTSTATE Second_Delay;
endstate;
endsubstructure;
/* CIF TEXT (939, 61), (282, 152) */
timer clock;
dcl dummy t_Boolean;
dcl Walk_Requested T_Boolean := False;
dcl Cmd Command;
/* CIF ENDTEXT */
/* CIF START (155, 40), (70, 33) */
START;
/* CIF NEXTSTATE (152, 90), (75, 35) */
NEXTSTATE Off;
/* CIF state (828, 314), (70, 35) */
state Green;
/* CIF connect (863, 369), (0, 35) */
connect Go_Orange;
/* CIF PROCEDURECALL (762, 419), (201, 35) */
call Set_Timer (2000, Clock);
/* CIF output (805, 474), (114, 35) */
output Color (Orange);
/* CIF NEXTSTATE (828, 524), (70, 35) */
NEXTSTATE Orange;
endstate;
/* CIF state (686, 61), (70, 35) */
state Orange;
/* CIF input (686, 116), (70, 35) */
input Clock;
/* CIF PROCEDURECALL (632, 171), (178, 35) */
call Set_Timer (1000, Clock);
/* CIF output (674, 226), (92, 35) */
output Color (Red);
/* CIF NEXTSTATE (686, 276), (70, 35) */
NEXTSTATE Red;
endstate;
/* CIF state (443, 49), (70, 35) */
state Red;
/* CIF connect (478, 104), (0, 35) */
connect Go_Green;
/* CIF PROCEDURECALL (389, 159), (178, 35) */
call Set_Timer (5000, Clock);
/* CIF output (424, 214), (106, 35) */
output Color (Green);
/* CIF decision (415, 264), (124, 50) */
decision Walk_requested;
/* CIF ANSWER (364, 334), (70, 24) */
(True):
/* CIF NEXTSTATE (339, 378), (119, 35) */
NEXTSTATE Green via Short;
/* CIF ANSWER (533, 334), (68, 24) */
(False):
/* CIF NEXTSTATE (530, 378), (74, 35) */
NEXTSTATE Green;
enddecision;
endstate;
/* CIF state (152, 90), (75, 35) */
state Off;
/* CIF input (122, 145), (134, 35) */
input Initialize (dummy);
/* CIF PROCEDURECALL (101, 200), (178, 35) */
call Set_Timer (1000, Clock);
/* CIF output (143, 255), (92, 35) */
output Color (Red);
/* CIF output (127, 310), (124, 35) */
output Info_User (Wait);
/* CIF NEXTSTATE (159, 360), (61, 35) */
NEXTSTATE Red;
endstate;
endprocess Controller;
\ No newline at end of file
TASTE-BasicTypes DEFINITIONS ::=
BEGIN
-- Set of TASTE predefined basic types
T-Int32 ::= INTEGER (-2147483648 .. 2147483647)
T-UInt32 ::= INTEGER (0 .. 4294967295)
T-Int8 ::= INTEGER (-128 .. 127)
T-UInt8 ::= INTEGER (0 .. 255)
T-Boolean ::= BOOLEAN
END
TRAFFICLIGHT-BASIC-DATAVIEW DEFINITIONS ::=
BEGIN
IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes;
TL-Color ::= ENUMERATED { red, orange, green}
P-Light ::= ENUMERATED { go, wait }
Command ::= ENUMERATED { request-passage }
END
-- Header file for function Controller in SDL language
-- Component type : FALSE
-- Instance of :
-- Generated by TASTE on 2019-10-28 08:57:26
-- Context Parameters present : NO
-- Provided interfaces : Button, Initialize, clock
-- Required interfaces : Color, Info_User, RESET_clock, SET_clock
-- User-defined properties for this function:
-- * Taste::Active_Interfaces = any
-- * Taste::coordinates = 85823 58738 111492 90391
-- DO NOT EDIT THIS FILE, IT WILL BE OVERWRITTEN DURING THE BUILD
/* CIF Keep Specific Geode ASNFilename 'dataview-uniq.asn' */
use Datamodel;
system Controller;
/* CIF Keep Specific Geode PARAMNAMES req */
signal Button (Command);
/* CIF Keep Specific Geode PARAMNAMES a */
signal Initialize (T_Boolean);
;
/* CIF Keep Specific Geode PARAMNAMES current_color */
signal Color (TL_Color);
/* CIF Keep Specific Geode PARAMNAMES status */
signal Info_User (P_Light);
;
;
channel c
from env to Controller with Button, Initialize;
from Controller to env with Color, Info_User;
endchannel;
block Controller;
signalroute r
from env to Controller with Button, Initialize;
from Controller to env with Color, Info_User;
connect c and r;
process Controller referenced;
endblock;
endsystem;
Markdown is supported
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