Project

General

Profile

Download (12.5 KB) Statistics
| Branch: | Tag: | Revision:
1
-- This file has been generated by CoCoSim2.
2

    
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 22:04:00
5
#open <conv>
6
node  abs_int(x : int;)
7
returns(y : int;);
8
let
9
	y = if (x >= 0) then
10
		x
11
	    else (- x);
12
tel
13

    
14
node  rem_int_int(x : int;
15
	y : int;)
16
returns(z : int;);
17
let
18
	z = if ((y = 0) or (x = 0)) then
19
		0
20
	    else ((x mod y) - (if (((x mod y) <> 0) and (x <= 0)) then abs_int(y) else 0));
21
tel
22

    
23
node  bool_to_int(x : bool;)
24
returns(y : int;);
25
let
26
	y = if x then
27
		1
28
	    else 0;
29
tel
30

    
31
node  int_to_int16(x : int;)
32
returns(y : int;);
33
let
34
	y = if (x > 32767) then
35
		(-32768 + rem_int_int(( x - 32767 - 1 ), 65536))
36
	    else if (x < -32768) then
37
		(32767 + rem_int_int(( x + 32768 + 1 ), 65536))
38
	    else x;
39
tel
40

    
41
node  int_to_uint16(x : int;)
42
returns(y : int;);
43
let
44
	y = if (x > 65535) then
45
		(0 + rem_int_int(( x - 65535 - 1 ), 65536))
46
	    else if (x < 0) then
47
		(65535 + rem_int_int(( x + 0 + 1 ), 65536))
48
	    else x;
49
tel
50

    
51
(*
52
Original block name: gain_test_ElementWise_PP/Gain10
53
*)
54
node  Gain10_99_005(u_1 : int;
55
	u_2 : int;
56
	__time_step : real;
57
	__nb_step : int;)
58
returns(Out1_1 : int;
59
	Out1_2 : int;);
60
var K_1 : int;
61
	K_2 : int;
62
	Product_1 : int;
63
	Product_2 : int;
64
let
65
	K_1 = 2;
66
	K_2 = 5;
67
	Product_1 = int_to_int16(1 * int_to_int16(u_1) * int_to_int16(K_1));
68
	Product_2 = int_to_int16(1 * int_to_int16(u_2) * int_to_int16(K_2));
69
	Out1_1 = Product_1;
70
	Out1_2 = Product_2;
71
tel
72

    
73
(*
74
Original block name: gain_test_ElementWise_PP/Gain11
75
*)
76
node  Gain11_100_005(u_1 : bool;
77
	u_2 : bool;
78
	__time_step : real;
79
	__nb_step : int;)
80
returns(Out1_1 : int;
81
	Out1_2 : int;);
82
var K_1 : bool;
83
	K_2 : bool;
84
	Product_1 : int;
85
	Product_2 : int;
86
let
87
	K_1 = true;
88
	K_2 = true;
89
	Product_1 = int_to_uint16(1 * bool_to_int(u_1) * bool_to_int(K_1));
90
	Product_2 = int_to_uint16(1 * bool_to_int(u_2) * bool_to_int(K_2));
91
	Out1_1 = Product_1;
92
	Out1_2 = Product_2;
93
tel
94

    
95
(*
96
Original block name: gain_test_ElementWise_PP/Gain12
97
*)
98
node  Gain12_101_007(u_1 : real;
99
	u_2 : real;
100
	u_3 : real;
101
	u_4 : real;
102
	__time_step : real;
103
	__nb_step : int;)
104
returns(Out1_1 : real;
105
	Out1_2 : real;
106
	Out1_3 : real;
107
	Out1_4 : real;);
108
var K_1 : real;
109
	K_2 : real;
110
	K_3 : real;
111
	K_4 : real;
112
	Product_1 : real;
113
	Product_2 : real;
114
	Product_3 : real;
115
	Product_4 : real;
116
let
117
	K_1 = 2.000000000000000;
