Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (10.5 KB)

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

    
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 22:46:03
5
node  abs_real(x : real;)
6
returns(y : real;);
7
let
8
	y = if (x >= 0.0) then
9
		x
10
	    else (- x);
11
tel
12

    
13
(*
14
external node code for doing Lookup_nD
15
*)
16
node  LookupTableDynamic_64_294_ext_node(In1_1 : real;
17
	Constant1_1 : real;
18
	Constant1_2 : real;
19
	Constant1_3 : real;
20
	Constant1_4 : real;
21
	Constant1_5 : real;
22
	Constant1_6 : real;
23
	In2_1 : real;
24
	In2_2 : real;
25
	In2_3 : real;
26
	In2_4 : real;
27
	In2_5 : real;
28
	In2_6 : real;)
29
returns(LookupTableDynamic_1 : real;);
30
var LookupTableDynamic_64_294_table_elem_1 : real;
31
	LookupTableDynamic_64_294_table_elem_2 : real;
32
	LookupTableDynamic_64_294_table_elem_3 : real;
33
	LookupTableDynamic_64_294_table_elem_4 : real;
34
	LookupTableDynamic_64_294_table_elem_5 : real;
35
	LookupTableDynamic_64_294_table_elem_6 : real;
36
	LookupTableDynamic_64_294_Breakpoints_dim1_1 : real;
37
	LookupTableDynamic_64_294_Breakpoints_dim1_2 : real;
38
	LookupTableDynamic_64_294_Breakpoints_dim1_3 : real;
39
	LookupTableDynamic_64_294_Breakpoints_dim1_4 : real;
40
	LookupTableDynamic_64_294_Breakpoints_dim1_5 : real;
41
	LookupTableDynamic_64_294_Breakpoints_dim1_6 : real;
42
	LookupTableDynamic_64_294_dimJump_1 : int;
43
	LookupTableDynamic_64_294_index_dim_1_1 : int;
44
	LookupTableDynamic_64_294_index_dim_1_2 : int;
45
	LookupTableDynamic_64_294_coords_dim_1_1 : real;
46
	LookupTableDynamic_64_294_coords_dim_1_2 : real;
47
	LookupTableDynamic_64_294_u_node_1 : real;
48
	LookupTableDynamic_64_294_N_shape_1 : real;
49
	LookupTableDynamic_64_294_u_node_2 : real;
50
	LookupTableDynamic_64_294_N_shape_2 : real;
51
	LookupTableDynamic_64_294_bound_node_index_1 : int;
52
	LookupTableDynamic_64_294_bound_node_index_2 : int;
53
	LookupTableDynamic_64_294_clip_input_1 : real;
54
let
55
	LookupTableDynamic_64_294_table_elem_1 = In2_1;
56
	LookupTableDynamic_64_294_table_elem_2 = In2_2;
57
	LookupTableDynamic_64_294_table_elem_3 = In2_3;
58
	LookupTableDynamic_64_294_table_elem_4 = In2_4;
59
	LookupTableDynamic_64_294_table_elem_5 = In2_5;
60
	LookupTableDynamic_64_294_table_elem_6 = In2_6;
61
	LookupTableDynamic_64_294_Breakpoints_dim1_1 = Constant1_1;
62
	LookupTableDynamic_64_294_Breakpoints_dim1_2 = Constant1_2;
63
	LookupTableDynamic_64_294_Breakpoints_dim1_3 = Constant1_3;
64
	LookupTableDynamic_64_294_Breakpoints_dim1_4 = Constant1_4;
65
	LookupTableDynamic_64_294_Breakpoints_dim1_5 = Constant1_5;
66
	LookupTableDynamic_64_294_Breakpoints_dim1_6 = Constant1_6;
67
	LookupTableDynamic_64_294_dimJump_1 = 1;
68
	LookupTableDynamic_64_294_index_dim_1_1 = if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_6) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
69
		5
70
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_5) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
71
		5
72
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_4) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
73
		4
74
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_3) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
75
		3
76
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_2) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
77
		2
78
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_1) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
79
		1
80
	    else 1;
81
	LookupTableDynamic_64_294_coords_dim_1_1 = if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_6) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
82
		LookupTableDynamic_64_294_Breakpoints_dim1_5
83
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_5) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
84
		LookupTableDynamic_64_294_Breakpoints_dim1_5
85
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_4) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
86
		LookupTableDynamic_64_294_Breakpoints_dim1_4
87
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_3) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
88
		LookupTableDynamic_64_294_Breakpoints_dim1_3
89
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_2) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
90
		LookupTableDynamic_64_294_Breakpoints_dim1_2
91
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_1) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
92
		LookupTableDynamic_64_294_Breakpoints_dim1_1
93
	    else LookupTableDynamic_64_294_Breakpoints_dim1_1;
94
	LookupTableDynamic_64_294_index_dim_1_2 = if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_6) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
95
		6
96
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_5) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
97
		6
98
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_4) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
99
		5
100
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_3) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
101
		4
102
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_2) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
103
		3
104
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_1) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
105
		2
106
	    else 2;
107
	LookupTableDynamic_64_294_coords_dim_1_2 = if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_6) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
