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

Add ground to support continuous signals

parent 82478100
......@@ -2,8 +2,8 @@
 
# Resource object code
#
# Created: Sun Nov 1 16:38:09 2015
# by: The Resource Compiler for PySide (Qt v4.8.4)
# Created: Sun Nov 22 08:45:14 2015
# by: The Resource Compiler for PySide (Qt v4.8.6)
#
# WARNING! All changes made in this file will be lost!
 
......@@ -2962,7 +2962,7 @@ def state(root, parent, context):
pass
else:
stwarn.append('Unsupported STATE definition child type: ' +
str(child.type))
sdl92Parser.tokenNames[child.type])
# post-processing: if state is followed by an ASTERISK input, the exact
# list of inputs can be updated. Possible only if context has signals
if context.input_signals and asterisk_input:
......
This diff is collapsed.
This diff is collapsed.
......@@ -584,7 +584,7 @@ state_part
//| priority_input // Not supported
| save_part // Not supported in openGEODE
| spontaneous_transition
| continuous_signal // Not supoorted in openGEODE
| continuous_signal
| connect_part
;
......@@ -623,10 +623,12 @@ enabling_condition
continuous_signal
: PROVIDED expression end
(PRIORITY integer_literal_name=INT end)?
: cif?
hyperlink?
PROVIDED expression e=end
(PRIORITY p=INT end)?
transition
-> ^(PROVIDED expression $integer_literal_name? transition)
-> ^(PROVIDED cif? hyperlink? expression $p? $e? transition)
;
......
include ../shared.mk
all: test-ada test-llvm
edit:
$(OPENGEODE) og.pr
test-parse:
$(OPENGEODE) og.pr --check
test-ada:
$(OPENGEODE) og.pr --toAda
$(ASN1SCC) -Ada dataview-uniq.asn -typePrefix asn1Scc -equal
$(GNATMAKE) -O$(O) -c *.adb
$(GNATBIND) -n og.ali
test-c:
$(OPENGEODE) og.pr --toC
$(ASN1SCC) -c dataview-uniq.asn -typePrefix asn1Scc -equal
$(CC) -O$(O) -c *.c
test-llvm:
$(OPENGEODE) og.pr --llvm -O$(O)
$(LLC) *.ll
$(CC) -O$(O) -c *.s
test-python:
$(OPENGEODE) og.pr --shared
$(ASN1SCC) -Ada dataview-uniq.asn -typePrefix asn1Scc -equal
$(ASN1SCC) -c dataview-uniq.asn -typePrefix asn1Scc -equal
$(GNATMAKE) -O$(O) -gnat2012 -fPIC -c *.adb
$(GNATBIND) -n -Llibog og
$(GNATMAKE) -c -fPIC -gnat2012 b~og.adb
$(CC) -shared -fPIC -o libog.so b~og.o og.o adaasn1rtl.o taste_dataview.o -lgnat
python -c "from ctypes import *; test=CDLL('./libog.so'); test.liboginit(); test.og_for_a(); test.og_for_b(); test.og_for_a(); test.og_for_b()"
coverage:
coverage run -p $(OPENGEODE) og.pr --toAda
.PHONY: all edit test-parse test-ada test-llvm coverage
TASTE-Dataview DEFINITIONS ::=
BEGIN
TC-Type ::= SEQUENCE {
apid INTEGER,
content CHOICE {
change-mode ENUMERATED { safe, operational },
patch-memory INTEGER (0..100)
}
}
TM-Type ::= SEQUENCE {
apid INTEGER
}
Boolean-Type ::= BOOLEAN
END
SYSTEM og;
/* CIF TEXT (156, 190), (356, 248) */
use dv comment 'dataview-uniq.asn';
signal telecommand(tc_type);
signal telemetry(tm_type);
/* CIF ENDTEXT */
CHANNEL c
FROM ENV TO og WITH telecommand;
FROM og TO ENV WITH telemetry;
ENDCHANNEL;
BLOCK og;
SIGNALROUTE r
FROM ENV TO og WITH telecommand;
FROM og TO ENV WITH telemetry;
CONNECT c AND r;
/* CIF PROCESS (225, 49), (150, 75) */
PROCESS og;
STATE AGGREGATION wait;
SUBSTRUCTURE
STATE mode_manager;
SUBSTRUCTURE
/* CIF START (180, 60), (70, 35) */
START;
/* CIF NEXTSTATE (159, 110), (111, 35) */
NEXTSTATE wait_for_tc;
/* CIF STATE (159, 110), (111, 35) */
STATE wait_for_tc;
/* CIF INPUT (143, 165), (144, 35) */
provided got_tc=true and present(tc!content)=change_mode;
/* CIF PROCEDURECALL (123, 215), (184, 35) */
CALL writeln('Change Mode');
/* CIF NEXTSTATE (180, 265), (70, 35) */
NEXTSTATE -;
ENDSTATE;
ENDSUBSTRUCTURE;
STATE tc_router;
SUBSTRUCTURE
/* CIF START (144, 56), (70, 35) */
START;
/* CIF NEXTSTATE (126, 106), (106, 35) */
NEXTSTATE wait_for_tc;
/* CIF STATE (126, 106), (106, 35) */
STATE wait_for_tc;
/* CIF INPUT (107, 161), (144, 35) */
INPUT telecommand(tc);
/* CIF TASK (117, 211), (123, 35) */
TASK got_tc := true;
/* CIF NEXTSTATE (144, 261), (70, 35) */
NEXTSTATE -;
ENDSTATE;
ENDSUBSTRUCTURE;
STATE memory_manager;
SUBSTRUCTURE
/* CIF START (165, 47), (70, 35) */
START;
/* CIF NEXTSTATE (147, 97), (106, 35) */
NEXTSTATE wait_for_tc;
/* CIF STATE (147, 97), (106, 35) */
STATE wait_for_tc;
/* CIF INPUT (128, 152), (144, 35) */
provided got_tc=true and present(tc!content)=patch_memory;
/* CIF PROCEDURECALL (87, 202), (226, 35) */
CALL writeln('Patch Memory');
/* CIF NEXTSTATE (165, 252), (70, 35) */
NEXTSTATE -;
ENDSTATE;
ENDSUBSTRUCTURE;
/* CIF STATE (370, 97), (147, 35) */
STATE memory_manager;
ENDSTATE;
/* CIF STATE (238, 111), (96, 35) */
STATE tc_router;
ENDSTATE;
/* CIF STATE (314, 191), (132, 35) */
STATE mode_manager;
ENDSTATE;
ENDSUBSTRUCTURE;
/* CIF TEXT (0, 310), (287, 140) */
-- This system tests the provided clause
-- (continuous signal)
dcl tc TC_type;
dcl tm TM_type;
dcl got_tc Boolean_type;
/* CIF ENDTEXT */
/* CIF START (316, 297), (70, 35) */
START;
/* CIF NEXTSTATE (316, 347), (70, 35) */
NEXTSTATE wait;
/* CIF STATE (412, 344), (67, 35) */
STATE wait;
ENDSTATE;
ENDPROCESS og;
ENDBLOCK;
ENDSYSTEM;
#!/bin/bash -e
make test-python
rm -rf simu
mkdir -p simu
asn2aadlPlus dataview-uniq.asn simu/DataView.aadl
cp libog.so dataview-uniq.asn *.pr simu
mv *.aadl simu
cd simu
aadl2glueC DataView.aadl og_interface.aadl
asn2dataModel -toPython dataview-uniq.asn
make -f Makefile.python
echo "errCodes=$(taste-asn1-errCodes ./dataview-uniq.h)" >>datamodel.py
LD_LIBRARY_PATH=. taste-gui -l
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