Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
d30beaa9
Commit
d30beaa9
authored
Nov 22, 2015
by
Maxime Perrotin
Browse files
Add ground to support continuous signals
parent
82478100
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
opengeode/icons.py
View file @
d30beaa9
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
# Resource object code
# Resource object code
#
#
# Created: Sun Nov
1 16:38:09
2015
# Created: Sun Nov
22 08:45:14
2015
# by: The Resource Compiler for PySide (Qt v4.8.
4
)
# by: The Resource Compiler for PySide (Qt v4.8.
6
)
#
#
# WARNING! All changes made in this file will be lost!
# WARNING! All changes made in this file will be lost!
opengeode/ogParser.py
View file @
d30beaa9
...
@@ -2962,7 +2962,7 @@ def state(root, parent, context):
...
@@ -2962,7 +2962,7 @@ def state(root, parent, context):
pass
pass
else
:
else
:
stwarn
.
append
(
'Unsupported STATE definition child type: '
+
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
# post-processing: if state is followed by an ASTERISK input, the exact
# list of inputs can be updated. Possible only if context has signals
# list of inputs can be updated. Possible only if context has signals
if
context
.
input_signals
and
asterisk_input
:
if
context
.
input_signals
and
asterisk_input
:
...
...
opengeode/sdl92Lexer.py
View file @
d30beaa9
This diff is collapsed.
Click to expand it.
opengeode/sdl92Parser.py
View file @
d30beaa9
This diff is collapsed.
Click to expand it.
sdl92.g
View file @
d30beaa9
...
@@ -584,7 +584,7 @@ state_part
...
@@ -584,7 +584,7 @@ state_part
//| priority_input // Not supported
//| priority_input // Not supported
| save_part // Not supported in openGEODE
| save_part // Not supported in openGEODE
| spontaneous_transition
| spontaneous_transition
| continuous_signal
// Not supoorted in openGEODE
| continuous_signal
| connect_part
| connect_part
;
;
...
@@ -623,10 +623,12 @@ enabling_condition
...
@@ -623,10 +623,12 @@ enabling_condition
continuous_signal
continuous_signal
: PROVIDED expression end
: cif?
(PRIORITY integer_literal_name=INT end)?
hyperlink?
PROVIDED expression e=end
(PRIORITY p=INT end)?
transition
transition
-> ^(PROVIDED
expression $integer_literal_nam
e? transition)
-> ^(PROVIDED
cif? hyperlink? expression $p? $
e? transition)
;
;
...
...
tests/regression/test-provided1/Makefile
0 → 100644
View file @
d30beaa9
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
tests/regression/test-provided1/dataview-uniq.asn
0 → 100644
View file @
d30beaa9
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
tests/regression/test-provided1/og.pr
0 → 100644
View file @
d30beaa9
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;
tests/regression/test-provided1/simu.sh
0 → 100755
View file @
d30beaa9
#!/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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment