Project

General

Profile

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

View differences:

regression_tests/lustre_files/success/Simulink/src_many_files/EnablePort5_PP.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 22:34:36
3
-- Compiler: Lustre compiler 2 (nasa_toLustre.ToLustre.m)
4
-- Time: 20-Mar-2019 13:41:44
5 5
(*
6 6
Original block name: EnablePort5_PP/Enabled_Counter/Subsystem
7 7
*)
8
node  Subsystem_76_056_automaton(In1_1 : real;
8
node  Subsystem_30_930_condExecSS(In1_1 : real;
9 9
	Enable_1 : real;
10 10
	_isEnabled : bool;
11 11
	__time_step : real;
......
14 14
	Out2_1 : real;);
15 15
var pre_Out1_1 : real;
16 16
	pre_Out2_1 : real;
17
	_isEnabled_clock : bool clock;
17 18
let
18 19
	pre_Out1_1 = if (__nb_step > 0) then
19 20
		(pre Out1_1)
20
	    else 0.000000000000000;
21
	    else 0.0;
21 22
	pre_Out2_1 = if (__nb_step > 0) then
22 23
		(pre Out2_1)
23
	    else 0.000000000000000;
24
	automaton enabled_Subsystem_76_056
25
	state Active_Subsystem_76_056:
26
	unless (not _isEnabled) restart Inactive_Subsystem_76_056
27
	let
28
		(Out1_1, Out2_1) = Subsystem_76_056(In1_1, Enable_1, __time_step, __nb_step);
29
	tel
30

  
31
	state Inactive_Subsystem_76_056:
32
	unless _isEnabled resume Active_Subsystem_76_056
33
	let
34
		Out1_1 = pre_Out1_1;
35
		Out2_1 = pre_Out2_1;
36
	tel
37

  
38

  
24
	    else 0.0;
25
	_isEnabled_clock = _isEnabled;
26
	(Out1_1, Out2_1) = (merge _isEnabled_clock 
27
		(true -> Subsystem_30_930((In1_1 when _isEnabled_clock), (Enable_1 when _isEnabled_clock), (__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock))) 
28
		(false -> (pre_Out1_1, pre_Out2_1) when false(_isEnabled_clock)));
39 29
tel
40 30

  
41 31
(*
42 32
Original block name: EnablePort5_PP/Enabled_Counter/Subsystem
43 33
*)
44
node  Subsystem_76_056(In1_1 : real;
34
node  Subsystem_30_930(In1_1 : real;
45 35
	Enable_1 : real;
46 36
	__time_step : real;
47 37
	__nb_step : int;)
......
51 41
	UnitDelay_1 : real;
52 42
let
53 43
	Add_1 = 0.0 + In1_1 + UnitDelay_1;
54
	UnitDelay_1 = (0.000000000000000 -> (pre Add_1));
44
	UnitDelay_1 = (0.0 -> (pre Add_1));
55 45
	Out1_1 = Add_1;
56 46
	Out2_1 = Enable_1;
57 47
tel
......
59 49
(*
60 50
Original block name: EnablePort5_PP/Enabled_Counter
61 51
*)
62
node  Enabled_Counter_70_296_automaton(In1_1 : real;
52
node  Enabled_Counter_18_598_condExecSS(In1_1 : real;
63 53
	_isEnabled : bool;
64 54
	__time_step : real;
65 55
	__nb_step : int;)
......
69 59
var pre_Out1_1 : real;
70 60
	pre_Out2_1 : real;
71 61
	pre_Out3_1 : real;
62
	_isEnabled_clock : bool clock;
72 63
let
73 64
	pre_Out1_1 = if (__nb_step > 0) then
74 65
		(pre Out1_1)
75
	    else 0.000000000000000;
66
	    else 0.0;
76 67
	pre_Out2_1 = if (__nb_step > 0) then
77 68
		(pre Out2_1)
78
	    else 0.000000000000000;
69
	    else 0.0;
79 70
	pre_Out3_1 = if (__nb_step > 0) then
80 71
		(pre Out3_1)
81
	    else 0.000000000000000;
82
	automaton enabled_Enabled_Counter_70_296
83
	state Active_Enabled_Counter_70_296:
84
	unless (not _isEnabled) restart Inactive_Enabled_Counter_70_296
85
	let
86
		(Out1_1, Out2_1, Out3_1) = Enabled_Counter_70_296(In1_1, __time_step, __nb_step);
87
	tel
88

  
89
	state Inactive_Enabled_Counter_70_296:
90
	unless _isEnabled resume Active_Enabled_Counter_70_296
91
	let
92
		Out1_1 = pre_Out1_1;
93
		Out2_1 = pre_Out2_1;
94
		Out3_1 = pre_Out3_1;
95
	tel
96

  
97

  
72
	    else 0.0;
73
	_isEnabled_clock = _isEnabled;
74
	(Out1_1, Out2_1, Out3_1) = (merge _isEnabled_clock 
75
		(true -> Enabled_Counter_18_598((In1_1 when _isEnabled_clock), (__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock))) 
76
		(false -> (pre_Out1_1, pre_Out2_1, pre_Out3_1) when false(_isEnabled_clock)));
98 77
tel
99 78

  
100 79
(*
101 80
Original block name: EnablePort5_PP/Enabled_Counter
102 81
*)
103
node  Enabled_Counter_70_296(In1_1 : real;
82
node  Enabled_Counter_18_598(In1_1 : real;
104 83
	__time_step : real;
105 84
	__nb_step : int;)
106 85
returns(Out1_1 : real;
107 86
	Out2_1 : real;
108 87
	Out3_1 : real;);
109 88
var Add_1 : real;
110
	ExecutionCond_of_Subsystem_76_056 : bool;
89
	ExecutionCond_of_Subsystem_30_930 : bool;
111 90
	Subsystem_1 : real;
112 91
	Subsystem_2 : real;
113 92
	UnitDelay_1 : real;
114 93
let
115 94
	Add_1 = 0.0 + In1_1 + UnitDelay_1;
116
	ExecutionCond_of_Subsystem_76_056 = (In1_1 > 0.0);
117
	(Subsystem_1, Subsystem_2) = Subsystem_76_056_automaton(In1_1, In1_1, ExecutionCond_of_Subsystem_76_056, __time_step, __nb_step);
118
	UnitDelay_1 = (0.000000000000000 -> (pre Add_1));
95
	ExecutionCond_of_Subsystem_30_930 = (In1_1 > 0.0);
96
	(Subsystem_1, Subsystem_2) = Subsystem_30_930_condExecSS(In1_1, In1_1, ExecutionCond_of_Subsystem_30_930, __time_step, __nb_step);
97
	UnitDelay_1 = (0.0 -> (pre Add_1));
119 98
	Out1_1 = Add_1;
120 99
	Out2_1 = Subsystem_1;
121 100
	Out3_1 = Subsystem_2;
......
129 108
returns(Out1_1 : real;
130 109
	Out2_1 : real;
131 110
	Out3_1 : real;);
132
var ExecutionCond_of_Enabled_Counter_70_296 : bool;
111
var ExecutionCond_of_Enabled_Counter_18_598 : bool;
133 112
	Enabled_Counter_1 : real;
134 113
	Enabled_Counter_2 : real;
135 114
	Enabled_Counter_3 : real;
136 115
	__time_step : real;
137 116
	__nb_step : int;
138 117
let
139
	ExecutionCond_of_Enabled_Counter_70_296 = (Enable_1 > 0.0);
140
	(Enabled_Counter_1, Enabled_Counter_2, Enabled_Counter_3) = Enabled_Counter_70_296_automaton(In1_1, ExecutionCond_of_Enabled_Counter_70_296, __time_step, __nb_step);
118
	ExecutionCond_of_Enabled_Counter_18_598 = (Enable_1 > 0.0);
119
	(Enabled_Counter_1, Enabled_Counter_2, Enabled_Counter_3) = Enabled_Counter_18_598_condExecSS(In1_1, ExecutionCond_of_Enabled_Counter_18_598, __time_step, __nb_step);
141 120
	Out1_1 = Enabled_Counter_1;
142 121
	Out2_1 = Enabled_Counter_2;
143 122
	Out3_1 = Enabled_Counter_3;
144
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
123
	__time_step = (0.0 -> ((pre __time_step) + 0.20));
145 124
	__nb_step = (0 -> ((pre __nb_step) + 1));
146 125
tel
147 126

  

Also available in: Unified diff