Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Simulink / src_many_files / Assignment2_PP.LUSTREC.lus @ cd1faebc

History | View | Annotate | Download (9.63 KB)

1 4748b215 hbourbou
-- This file has been generated by CoCoSim2.
2
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 22:17:18
5
#open <conv>
6
node  _max_real(x : real;
7
	y : real;)
8
returns(z : real;);
9
let
10
	z = if (x > y) then
11
		x
12
	    else y;
13
tel
14
15
node  _min_real(x : real;
16
	y : real;)
17
returns(z : real;);
18
let
19
	z = if (x < y) then
20
		x
21
	    else y;
22
tel
23
24
(*
25
Original block name: Assignment2_PP/Saturation
26
*)
27
node  Saturation_36_044(In_1 : real;
28
	In_2 : real;
29
	__time_step : real;
30
	__nb_step : int;)
31
returns(Out_1 : real;
32
	Out_2 : real;);
33
var lower_1 : real;
34
	lower_2 : real;
35
	lower_limit_1 : real;
36
	upper_1 : real;
37
	upper_2 : real;
38
	upper_limit_1 : real;
39
let
40
	lower_1 = _max_real(upper_1, lower_limit_1);
41
	lower_2 = _max_real(upper_2, lower_limit_1);
42
	lower_limit_1 = 1.000000000000000;
43
	upper_1 = _min_real(upper_limit_1, In_1);
44
	upper_2 = _min_real(upper_limit_1, In_2);
45
	upper_limit_1 = 3.000000000000000;
46
	Out_1 = lower_1;
47
	Out_2 = lower_2;
48
tel
49
50
(*
51
Original block name: Assignment2_PP
52
*)
53
node  Assignment2_PP(In1_1 : real;
54
	In1_2 : real;
55
	In2_1 : real;
56
	In2_2 : real;
57
	In2_3 : real;
58
	In2_4 : real;
59
	In2_5 : real;
60
	In2_6 : real;
61
	In2_7 : real;
62
	In2_8 : real;
63
	In2_9 : real;
64
	In2_10 : real;
65
	In2_11 : real;
66
	In2_12 : real;
67
	In3_1 : real;
68
	In3_2 : real;
69
	In3_3 : real;
70
	In3_4 : real;
71
	In3_5 : real;
72
	In3_6 : real;)
73
returns(Out3_1 : real;
74
	Out3_2 : real;
75
	Out3_3 : real;
76
	Out3_4 : real;
77
	Out3_5 : real;
78
	Out3_6 : real;
79
	Out3_7 : real;
80
	Out3_8 : real;
81
	Out3_9 : real;
82
	Out3_10 : real;
83
	Out3_11 : real;
84
	Out3_12 : real;);
85
var Assignment2_32_463_U_index_1 : int;
86
	Assignment2_32_463_U_index_2 : int;
87
	Assignment2_32_463_U_index_3 : int;
88
	Assignment2_32_463_U_index_4 : int;
89
	Assignment2_32_463_U_index_5 : int;
90
	Assignment2_32_463_U_index_6 : int;
91
	Assignment2_32_463_ind_dim_1_1 : int;
92
	Assignment2_32_463_ind_dim_1_2 : int;
93
	Assignment2_32_463_ind_dim_1_3 : int;
94
	Assignment2_32_463_ind_dim_2_1 : int;
95
	Assignment2_32_463_ind_dim_2_2 : int;
96
	Assignment2_32_463_str_Y_index_1_1 : int;
97
	Assignment2_32_463_str_Y_index_1_2 : int;
98
	Assignment2_32_463_str_Y_index_2_1 : int;
99
	Assignment2_32_463_str_Y_index_2_2 : int;
100
	Assignment2_32_463_str_Y_index_3_1 : int;
101
	Assignment2_32_463_str_Y_index_3_2 : int;
102
	Assignment2_32_463_str_Y_index_4_1 : int;
103
	Assignment2_32_463_str_Y_index_4_2 : int;
