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

Merge pull request #33 from maxime-esa/state_aggregation

State aggregation
parents d1c60c7a 62d30cc2
...@@ -379,7 +379,6 @@ package {process_name} is'''.format(process_name=process_name, ...@@ -379,7 +379,6 @@ package {process_name} is'''.format(process_name=process_name,
taste_template.extend(dll_api) taste_template.extend(dll_api)
# Generate the code for each input signal (provided interface) and timers # Generate the code for each input signal (provided interface) and timers
print process.input_signals
for signal in process.input_signals + [ for signal in process.input_signals + [
{'name': timer.lower()} for timer in process.timers]: {'name': timer.lower()} for timer in process.timers]:
signame = signal.get('name', u'START') signame = signal.get('name', u'START')
...@@ -1991,7 +1990,7 @@ def _transition(tr, **kwargs): ...@@ -1991,7 +1990,7 @@ def _transition(tr, **kwargs):
if tr.terminator.next_is_aggregation: if tr.terminator.next_is_aggregation:
statement = u'{};'.format(nid) statement = u'{};'.format(nid)
else: else:
statement = u'tdId := {};'.format(nid) statement = u'trId := {};'.format(nid)
code.extend([u'when {} =>' code.extend([u'when {} =>'
.format(u'|'.join(sta)), .format(u'|'.join(sta)),
statement]) statement])
......
...@@ -24,33 +24,6 @@ for_b; ...@@ -24,33 +24,6 @@ for_b;
PROCESS og; PROCESS og;
STATE AGGREGATION wait; STATE AGGREGATION wait;
SUBSTRUCTURE SUBSTRUCTURE
STATE b;
SUBSTRUCTURE
/* CIF START (146, 55), (70, 35) */
START;
/* CIF PROCEDURECALL (77, 105), (208, 35) */
CALL writeln('[b] startup');
/* CIF NEXTSTATE (146, 155), (70, 35) */
NEXTSTATE b1;
/* CIF STATE (392, 144), (70, 35) */
STATE b2;
/* CIF INPUT (388, 199), (79, 35) */
INPUT for_a;
/* CIF PROCEDURECALL (308, 249), (239, 35) */
CALL writeln('[b] Going to b1');
/* CIF NEXTSTATE (392, 299), (70, 35) */
NEXTSTATE b1;
ENDSTATE;
/* CIF STATE (146, 155), (70, 35) */
STATE b1;
/* CIF INPUT (138, 210), (80, 35) */
INPUT for_b;
/* CIF PROCEDURECALL (58, 260), (239, 35) */
CALL writeln('[b] Going to b2');
/* CIF NEXTSTATE (143, 310), (70, 35) */
NEXTSTATE b2;
ENDSTATE;
ENDSUBSTRUCTURE;
STATE a; STATE a;
SUBSTRUCTURE SUBSTRUCTURE
/* CIF START (134, 57), (70, 35) */ /* CIF START (134, 57), (70, 35) */
...@@ -78,12 +51,39 @@ for_b; ...@@ -78,12 +51,39 @@ for_b;
NEXTSTATE a2; NEXTSTATE a2;
ENDSTATE; ENDSTATE;
ENDSUBSTRUCTURE; ENDSUBSTRUCTURE;
/* CIF STATE (170, 50), (70, 35) */ STATE b;
STATE a; SUBSTRUCTURE
ENDSTATE; /* CIF START (146, 55), (70, 35) */
START;
/* CIF PROCEDURECALL (77, 105), (208, 35) */
CALL writeln('[b] startup');
/* CIF NEXTSTATE (146, 155), (70, 35) */
NEXTSTATE b1;
/* CIF STATE (392, 144), (70, 35) */
STATE b2;
/* CIF INPUT (388, 199), (79, 35) */
INPUT for_b;
/* CIF PROCEDURECALL (308, 249), (239, 35) */
CALL writeln('[b] Going to b1');
/* CIF NEXTSTATE (392, 299), (70, 35) */
NEXTSTATE b1;
ENDSTATE;
/* CIF STATE (146, 155), (70, 35) */
STATE b1;
/* CIF INPUT (138, 210), (80, 35) */
INPUT for_b;
/* CIF PROCEDURECALL (58, 260), (239, 35) */
CALL writeln('[b] Going to b2');
/* CIF NEXTSTATE (143, 310), (70, 35) */
NEXTSTATE b2;
ENDSTATE;
ENDSUBSTRUCTURE;
/* CIF STATE (170, 160), (70, 35) */ /* CIF STATE (170, 160), (70, 35) */
STATE b; STATE b;
ENDSTATE; ENDSTATE;
/* CIF STATE (170, 50), (70, 35) */
STATE a;
ENDSTATE;
ENDSUBSTRUCTURE; ENDSUBSTRUCTURE;
/* CIF TEXT (522, 328), (287, 140) */ /* CIF TEXT (522, 328), (287, 140) */
-- Text area for declarations and comments -- Text area for declarations and comments
...@@ -94,18 +94,18 @@ dcl x myInteger; ...@@ -94,18 +94,18 @@ dcl x myInteger;
START; START;
/* CIF NEXTSTATE (226, 299), (70, 35) */ /* CIF NEXTSTATE (226, 299), (70, 35) */
NEXTSTATE wait; NEXTSTATE wait;
/* CIF STATE (487, 484), (70, 35) */
STATE wait;
ENDSTATE;
/* CIF STATE (226, 299), (70, 35) */ /* CIF STATE (226, 299), (70, 35) */
STATE wait; STATE wait;
/* CIF INPUT (207, 354), (107, 35) */ /* CIF INPUT (207, 354), (107, 35) */
INPUT reset_all(x); INPUT reset_all(x);
/* CIF PROCEDURECALL (174, 404), (174, 35) */ /* CIF PROCEDURECALL (173, 404), (174, 35) */
CALL writeln('reset'); CALL writeln('reset');
/* CIF NEXTSTATE (226, 454), (70, 35) */ /* CIF NEXTSTATE (225, 454), (70, 35) */
NEXTSTATE -; NEXTSTATE -;
ENDSTATE; ENDSTATE;
/* CIF STATE (487, 484), (70, 35) */
STATE wait;
ENDSTATE;
ENDPROCESS og; ENDPROCESS og;
ENDBLOCK; ENDBLOCK;
ENDSYSTEM; ENDSYSTEM;
\ No newline at end of file
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