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

Filter parameterless PIs, and introduce sync RI

- The auto-generated GUIs currently do not support parameterless
interfaces, so they must not appear in the "mini-cv.aadl" file. They can
be handled directly by the gui code.
- Support of Sync RIs, there are two cases (1) the calls to set/reset
  timers, that can be handled directly by the gui code and (2) the calls
to real external code, that has to be provided by the user and linked
with the shared library. An example of this second case is included in
demo-simu.
parent 2e3e45ab
......@@ -125,6 +125,11 @@ def _process(process, simu=False, **kwargs):
return a string
'''
res = []
if not io_param:
LOG.info('Parameterless interface "{}" will not appear in the'
' AADL file but will be handled directly by the GUI'
.format(sp_name))
return ''
# In case of shared library, generate the AADL "mini-cv" code
res.append('SUBPROGRAM {}'.format(sp_name))
if io_param:
......
......@@ -12,6 +12,7 @@ test-ada:
$(CC) -c -g test_ada.c
$(OPENGEODE) orchestrator.pr system_structure.pr --shared
$(ASN1SCC) -Ada dataview-uniq.asn -typePrefix asn1Scc -equal
$(ASN1SCC) -c dataview-uniq.asn -typePrefix asn1Scc -equal
$(GNATMAKE) -O$(O) -gnat2012 -c *.adb
$(GNATBIND) -n orchestrator.ali
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali -lgnat
......@@ -22,10 +23,12 @@ test-llvm: orchestrator.o
test-python:
$(OPENGEODE) orchestrator.pr system_structure.pr --shared
$(ASN1SCC) -Ada dataview-uniq.asn -typePrefix asn1Scc -equal
$(ASN1SCC) -c dataview-uniq.asn -typePrefix asn1Scc -equal
$(GNATMAKE) -O$(O) -gnat2012 -c *.adb
$(GNATBIND) -n -Lliborchestrator orchestrator
$(GNATMAKE) -c -gnat2012 b~orchestrator.adb
$(CC) -shared -fPIC -o liborchestrator.so b~orchestrator.o orchestrator.o taste_basictypes.o adaasn1rtl.o -lgnat
$(CC) -c external_proc.c
$(CC) -shared -fPIC -o liborchestrator.so b~orchestrator.o orchestrator.o taste_basictypes.o adaasn1rtl.o external_proc.o -lgnat
python -c "from ctypes import *; test=CDLL('./liborchestrator.so'); test.liborchestratorinit()"
coverage:
......
TASTE-BasicTypes DEFINITIONS ::=
BEGIN
T-UInt32 ::= INTEGER (0..4294967295)
TASTE-Peek-id ::= INTEGER (0..4294967295)
TASTE-Peek-id-list ::= SEQUENCE (SIZE (1..10)) OF TASTE-Peek-id
......
......@@ -8,10 +8,14 @@ COMMENT 'Hello';
dcl a myEnum;
dcl fixed fixedIntList := { 1,2,3};
dcl anInt T_UInt32 :=0;
timer myTimer;
/* CIF ENDTEXT */
/* CIF START (478, 150), (80, 36) */
START;
/* CIF NEXTSTATE (484, 201), (68, 34) */
/* CIF NEXTSTATE (483, 201), (68, 34) */
NEXTSTATE Wait;
/* CIF STATE (601, 354), (70, 35) */
STATE next;
......@@ -20,17 +24,19 @@ dcl fixed fixedIntList := { 1,2,3};
/* CIF NEXTSTATE (601, 459), (70, 35) */
NEXTSTATE wait;
ENDSTATE;
/* CIF STATE (484, 201), (68, 34) */
/* CIF STATE (483, 201), (68, 34) */
STATE Wait;
/* CIF INPUT (474, 255), (87, 35) */
INPUT pulse(a);
/* CIF OUTPUT (461, 305), (114, 35) */
/* CIF PROCEDURECALL (420, 305), (193, 35) */
CALL externalProc(anint, anint);
/* CIF OUTPUT (460, 355), (114, 35) */
OUTPUT telemetry(a);
/* CIF OUTPUT (456, 355), (123, 35) */
/* CIF OUTPUT (455, 405), (123, 35) */
OUTPUT peek_list(seq);
/* CIF OUTPUT (445, 405), (145, 35) */
/* CIF OUTPUT (444, 455), (145, 35) */
OUTPUT peek_fixed(fixed);
/* CIF NEXTSTATE (483, 455), (70, 35) */
/* CIF NEXTSTATE (482, 505), (70, 35) */
NEXTSTATE next;
ENDSTATE;
ENDPROCESS orchestrator;
\ No newline at end of file
#!/bin/sh
#!/bin/bash -e
make test-python
rm -rf simu
mkdir -p simu
......
......@@ -7,7 +7,12 @@ SYSTEM orchestrator;
SIGNAL telemetry(myenum);
SIGNAL peek_list(taste_peek_id_list);
SIGNAL peek_fixed(fixedintlist);
PROCEDURE ExternalProc;
FPAR
IN gnc_output T_UInt32,
IN/OUT gnc_input T_UInt32;
EXTERNAL;
CHANNEL c
FROM ENV TO orchestrator WITH pulse;
......
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