104
	Assignment2_32_463_str_Y_index_5_1 : int;
105
	Assignment2_32_463_str_Y_index_5_2 : int;
106
	Assignment2_32_463_str_Y_index_6_1 : int;
107
	Assignment2_32_463_str_Y_index_6_2 : int;
108
	Assignment2_1 : real;
109
	Assignment2_2 : real;
110
	Assignment2_3 : real;
111
	Assignment2_4 : real;
112
	Assignment2_5 : real;
113
	Assignment2_6 : real;
114
	Assignment2_7 : real;
115
	Assignment2_8 : real;
116
	Assignment2_9 : real;
117
	Assignment2_10 : real;
118
	Assignment2_11 : real;
119
	Assignment2_12 : real;
120
	Saturation_1 : real;
121
	Saturation_2 : real;
122
	__time_step : real;
123
	__nb_step : int;
124
let
125
	Assignment2_32_463_ind_dim_1_1 = 1;
126
	Assignment2_32_463_ind_dim_1_2 = 2;
127
	Assignment2_32_463_ind_dim_1_3 = 3;
128
	Assignment2_32_463_ind_dim_2_1 = real_to_int(Saturation_1);
129
	Assignment2_32_463_ind_dim_2_2 = real_to_int(Saturation_2);
130
	Assignment2_32_463_str_Y_index_1_1 = Assignment2_32_463_ind_dim_1_1;
131
	Assignment2_32_463_str_Y_index_1_2 = Assignment2_32_463_ind_dim_2_1;
132
	Assignment2_32_463_U_index_1 = ( (Assignment2_32_463_str_Y_index_1_1 * 1) + ((Assignment2_32_463_str_Y_index_1_2 - 1) * 3) );
133
	Assignment2_32_463_str_Y_index_2_1 = Assignment2_32_463_ind_dim_1_2;
134
	Assignment2_32_463_str_Y_index_2_2 = Assignment2_32_463_ind_dim_2_1;
135
	Assignment2_32_463_U_index_2 = ( (Assignment2_32_463_str_Y_index_2_1 * 1) + ((Assignment2_32_463_str_Y_index_2_2 - 1) * 3) );
136
	Assignment2_32_463_str_Y_index_3_1 = Assignment2_32_463_ind_dim_1_3;
137
	Assignment2_32_463_str_Y_index_3_2 = Assignment2_32_463_ind_dim_2_1;
138
	Assignment2_32_463_U_index_3 = ( (Assignment2_32_463_str_Y_index_3_1 * 1) + ((Assignment2_32_463_str_Y_index_3_2 - 1) * 3) );
139
	Assignment2_32_463_str_Y_index_4_1 = Assignment2_32_463_ind_dim_1_1;
140
	Assignment2_32_463_str_Y_index_4_2 = Assignment2_32_463_ind_dim_2_2;
141
	Assignment2_32_463_U_index_4 = ( (Assignment2_32_463_str_Y_index_4_1 * 1) + ((Assignment2_32_463_str_Y_index_4_2 - 1) * 3) );
142
	Assignment2_32_463_str_Y_index_5_1 = Assignment2_32_463_ind_dim_1_2;
143
	Assignment2_32_463_str_Y_index_5_2 = Assignment2_32_463_ind_dim_2_2;
144
	Assignment2_32_463_U_index_5 = ( (Assignment2_32_463_str_Y_index_5_1 * 1) + ((Assignment2_32_463_str_Y_index_5_2 - 1) * 3) );
145
	Assignment2_32_463_str_Y_index_6_1 = Assignment2_32_463_ind_dim_1_3;
146
	Assignment2_32_463_str_Y_index_6_2 = Assignment2_32_463_ind_dim_2_2;
147
	Assignment2_32_463_U_index_6 = ( (Assignment2_32_463_str_Y_index_6_1 * 1) + ((Assignment2_32_463_str_Y_index_6_2 - 1) * 3) );
148
	Assignment2_1 = if (Assignment2_32_463_U_index_6 = 1) then
