Project

General

Profile

Revision b58cc410 regression_tests/lustre_files/success/Simulink/src_many_files/TriggeredEnabled_Subsystem2.LUSTREC.lus

View differences:

regression_tests/lustre_files/success/Simulink/src_many_files/TriggeredEnabled_Subsystem2.LUSTREC.lus
1 1
-- This file has been generated by CoCoSim2.
2 2

  
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 23:08:06
3
-- Compiler: Lustre compiler 2 (nasa_toLustre.ToLustre.m)
4
-- Time: 12-Mar-2019 22:09:05
5
node  Enabled_Counter_11_121_triggeredSS(In1_1 : real;
6
	_isEnabled : bool;
7
	_isTriggered : bool;
8
	__time_step : real;
9
	__nb_step : int;)
10
returns(Out1_1 : real;
11
	Out2_1 : real;);
12
var pre_Out1_1 : real;
13
	pre_Out2_1 : real;
14
	_isTriggered_clock : bool clock;
15
let
16
	pre_Out1_1 = if (__nb_step > 0) then
17
		(pre Out1_1)
18
	    else 0.0;
19
	pre_Out2_1 = if (__nb_step > 0) then
20
		(pre Out2_1)
21
	    else 0.0;
22
	_isTriggered_clock = _isTriggered;
23
	(Out1_1, Out2_1) = (merge _isTriggered_clock 
24
		(true -> Enabled_Counter_11_121((In1_1 when _isTriggered_clock), (__time_step when _isTriggered_clock), (__nb_step when _isTriggered_clock))) 
25
		(false -> (pre_Out1_1, pre_Out2_1) when false(_isTriggered_clock)));
26
tel
27

  
5 28
(*
6 29
Original block name: TriggeredEnabled_Subsystem2/Enabled_Counter
7 30
*)
8
node  Enabled_Counter_11_121_automaton(In1_1 : real;
31
node  Enabled_Counter_11_121_condExecSS(In1_1 : real;
9 32
	_isEnabled : bool;
10 33
	_isTriggered : bool;
11 34
	__time_step : real;
......
14 37
	Out2_1 : real;);
15 38
var pre_Out1_1 : real;
16 39
	pre_Out2_1 : real;
40
	_isEnabled_clock : bool clock;
17 41
let
18 42
	pre_Out1_1 = if (__nb_step > 0) then
19 43
		(pre Out1_1)
20
	    else 0.000000000000000;
44
	    else 0.0;
21 45
	pre_Out2_1 = if (__nb_step > 0) then
22 46
		(pre Out2_1)
23
	    else 0.000000000000000;
24
	automaton enabled_Enabled_Counter_11_121
25
	state Active_Enabled_Counter_11_121:
26
	unless (not _isEnabled) restart Inactive_Enabled_Counter_11_121
27
	let
28
		automaton triggered_Enabled_Counter_11_121
29
	state Active_triggered_Enabled_Counter_11_121:
30
	unless (not _isTriggered) resume Inactive_triggered_Enabled_Counter_11_121
31
	let
32
		(Out1_1, Out2_1) = Enabled_Counter_11_121(In1_1, __time_step, __nb_step);
33
	tel
34

  
35
	state Inactive_triggered_Enabled_Counter_11_121:
36
	unless _isTriggered resume Active_triggered_Enabled_Counter_11_121
37
	let
38
		Out1_1 = pre_Out1_1;
39
		Out2_1 = pre_Out2_1;
40
	tel
41

  
42

  
43
	tel
44

  
45
	state Inactive_Enabled_Counter_11_121:
46
	unless _isEnabled restart Active_Enabled_Counter_11_121
47
	let
48
		Out1_1 = pre_Out1_1;
49
		Out2_1 = pre_Out2_1;
50
	tel
51

  
52

  
47
	    else 0.0;
48
	_isEnabled_clock = _isEnabled;
49
	(Out1_1, Out2_1) = (merge _isEnabled_clock 
50
		(true -> (Enabled_Counter_11_121_triggeredSS((In1_1 when _isEnabled_clock), (_isEnabled when _isEnabled_clock), (_isTriggered when _isEnabled_clock), (__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock)) every (false -> (_isEnabled_clock and (not (pre _isEnabled_clock)))))) 
51
		(false -> (pre_Out1_1, pre_Out2_1) when false(_isEnabled_clock)));
53 52
tel
54 53

  
55 54
(*
......
64 63
	UnitDelay_1 : real;
65 64
let
66 65
	Add_1 = 0.0 + In1_1 + UnitDelay_1;
67
	UnitDelay_1 = (0.000000000000000 -> (pre Add_1));
66
	UnitDelay_1 = (0.0 -> (pre Add_1));
68 67
	Out1_1 = Add_1;
69 68
	Out2_1 = UnitDelay_1;
70 69
tel
......
88 87
	EnableCond_of_Enabled_Counter_11_121 = Enable_1;
89 88
	TriggerCond_of_Enabled_Counter_11_121 = (false -> (Trigger_1 and (not (pre Trigger_1))));
90 89
	ExecutionCond_of_Enabled_Counter_11_121 = (EnableCond_of_Enabled_Counter_11_121 and TriggerCond_of_Enabled_Counter_11_121);
91
	(Enabled_Counter_1, Enabled_Counter_2) = Enabled_Counter_11_121_automaton(In1_1, EnableCond_of_Enabled_Counter_11_121, TriggerCond_of_Enabled_Counter_11_121, __time_step, __nb_step);
90
	(Enabled_Counter_1, Enabled_Counter_2) = Enabled_Counter_11_121_condExecSS(In1_1, EnableCond_of_Enabled_Counter_11_121, TriggerCond_of_Enabled_Counter_11_121, __time_step, __nb_step);
92 91
	Out1_1 = Enabled_Counter_1;
93 92
	Out2_1 = Enabled_Counter_2;
94
	__time_step = (0.0 -> ((pre __time_step) + 1.000000000000000));
93
	__time_step = (0.0 -> ((pre __time_step) + 1.0));
95 94
	__nb_step = (0 -> ((pre __nb_step) + 1));
96 95
tel
97 96

  

Also available in: Unified diff