118
	K_2 = 6.000000000000000;
119
	K_3 = 5.000000000000000;
120
	K_4 = 8.000000000000000;
121
	Product_1 = 1.0 * u_1 * K_1;
122
	Product_2 = 1.0 * u_2 * K_2;
123
	Product_3 = 1.0 * u_3 * K_3;
124
	Product_4 = 1.0 * u_4 * K_4;
125
	Out1_1 = Product_1;
126
	Out1_2 = Product_2;
127
	Out1_3 = Product_3;
128
	Out1_4 = Product_4;
129
tel
130

    
131
(*
132
Original block name: gain_test_ElementWise_PP/Gain13
133
*)
134
node  Gain13_102_005(u_1 : int;
135
	u_2 : int;
136
	u_3 : int;
137
	u_4 : int;
138
	__time_step : real;
139
	__nb_step : int;)
140
returns(Out1_1 : int;
141
	Out1_2 : int;
142
	Out1_3 : int;
143
	Out1_4 : int;);
144
var K_1 : int;
145
	K_2 : int;
146
	K_3 : int;
147
	K_4 : int;
148
	Product_1 : int;
149
	Product_2 : int;
150
	Product_3 : int;
151
	Product_4 : int;
152
let
153
	K_1 = 2;
154
	K_2 = 6;
155
	K_3 = 5;
156
	K_4 = 8;
157
	Product_1 = int_to_int16(1 * int_to_int16(u_1) * int_to_int16(K_1));
158
	Product_2 = int_to_int16(1 * int_to_int16(u_2) * int_to_int16(K_2));
159
	Product_3 = int_to_int16(1 * int_to_int16(u_3) * int_to_int16(K_3));
160
	Product_4 = int_to_int16(1 * int_to_int16(u_4) * int_to_int16(K_4));
161
	Out1_1 = Product_1;
162
	Out1_2 = Product_2;
163
	Out1_3 = Product_3;
164
	Out1_4 = Product_4;
165
tel
166

    
167
(*
168
Original block name: gain_test_ElementWise_PP/Gain14
169
*)
170
node  Gain14_103_005(u_1 : bool;
171
	u_2 : bool;
172
	u_3 : bool;
173
	u_4 : bool;
174
	u_5 : bool;
175
	u_6 : bool;
176
	__time_step : real;
177
	__nb_step : int;)
178
returns(Out1_1 : int;
179
	Out1_2 : int;
180
	Out1_3 : int;
181
	Out1_4 : int;
182
	Out1_5 : int;
183
	Out1_6 : int;);
184
var K_1 : bool;
185
	K_2 : bool;
186
	K_3 : bool;
187
	K_4 : bool;
188
	K_5 : bool;
189
	K_6 : bool;
190
	Product_1 : int;
191
	Product_2 : int;
192
	Product_3 : int;
193
	Product_4 : int;
194
	Product_5 : int;
195
	Product_6 : int;
196
let
197
	K_1 = true;
198
	K_2 = true;
199
	K_3 = true;
200
	K_4 = true;
201
	K_5 = true;
202
	K_6 = true;
203
	Product_1 = int_to_uint16(1 * bool_to_int(u_1) * bool_to_int(K_1));
204
	Product_2 = int_to_uint16(1 * bool_to_int(u_2) * bool_to_int(K_2));
205
	Product_3 = int_to_uint16(1 * bool_to_int(u_3) * bool_to_int(K_3));
206
	Product_4 = int_to_uint16(1 * bool_to_int(u_4) * bool_to_int(K_4));
207
	Product_5 = int_to_uint16(1 * bool_to_int(u_5) * bool_to_int(K_5));
208
	Product_6 = int_to_uint16(1 * bool_to_int(u_6) * bool_to_int(K_6));
209
	Out1_1 = Product_1;
210
	Out1_2 = Product_2;
211
	Out1_3 = Product_3;
212
	Out1_4 = Product_4;
213
	Out1_5 = Product_5;