149
		In3_6
150
	    else if (Assignment2_32_463_U_index_5 = 1) then
151
		In3_5
152
	    else if (Assignment2_32_463_U_index_4 = 1) then
153
		In3_4
154
	    else if (Assignment2_32_463_U_index_3 = 1) then
155
		In3_3
156
	    else if (Assignment2_32_463_U_index_2 = 1) then
157
		In3_2
158
	    else if (Assignment2_32_463_U_index_1 = 1) then
159
		In3_1
160
	    else In2_1;
161
	Assignment2_2 = if (Assignment2_32_463_U_index_6 = 2) then
162
		In3_6
163
	    else if (Assignment2_32_463_U_index_5 = 2) then
164
		In3_5
165
	    else if (Assignment2_32_463_U_index_4 = 2) then
166
		In3_4
167
	    else if (Assignment2_32_463_U_index_3 = 2) then
168
		In3_3
169
	    else if (Assignment2_32_463_U_index_2 = 2) then
170
		In3_2
171
	    else if (Assignment2_32_463_U_index_1 = 2) then
172
		In3_1
173
	    else In2_2;
174
	Assignment2_3 = if (Assignment2_32_463_U_index_6 = 3) then
175
		In3_6
176
	    else if (Assignment2_32_463_U_index_5 = 3) then
177
		In3_5
178
	    else if (Assignment2_32_463_U_index_4 = 3) then
179
		In3_4
180
	    else if (Assignment2_32_463_U_index_3 = 3) then
181
		In3_3
182
	    else if (Assignment2_32_463_U_index_2 = 3) then
183
		In3_2
184
	    else if (Assignment2_32_463_U_index_1 = 3) then
185
		In3_1
186
	    else In2_3;
187
	Assignment2_4 = if (Assignment2_32_463_U_index_6 = 4) then
188
		In3_6
189
	    else if (Assignment2_32_463_U_index_5 = 4) then
190
		In3_5
191
	    else if (Assignment2_32_463_U_index_4 = 4) then
192
		In3_4
193
	    else if (Assignment2_32_463_U_index_3 = 4) then
194
		In3_3
195
	    else if (Assignment2_32_463_U_index_2 = 4) then
196
		In3_2
197
	    else if (Assignment2_32_463_U_index_1 = 4) then
198
		In3_1
199
	    else In2_4;
200
	Assignment2_5 = if (Assignment2_32_463_U_index_6 = 5) then
201
		In3_6
202
	    else if (Assignment2_32_463_U_index_5 = 5) then
203
		In3_5
204
	    else if (Assignment2_32_463_U_index_4 = 5) then
205
		In3_4
206
	    else if (Assignment2_32_463_U_index_3 = 5) then
207
		In3_3
208
	    else if (Assignment2_32_463_U_index_2 = 5) then
209
		In3_2
210
	    else if (Assignment2_32_463_U_index_1 = 5) then
211
		In3_1
212
	    else In2_5;
213
	Assignment2_6 = if (Assignment2_32_463_U_index_6 = 6) then
214
		In3_6
215
	    else if (Assignment2_32_463_U_index_5 = 6) then
216
		In3_5
217
	    else if (Assignment2_32_463_U_index_4 = 6) then
218
		In3_4
219
	    else if (Assignment2_32_463_U_index_3 = 6) then
220
		In3_3
221
	    else if (Assignment2_32_463_U_index_2 = 6) then
222
		In3_2
223
	    else if (Assignment2_32_463_U_index_1 = 6) then
224
		In3_1
225
	    else In2_6;
226
	Assignment2_7 = if (Assignment2_32_463_U_index_6 = 7) then
227
		In3_6
228
	    else if (Assignment2_32_463_U_index_5 = 7) then
229
		In3_5
230
	    else if (Assignment2_32_463_U_index_4 = 7) then
231
		In3_4
232
	    else if (Assignment2_32_463_U_index_3 = 7) then
233
		In3_3
234
	    else if (Assignment2_32_463_U_index_2 = 7) then