108
		LookupTableDynamic_64_294_Breakpoints_dim1_6
109
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_5) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
110
		LookupTableDynamic_64_294_Breakpoints_dim1_6
111
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_4) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
112
		LookupTableDynamic_64_294_Breakpoints_dim1_5
113
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_3) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
114
		LookupTableDynamic_64_294_Breakpoints_dim1_4
115
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_2) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
116
		LookupTableDynamic_64_294_Breakpoints_dim1_3
117
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_1) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
118
		LookupTableDynamic_64_294_Breakpoints_dim1_2
119
	    else LookupTableDynamic_64_294_Breakpoints_dim1_2;
120
	LookupTableDynamic_64_294_bound_node_index_1 = (LookupTableDynamic_64_294_index_dim_1_1 * 1);
121
	LookupTableDynamic_64_294_u_node_1 = if (LookupTableDynamic_64_294_bound_node_index_1 = 1) then
122
		LookupTableDynamic_64_294_table_elem_1
123
	    else if (LookupTableDynamic_64_294_bound_node_index_1 = 2) then
124
		LookupTableDynamic_64_294_table_elem_2
125
	    else if (LookupTableDynamic_64_294_bound_node_index_1 = 3) then
126
		LookupTableDynamic_64_294_table_elem_3
127
	    else if (LookupTableDynamic_64_294_bound_node_index_1 = 4) then
128
		LookupTableDynamic_64_294_table_elem_4
129
	    else if (LookupTableDynamic_64_294_bound_node_index_1 = 5) then
130
		LookupTableDynamic_64_294_table_elem_5
131
	    else LookupTableDynamic_64_294_table_elem_6;
132
	LookupTableDynamic_64_294_bound_node_index_2 = (LookupTableDynamic_64_294_index_dim_1_2 * 1);
133
	LookupTableDynamic_64_294_u_node_2 = if (LookupTableDynamic_64_294_bound_node_index_2 = 1) then
134
		LookupTableDynamic_64_294_table_elem_1
135
	    else if (LookupTableDynamic_64_294_bound_node_index_2 = 2) then
136
		LookupTableDynamic_64_294_table_elem_2
137
	    else if (LookupTableDynamic_64_294_bound_node_index_2 = 3) then
138
		LookupTableDynamic_64_294_table_elem_3
139
	    else if (LookupTableDynamic_64_294_bound_node_index_2 = 4) then
140
		LookupTableDynamic_64_294_table_elem_4
141
	    else if (LookupTableDynamic_64_294_bound_node_index_2 = 5) then
142
		LookupTableDynamic_64_294_table_elem_5
143
	    else LookupTableDynamic_64_294_table_elem_6;
144
	LookupTableDynamic_64_294_clip_input_1 = In1_1;
145
	LookupTableDynamic_64_294_N_shape_1 = ((LookupTableDynamic_64_294_coords_dim_1_2 - LookupTableDynamic_64_294_clip_input_1) / (LookupTableDynamic_64_294_coords_dim_1_2 - LookupTableDynamic_64_294_coords_dim_1_1));
146
	LookupTableDynamic_64_294_N_shape_2 = ((LookupTableDynamic_64_294_clip_input_1 - LookupTableDynamic_64_294_coords_dim_1_1) / (LookupTableDynamic_64_294_coords_dim_1_2 - LookupTableDynamic_64_294_coords_dim_1_1));
147
	LookupTableDynamic_1 = ( (LookupTableDynamic_64_294_N_shape_1 * LookupTableDynamic_64_294_u_node_1) + (LookupTableDynamic_64_294_N_shape_2 * LookupTableDynamic_64_294_u_node_2) );
148
tel
149

    
150
(*
151
Original block name: LookupTableDynamic_nearest_PP
152
*)
153
node  LookupTableDynamic_nearest_PP(In1_1 : real;
154
	In2_1 : real;
155
	In2_2 : real;
156
	In2_3 : real;
157
	In2_4 : real;
158
	In2_5 : real;
159
	In2_6 : real;)
160
returns(Out1_1 : real;);
161
var Constant1_1 : real;
162
	Constant1_2 : real;
163
	Constant1_3 : real;
164
	Constant1_4 : real;
165
	Constant1_5 : real;
166
	Constant1_6 : real;
167
	LookupTableDynamic_1 : real;
168
	__time_step : real;
169
	__nb_step : int;
170
let
171
	Constant1_1 = 12.000000000000000;
172
	Constant1_2 = 23.000000000000000;
173
	Constant1_3 = 44.000000000000000;
174
	Constant1_4 = 55.000000000000000;
175
	Constant1_5 = 66.000000000000000;
176
	Constant1_6 = 77.000000000000000;
177
	LookupTableDynamic_1 = LookupTableDynamic_64_294_ext_node(In1_1, Constant1_1, Constant1_2, Constant1_3, Constant1_4, Constant1_5, Constant1_6, In2_1, In2_2, In2_3, In2_4, In2_5, In2_6);
178
	Out1_1 = LookupTableDynamic_1;
179
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
180
	__nb_step = (0 -> ((pre __nb_step) + 1));
181
tel
182