Project

General

Profile

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

View differences:

regression_tests/lustre_files/success/Simulink/src_many_files/SwitchCase_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:14:19
3
-- Compiler: Lustre compiler 2 (nasa_toLustre.ToLustre.m)
4
-- Time: 20-Mar-2019 11:52:36
5 5
node  abs_int(x : int;)
6 6
returns(y : int;);
7 7
let
......
22 22
(*
23 23
Original block name: SwitchCase_PP/IfActionSubsystem
24 24
*)
25
node  IfActionSubsystem_58_023_automaton(In3_1 : bool;
25
node  IfActionSubsystem_14_054_condExecSS(In3_1 : bool;
26 26
	_isEnabled : bool;
27 27
	__time_step : real;
28 28
	__nb_step : int;)
29 29
returns(Out4_1 : bool;);
30 30
var pre_Out4_1 : bool;
31
	_isEnabled_clock : bool clock;
31 32
let
32 33
	pre_Out4_1 = if (__nb_step > 0) then
33 34
		(pre Out4_1)
34 35
	    else false;
35
	automaton enabled_IfActionSubsystem_58_023
36
	state Active_IfActionSubsystem_58_023:
37
	unless (not _isEnabled) restart Inactive_IfActionSubsystem_58_023
38
	let
39
		Out4_1 = IfActionSubsystem_58_023(In3_1, __time_step, __nb_step);
40
	tel
41

  
42
	state Inactive_IfActionSubsystem_58_023:
43
	unless _isEnabled resume Active_IfActionSubsystem_58_023
44
	let
45
		Out4_1 = pre_Out4_1;
46
	tel
47

  
48

  
36
	_isEnabled_clock = _isEnabled;
37
	Out4_1 = (merge _isEnabled_clock 
38
		(true -> IfActionSubsystem_14_054((In3_1 when _isEnabled_clock), (__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock))) 
39
		(false -> (pre_Out4_1) when false(_isEnabled_clock)));
49 40
tel
50 41

  
51 42
(*
52 43
Original block name: SwitchCase_PP/IfActionSubsystem
53 44
*)
54
node  IfActionSubsystem_58_023(In3_1 : bool;
45
node  IfActionSubsystem_14_054(In3_1 : bool;
55 46
	__time_step : real;
56 47
	__nb_step : int;)
57 48
returns(Out4_1 : bool;);
......
62 53
(*
63 54
Original block name: SwitchCase_PP/IfActionSubsystem1
64 55
*)
65
node  IfActionSubsystem1_63_030_automaton(In1_1 : real;
56
node  IfActionSubsystem1_19_527_condExecSS(In1_1 : real;
66 57
	_isEnabled : bool;
67 58
	__time_step : real;
68 59
	__nb_step : int;)
69 60
returns(Out1_1 : real;);
70 61
var pre_Out1_1 : real;
62
	_isEnabled_clock : bool clock;
71 63
let
72 64
	pre_Out1_1 = if (__nb_step > 0) then
73 65
		(pre Out1_1)
74
	    else 0.000000000000000;
75
	automaton enabled_IfActionSubsystem1_63_030
76
	state Active_IfActionSubsystem1_63_030:
77
	unless (not _isEnabled) restart Inactive_IfActionSubsystem1_63_030
78
	let
79
		Out1_1 = IfActionSubsystem1_63_030(In1_1, __time_step, __nb_step);
80
	tel
81

  
82
	state Inactive_IfActionSubsystem1_63_030:
83
	unless _isEnabled resume Active_IfActionSubsystem1_63_030
84
	let
85
		Out1_1 = pre_Out1_1;
86
	tel
87

  
88

  
66
	    else 0.0;
67
	_isEnabled_clock = _isEnabled;
68
	Out1_1 = (merge _isEnabled_clock 
69
		(true -> IfActionSubsystem1_19_527((In1_1 when _isEnabled_clock), (__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock))) 
70
		(false -> (pre_Out1_1) when false(_isEnabled_clock)));
89 71
tel
90 72

  
91 73
(*
92 74
Original block name: SwitchCase_PP/IfActionSubsystem1
93 75
*)
94
node  IfActionSubsystem1_63_030(In1_1 : real;
76
node  IfActionSubsystem1_19_527(In1_1 : real;
95 77
	__time_step : real;
96 78
	__nb_step : int;)
97 79
returns(Out1_1 : real;);
......
102 84
(*
103 85
Original block name: SwitchCase_PP/IfActionSubsystem2
104 86
*)
105
node  IfActionSubsystem2_68_023_automaton(In1_1 : bool;
87
node  IfActionSubsystem2_24_284_condExecSS(In1_1 : bool;
106 88
	_isEnabled : bool;
107 89
	__time_step : real;
108 90
	__nb_step : int;)
109 91
returns(Out1_1 : bool;);
110 92
var pre_Out1_1 : bool;
93
	_isEnabled_clock : bool clock;
111 94
let
112 95
	pre_Out1_1 = if (__nb_step > 0) then
113 96
		(pre Out1_1)
114 97
	    else false;
115
	automaton enabled_IfActionSubsystem2_68_023
116
	state Active_IfActionSubsystem2_68_023:
117
	unless (not _isEnabled) restart Inactive_IfActionSubsystem2_68_023
118
	let
119
		Out1_1 = IfActionSubsystem2_68_023(In1_1, __time_step, __nb_step);
120
	tel
121

  
122
	state Inactive_IfActionSubsystem2_68_023:
123
	unless _isEnabled resume Active_IfActionSubsystem2_68_023
124
	let
125
		Out1_1 = pre_Out1_1;
126
	tel
127

  
128

  
98
	_isEnabled_clock = _isEnabled;
99
	Out1_1 = (merge _isEnabled_clock 
100
		(true -> IfActionSubsystem2_24_284((In1_1 when _isEnabled_clock), (__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock))) 
101
		(false -> (pre_Out1_1) when false(_isEnabled_clock)));
129 102
tel
130 103

  
131 104
(*
132 105
Original block name: SwitchCase_PP/IfActionSubsystem2
133 106
*)
134
node  IfActionSubsystem2_68_023(In1_1 : bool;
107
node  IfActionSubsystem2_24_284(In1_1 : bool;
135 108
	__time_step : real;
136 109
	__nb_step : int;)
137 110
returns(Out1_1 : bool;);
......
142 115
(*
143 116
Original block name: SwitchCase_PP/IfActionSubsystem3
144 117
*)
145
node  IfActionSubsystem3_74_022_automaton(In1_1 : real;
118
node  IfActionSubsystem3_29_278_condExecSS(In1_1 : real;
146 119
	_isEnabled : bool;
147 120
	__time_step : real;
148 121
	__nb_step : int;)
149 122
returns(Out1_1 : real;);
150 123
var pre_Out1_1 : real;
124
	_isEnabled_clock : bool clock;
151 125
let
152 126
	pre_Out1_1 = if (__nb_step > 0) then
153 127
		(pre Out1_1)
154
	    else 0.000000000000000;
155
	automaton enabled_IfActionSubsystem3_74_022
156
	state Active_IfActionSubsystem3_74_022:
157
	unless (not _isEnabled) restart Inactive_IfActionSubsystem3_74_022
158
	let
159
		Out1_1 = IfActionSubsystem3_74_022(In1_1, __time_step, __nb_step);
160
	tel
161

  
162
	state Inactive_IfActionSubsystem3_74_022:
163
	unless _isEnabled resume Active_IfActionSubsystem3_74_022
164
	let
165
		Out1_1 = pre_Out1_1;
166
	tel
167

  
168

  
128
	    else 0.0;
129
	_isEnabled_clock = _isEnabled;
130
	Out1_1 = (merge _isEnabled_clock 
131
		(true -> IfActionSubsystem3_29_278((In1_1 when _isEnabled_clock), (__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock))) 
132
		(false -> (pre_Out1_1) when false(_isEnabled_clock)));
169 133
tel
170 134

  
171 135
(*
172 136
Original block name: SwitchCase_PP/IfActionSubsystem3
173 137
*)
174
node  IfActionSubsystem3_74_022(In1_1 : real;
138
node  IfActionSubsystem3_29_278(In1_1 : real;
175 139
	__time_step : real;
176 140
	__nb_step : int;)
177 141
returns(Out1_1 : real;);
......
190 154
	Out3_1 : bool;
191 155
	Out4_1 : real;);
192 156
var Constant_1 : int;
193
	ExecutionCond_of_IfActionSubsystem_58_023 : bool;
157
	ExecutionCond_of_IfActionSubsystem_14_054 : bool;
194 158
	IfActionSubsystem_1 : bool;
195
	ExecutionCond_of_IfActionSubsystem1_63_030 : bool;
159
	ExecutionCond_of_IfActionSubsystem1_19_527 : bool;
196 160
	IfActionSubsystem1_1 : real;
197
	ExecutionCond_of_IfActionSubsystem2_68_023 : bool;
161
	ExecutionCond_of_IfActionSubsystem2_24_284 : bool;
198 162
	IfActionSubsystem2_1 : bool;
199
	ExecutionCond_of_IfActionSubsystem3_74_022 : bool;
163
	ExecutionCond_of_IfActionSubsystem3_29_278 : bool;
200 164
	IfActionSubsystem3_1 : real;
201 165
	MathFunction_1 : int;
202 166
	SwitchCase_1 : bool;
......
207 171
	__nb_step : int;
208 172
let
209 173
	Constant_1 = 6;
210
	ExecutionCond_of_IfActionSubsystem_58_023 = SwitchCase_1;
211
	IfActionSubsystem_1 = IfActionSubsystem_58_023_automaton(In7_1, ExecutionCond_of_IfActionSubsystem_58_023, __time_step, __nb_step);
212
	ExecutionCond_of_IfActionSubsystem1_63_030 = SwitchCase_4;
213
	IfActionSubsystem1_1 = IfActionSubsystem1_63_030_automaton(In2_1, ExecutionCond_of_IfActionSubsystem1_63_030, __time_step, __nb_step);
214
	ExecutionCond_of_IfActionSubsystem2_68_023 = SwitchCase_2;
215
	IfActionSubsystem2_1 = IfActionSubsystem2_68_023_automaton(In7_1, ExecutionCond_of_IfActionSubsystem2_68_023, __time_step, __nb_step);
216
	ExecutionCond_of_IfActionSubsystem3_74_022 = SwitchCase_3;
217
	IfActionSubsystem3_1 = IfActionSubsystem3_74_022_automaton(In2_1, ExecutionCond_of_IfActionSubsystem3_74_022, __time_step, __nb_step);
174
	ExecutionCond_of_IfActionSubsystem_14_054 = SwitchCase_1;
175
	IfActionSubsystem_1 = IfActionSubsystem_14_054_condExecSS(In7_1, ExecutionCond_of_IfActionSubsystem_14_054, __time_step, __nb_step);
176
	ExecutionCond_of_IfActionSubsystem1_19_527 = SwitchCase_4;
177
	IfActionSubsystem1_1 = IfActionSubsystem1_19_527_condExecSS(In2_1, ExecutionCond_of_IfActionSubsystem1_19_527, __time_step, __nb_step);
178
	ExecutionCond_of_IfActionSubsystem2_24_284 = SwitchCase_2;
179
	IfActionSubsystem2_1 = IfActionSubsystem2_24_284_condExecSS(In7_1, ExecutionCond_of_IfActionSubsystem2_24_284, __time_step, __nb_step);
180
	ExecutionCond_of_IfActionSubsystem3_29_278 = SwitchCase_3;
181
	IfActionSubsystem3_1 = IfActionSubsystem3_29_278_condExecSS(In2_1, ExecutionCond_of_IfActionSubsystem3_29_278, __time_step, __nb_step);
218 182
	MathFunction_1 = mod_int_int(In1_1, Constant_1);
219 183
	(SwitchCase_1, SwitchCase_2, SwitchCase_3, SwitchCase_4) = if MathFunction_1 = 1 then
220 184
		(true, false, false, false)
......
229 193
	Out15_1 = IfActionSubsystem_1;
230 194
	Out3_1 = IfActionSubsystem2_1;
231 195
	Out4_1 = IfActionSubsystem3_1;
232
	__time_step = (0.0 -> ((pre __time_step) + 0.020000000000000));
196
	__time_step = (0.0 -> ((pre __time_step) + 0.020));
233 197
	__nb_step = (0 -> ((pre __nb_step) + 1));
234 198
tel
235 199

  

Also available in: Unified diff