214
	Out1_6 = Product_6;
215
tel
216

    
217
(*
218
Original block name: gain_test_ElementWise_PP/Gain3
219
*)
220
node  Gain3_105_005(u_1 : real;
221
	__time_step : real;
222
	__nb_step : int;)
223
returns(Out1_1 : real;
224
	Out1_2 : real;);
225
var K_1 : real;
226
	K_2 : real;
227
	Product_1 : real;
228
	Product_2 : real;
229
let
230
	K_1 = 2.000000000000000;
231
	K_2 = 5.000000000000000;
232
	Product_1 = 1.0 * u_1 * K_1;
233
	Product_2 = 1.0 * u_1 * K_2;
234
	Out1_1 = Product_1;
235
	Out1_2 = Product_2;
236
tel
237

    
238
(*
239
Original block name: gain_test_ElementWise_PP/Gain4
240
*)
241
node  Gain4_106_928(u_1 : int;
242
	__time_step : real;
243
	__nb_step : int;)
244
returns(Out1_1 : int;
245
	Out1_2 : int;);
246
var K_1 : int;
247
	K_2 : int;
248
	Product_1 : int;
249
	Product_2 : int;
250
let
251
	K_1 = 2;
252
	K_2 = 5;
253
	Product_1 = int_to_int16(1 * int_to_int16(u_1) * int_to_int16(K_1));
254
	Product_2 = int_to_int16(1 * int_to_int16(u_1) * int_to_int16(K_2));
255
	Out1_1 = Product_1;
256
	Out1_2 = Product_2;
257
tel
258

    
259
(*
260
Original block name: gain_test_ElementWise_PP/Gain5
261
*)
262
node  Gain5_107_006(u_1 : bool;
263
	__time_step : real;
264
	__nb_step : int;)
265
returns(Out1_1 : int;
266
	Out1_2 : int;);
267
var K_1 : bool;
268
	K_2 : bool;
269
	Product_1 : int;
270
	Product_2 : int;
271
let
272
	K_1 = true;
273
	K_2 = true;
274
	Product_1 = int_to_uint16(1 * bool_to_int(u_1) * bool_to_int(K_1));
275
	Product_2 = int_to_uint16(1 * bool_to_int(u_1) * bool_to_int(K_2));
276
	Out1_1 = Product_1;
277
	Out1_2 = Product_2;
278
tel
279

    
280
(*
281
Original block name: gain_test_ElementWise_PP/Gain6
282
*)
283
node  Gain6_108_005(u_1 : real;
284
	__time_step : real;
285
	__nb_step : int;)
286
returns(Out1_1 : real;
287
	Out1_2 : real;
288
	Out1_3 : real;
289
	Out1_4 : real;);
290
var K_1 : real;
291
	K_2 : real;
292
	K_3 : real;
293
	K_4 : real;
294
	Product_1 : real;
295
	Product_2 : real;
296
	Product_3 : real;
297
	Product_4 : real;
298
let
299
	K_1 = 2.000000000000000;
300
	K_2 = 6.000000000000000;
301
	K_3 = 5.000000000000000;
302
	K_4 = 8.000000000000000;
303
	Product_1 = 1.0 * u_1 * K_1;
304
	Product_2 = 1.0 * u_1 * K_2;
305
	Product_3 = 1.0 * u_1 * K_3;
306
	Product_4 = 1.0 * u_1 * K_4;
307
	Out1_1 = Product_1;
308
	Out1_2 = Product_2;
309
	Out1_3 = Product_3;
310
	Out1_4 = Product_4;
311
tel
312

    
313
(*
314
Original block name: gain_test_ElementWise_PP/Gain7
315
*)
316
node  Gain7_109_004(u_1 : int;
317
	__time_step : real;
318
	__nb_step : int;)
319
returns(Out1_1 : int;
320
	Out1_2 : int;
321
	Out1_3 : int;
322
	Out1_4 : int;);
323
var K_1 : int;
324
	K_2 : int;
