Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (1.42 KB)

1
-- This file has been generated by CoCoSim2.
2

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

    
16
node  _min_int(x : int;
17
	y : int;)
18
returns(z : int;);
19
let
20
	z = if (x < y) then
21
		x
22
	    else y;
23
tel
24

    
25

    
26
(*
27
Original block name: math_int_2_test_PP/Saturation
28
*)
29
node  Saturation_29_013(In_1 : int;
30
	__time_step : real;
31
	__nb_step : int;)
32
returns(Out_1 : int;);
33
var lower_1 : int;
34
	lower_limit_1 : int;
35
	upper_1 : int;
36
	upper_limit_1 : int;
37
let
38
	lower_1 = _max_int(upper_1, lower_limit_1);
39
	lower_limit_1 = 1;
40
	upper_1 = _min_int(upper_limit_1, In_1);
41
	upper_limit_1 = 100;
42
	Out_1 = lower_1;
43
tel
44

    
45
(*
46
Original block name: math_int_2_test_PP
47
*)
48
node  math_int_2_test_PP(In6_1 : int;
49
	In7_1 : int;
50
	In11_1 : int;)
51
returns(Out6_1 : int;
52
	Out7_1 : int;
53
	Out10_1 : int;);
54
var MathFunction5_1 : int;
55
	MathFunction6_1 : int;
56
	MathFunction9_1 : int;
57
	Saturation_1 : int;
58
	__time_step : real;
59
	__nb_step : int;
60
let
61
	MathFunction5_1 = (In6_1 * In6_1);
62
	MathFunction6_1 = real_to_int(sqrt(int_to_real(In7_1)));
63
	MathFunction9_1 = (1 / Saturation_1);
64
	Saturation_1 = Saturation_29_013(In11_1, __time_step, __nb_step);
65
	Out6_1 = MathFunction5_1;
66
	Out7_1 = MathFunction6_1;
67
	Out10_1 = MathFunction9_1;
68
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
69
	__nb_step = (0 -> ((pre __nb_step) + 1));
70
tel
71