235
		In3_2
236
	    else if (Assignment2_32_463_U_index_1 = 7) then
237
		In3_1
238
	    else In2_7;
239
	Assignment2_8 = if (Assignment2_32_463_U_index_6 = 8) then
240
		In3_6
241
	    else if (Assignment2_32_463_U_index_5 = 8) then
242
		In3_5
243
	    else if (Assignment2_32_463_U_index_4 = 8) then
244
		In3_4
245
	    else if (Assignment2_32_463_U_index_3 = 8) then
246
		In3_3
247
	    else if (Assignment2_32_463_U_index_2 = 8) then
248
		In3_2
249
	    else if (Assignment2_32_463_U_index_1 = 8) then
250
		In3_1
251
	    else In2_8;
252
	Assignment2_9 = if (Assignment2_32_463_U_index_6 = 9) then
253
		In3_6
254
	    else if (Assignment2_32_463_U_index_5 = 9) then
255
		In3_5
256
	    else if (Assignment2_32_463_U_index_4 = 9) then
257
		In3_4
258
	    else if (Assignment2_32_463_U_index_3 = 9) then
259
		In3_3
260
	    else if (Assignment2_32_463_U_index_2 = 9) then
261
		In3_2
262
	    else if (Assignment2_32_463_U_index_1 = 9) then
263
		In3_1
264
	    else In2_9;
265
	Assignment2_10 = if (Assignment2_32_463_U_index_6 = 10) then
266
		In3_6
267
	    else if (Assignment2_32_463_U_index_5 = 10) then
268
		In3_5
269
	    else if (Assignment2_32_463_U_index_4 = 10) then
270
		In3_4
271
	    else if (Assignment2_32_463_U_index_3 = 10) then
272
		In3_3
273
	    else if (Assignment2_32_463_U_index_2 = 10) then
274
		In3_2
275
	    else if (Assignment2_32_463_U_index_1 = 10) then
276
		In3_1
277
	    else In2_10;
278
	Assignment2_11 = if (Assignment2_32_463_U_index_6 = 11) then
279
		In3_6
280
	    else if (Assignment2_32_463_U_index_5 = 11) then
281
		In3_5
282
	    else if (Assignment2_32_463_U_index_4 = 11) then
283
		In3_4
284
	    else if (Assignment2_32_463_U_index_3 = 11) then
285
		In3_3
286
	    else if (Assignment2_32_463_U_index_2 = 11) then
287
		In3_2
288
	    else if (Assignment2_32_463_U_index_1 = 11) then
289
		In3_1
290
	    else In2_11;
291
	Assignment2_12 = if (Assignment2_32_463_U_index_6 = 12) then
292
		In3_6
293
	    else if (Assignment2_32_463_U_index_5 = 12) then
294
		In3_5
295
	    else if (Assignment2_32_463_U_index_4 = 12) then
296
		In3_4
297
	    else if (Assignment2_32_463_U_index_3 = 12) then
298
		In3_3
299
	    else if (Assignment2_32_463_U_index_2 = 12) then
300
		In3_2
301
	    else if (Assignment2_32_463_U_index_1 = 12) then
302
		In3_1
303
	    else In2_12;
304
	(Saturation_1, Saturation_2) = Saturation_36_044(In1_1, In1_2, __time_step, __nb_step);
305
	Out3_1 = Assignment2_1;
306
	Out3_2 = Assignment2_2;
307
	Out3_3 = Assignment2_3;
308
	Out3_4 = Assignment2_4;
309
	Out3_5 = Assignment2_5;
310
	Out3_6 = Assignment2_6;
311
	Out3_7 = Assignment2_7;
312
	Out3_8 = Assignment2_8;
313
	Out3_9 = Assignment2_9;
314
	Out3_10 = Assignment2_10;
315
	Out3_11 = Assignment2_11;
316
	Out3_12 = Assignment2_12;
317
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
318
	__nb_step = (0 -> ((pre __nb_step) + 1));
319
tel