325
	K_3 : int;
326
	K_4 : int;
327
	Product_1 : int;
328
	Product_2 : int;
329
	Product_3 : int;
330
	Product_4 : int;
331
let
332
	K_1 = 2;
333
	K_2 = 6;
334
	K_3 = 5;
335
	K_4 = 8;
336
	Product_1 = int_to_int16(1 * int_to_int16(u_1) * int_to_int16(K_1));
337
	Product_2 = int_to_int16(1 * int_to_int16(u_1) * int_to_int16(K_2));
338
	Product_3 = int_to_int16(1 * int_to_int16(u_1) * int_to_int16(K_3));
339
	Product_4 = int_to_int16(1 * int_to_int16(u_1) * int_to_int16(K_4));
340
	Out1_1 = Product_1;
341
	Out1_2 = Product_2;
342
	Out1_3 = Product_3;
343
	Out1_4 = Product_4;
344
tel
345

    
346
(*
347
Original block name: gain_test_ElementWise_PP/Gain8
348
*)
349
node  Gain8_110_005(u_1 : bool;
350
	__time_step : real;
351
	__nb_step : int;)
352
returns(Out1_1 : int;
353
	Out1_2 : int;
354
	Out1_3 : int;
355
	Out1_4 : int;
356
	Out1_5 : int;
357
	Out1_6 : int;);
358
var K_1 : bool;
359
	K_2 : bool;
360
	K_3 : bool;
361
	K_4 : bool;
362
	K_5 : bool;
363
	K_6 : bool;
364
	Product_1 : int;
365
	Product_2 : int;
366
	Product_3 : int;
367
	Product_4 : int;
368
	Product_5 : int;
369
	Product_6 : int;
370
let
371
	K_1 = true;
372
	K_2 = true;
373
	K_3 = true;
374
	K_4 = true;
375
	K_5 = true;
376
	K_6 = true;
377
	Product_1 = int_to_uint16(1 * bool_to_int(u_1) * bool_to_int(K_1));
378
	Product_2 = int_to_uint16(1 * bool_to_int(u_1) * bool_to_int(K_2));
379
	Product_3 = int_to_uint16(1 * bool_to_int(u_1) * bool_to_int(K_3));
380
	Product_4 = int_to_uint16(1 * bool_to_int(u_1) * bool_to_int(K_4));
381
	Product_5 = int_to_uint16(1 * bool_to_int(u_1) * bool_to_int(K_5));
382
	Product_6 = int_to_uint16(1 * bool_to_int(u_1) * bool_to_int(K_6));
383
	Out1_1 = Product_1;
384
	Out1_2 = Product_2;
385
	Out1_3 = Product_3;
386
	Out1_4 = Product_4;
387
	Out1_5 = Product_5;
388
	Out1_6 = Product_6;
389
tel
390

    
391
(*
392
Original block name: gain_test_ElementWise_PP/Gain9
393
*)
394
node  Gain9_111_005(u_1 : real;
395
	u_2 : real;
396
	__time_step : real;
397
	__nb_step : int;)
398
returns(Out1_1 : real;
399
	Out1_2 : real;);
400
var K_1 : real;
401
	K_2 : real;
402
	Product_1 : real;
403
	Product_2 : real;
404
let
405
	K_1 = 2.000000000000000;
406
	K_2 = 5.000000000000000;
407
	Product_1 = 1.0 * u_1 * K_1;
408
	Product_2 = 1.0 * u_2 * K_2;
409
	Out1_1 = Product_1;
410
	Out1_2 = Product_2;
411
tel
412

    
413
(*
414
Original block name: gain_test_ElementWise_PP
415
*)
416
node  gain_test_ElementWise_PP(In1_1 : real;
417
	In2_1 : int;
418
	In3_1 : bool;
419
	In4_1 : real;
420
	In5_1 : int;
421
	In6_1 : bool;
422
	In10_1 : real;
423
	In10_2 : real;
424
	In11_1 : int;
425
	In11_2 : int;
426
	In12_1 : bool;
427
	In12_2 : bool;
428
	In7_1 : real;
429
	In8_1 : int;
430
	In9_1 : bool;
431
	In13_1 : real;
432
	In13_2 : real;
433
	In13_3 : real;
434
	In13_4 : real;
435
	In14_1 : int;
436
	In14_2 : int;
437
	In14_3 : int;
438
	In14_4 : int;
439
	In15_1 : bool;
440
	In15_2 : bool;
441
	In15_3 : bool;
442
	In15_4 : bool;
443
	In15_5 : bool;
444
	In15_6 : bool;)
445
returns(Out1_1 : real;
446
	Out2_1 : real;
447
	Out3_1 : real;
448
	Out4_1 : real;
449
	Out4_2 : real;
450
	Out5_1 : int;
451
	Out5_2 : int;
452
	Out6_1 : int;
453
	Out6_2 : int;
454
	Out10_1 : real;
455
	Out10_2 : real;
456
	Out11_1 : int;
457
	Out11_2 : int;
458
	Out12_1 : int;
459
	Out12_2 : int;
460
	Out7_1 : real;
461
	Out7_2 : real;
462
	Out7_3 : real;
463
	Out7_4 : real;
464
	Out8_1 : int;
465
	Out8_2 : int;
466
	Out8_3 : int;
467
	Out8_4 : int;
468
	Out9_1 : int;
469
	Out9_2 : int;
470
	Out9_3 : int;
471
	Out9_4 : int;
472
	Out9_5 : int;
473
	Out9_6 : int;
474
	Out13_1 : real;
475
	Out13_2 : real;
476
	Out13_3 : real;
477
	Out13_4 : real;
478
	Out14_1 : int;
479
	Out14_2 : int;
480
	Out14_3 : int;
481
	Out14_4 : int;
482
	Out15_1 : int;
483
	Out15_2 : int;
484
	Out15_3 : int;
485
	Out15_4 : int;
486
	Out15_5 : int;
487
	Out15_6 : int;);
488
var Gain_1 : real;
489
	Gain1_1 : real;
490
	Gain10_1 : int;
491
	Gain10_2 : int;
492
	Gain11_1 : int;
493
	Gain11_2 : int;
494
	Gain12_1 : real;
495
	Gain12_2 : real;
496
	Gain12_3 : real;
497
	Gain12_4 : real;
498
	Gain13_1 : int;
499
	Gain13_2 : int;
500
	Gain13_3 : int;
501
	Gain13_4 : int;
502
	Gain14_1 : int;
503
	Gain14_2 : int;
504
	Gain14_3 : int;
505
	Gain14_4 : int;
506
	Gain14_5 : int;
507
	Gain14_6 : int;
508
	Gain2_1 : real;
509
	Gain3_1 : real;
510
	Gain3_2 : real;
511
	Gain4_1 : int;
512
	Gain4_2 : int;
513
	Gain5_1 : int;
514
	Gain5_2 : int;
515
	Gain6_1 : real;
516
	Gain6_2 : real;
517
	Gain6_3 : real;
518
	Gain6_4 : real;
519
	Gain7_1 : int;
520
	Gain7_2 : int;
521
	Gain7_3 : int;
522
	Gain7_4 : int;
523
	Gain8_1 : int;
524
	Gain8_2 : int;
525
	Gain8_3 : int;
526
	Gain8_4 : int;
527
	Gain8_5 : int;
528
	Gain8_6 : int;
529
	Gain9_1 : real;
530
	Gain9_2 : real;
531
	__time_step : real;
532
	__nb_step : int;
533
let
534
	Gain_1 = (In1_1 * 1.000000000000000);
535
	Gain1_1 = (int_to_real(In2_1) * 1.000000000000000);
536
	(Gain10_1, Gain10_2) = Gain10_99_005(In11_1, In11_2, __time_step, __nb_step);
537
	(Gain11_1, Gain11_2) = Gain11_100_005(In12_1, In12_2, __time_step, __nb_step);
538
	(Gain12_1, Gain12_2, Gain12_3, Gain12_4) = Gain12_101_007(In13_1, In13_2, In13_3, In13_4, __time_step, __nb_step);
539
	(Gain13_1, Gain13_2, Gain13_3, Gain13_4) = Gain13_102_005(In14_1, In14_2, In14_3, In14_4, __time_step, __nb_step);
540
	(Gain14_1, Gain14_2, Gain14_3, Gain14_4, Gain14_5, Gain14_6) = Gain14_103_005(In15_1, In15_2, In15_3, In15_4, In15_5, In15_6, __time_step, __nb_step);
541
	Gain2_1 = if In3_1 then
542
		1.000000000000000
543
	    else 0.0;
544
	(Gain3_1, Gain3_2) = Gain3_105_005(In4_1, __time_step, __nb_step);
545
	(Gain4_1, Gain4_2) = Gain4_106_928(In5_1, __time_step, __nb_step);
546
	(Gain5_1, Gain5_2) = Gain5_107_006(In6_1, __time_step, __nb_step);
547
	(Gain6_1, Gain6_2, Gain6_3, Gain6_4) = Gain6_108_005(In7_1, __time_step, __nb_step);
548
	(Gain7_1, Gain7_2, Gain7_3, Gain7_4) = Gain7_109_004(In8_1, __time_step, __nb_step);
549
	(Gain8_1, Gain8_2, Gain8_3, Gain8_4, Gain8_5, Gain8_6) = Gain8_110_005(In9_1, __time_step, __nb_step);
550
	(Gain9_1, Gain9_2) = Gain9_111_005(In10_1, In10_2, __time_step, __nb_step);
551
	Out1_1 = Gain_1;
552
	Out2_1 = Gain1_1;
553
	Out3_1 = Gain2_1;
554
	Out4_1 = Gain3_1;
555
	Out4_2 = Gain3_2;
556
	Out5_1 = Gain4_1;
557
	Out5_2 = Gain4_2;
558
	Out6_1 = Gain5_1;
559
	Out6_2 = Gain5_2;
560
	Out10_1 = Gain9_1;
561
	Out10_2 = Gain9_2;
562
	Out11_1 = Gain10_1;
563
	Out11_2 = Gain10_2;
564
	Out12_1 = Gain11_1;
565
	Out12_2 = Gain11_2;
566
	Out7_1 = Gain6_1;
567
	Out7_2 = Gain6_2;
568
	Out7_3 = Gain6_3;
569
	Out7_4 = Gain6_4;
570
	Out8_1 = Gain7_1;
571
	Out8_2 = Gain7_2;
572
	Out8_3 = Gain7_3;
573
	Out8_4 = Gain7_4;
574
	Out9_1 = Gain8_1;
575
	Out9_2 = Gain8_2;
576
	Out9_3 = Gain8_3;
577
	Out9_4 = Gain8_4;
578
	Out9_5 = Gain8_5;
579
	Out9_6 = Gain8_6;
580
	Out13_1 = Gain12_1;
581
	Out13_2 = Gain12_2;
582
	Out13_3 = Gain12_3;
583
	Out13_4 = Gain12_4;
584
	Out14_1 = Gain13_1;
585
	Out14_2 = Gain13_2;
586
	Out14_3 = Gain13_3;
587
	Out14_4 = Gain13_4;
588
	Out15_1 = Gain14_1;
589
	Out15_2 = Gain14_2;
590
	Out15_3 = Gain14_3;
591
	Out15_4 = Gain14_4;
592
	Out15_5 = Gain14_5;
593
	Out15_6 = Gain14_6;
594
	__time_step = (0.0 -> ((pre __time_step) + 0.100000000000000));
595
	__nb_step = (0 -> ((pre __nb_step) + 1));
596
tel
597

    
(1064-1064/1153)