Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (12.9 KB)

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

    
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 22:45:48
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(Constant3_1 : real;
17
	Constant2_1 : real;
18
	Constant2_2 : real;
19
	Constant2_3 : real;
20
	Constant2_4 : real;
21
	Constant2_5 : real;
22
	Constant2_6 : real;
23
	Constant1_1 : real;
24
	Constant1_2 : real;
25
	Constant1_3 : real;
26
	Constant1_4 : real;
27
	Constant1_5 : real;
28
	Constant1_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 = Constant1_1;
56
	LookupTableDynamic_64_294_table_elem_2 = Constant1_2;
57
	LookupTableDynamic_64_294_table_elem_3 = Constant1_3;
58
	LookupTableDynamic_64_294_table_elem_4 = Constant1_4;
59
	LookupTableDynamic_64_294_table_elem_5 = Constant1_5;
60
	LookupTableDynamic_64_294_table_elem_6 = Constant1_6;
61
	LookupTableDynamic_64_294_Breakpoints_dim1_1 = Constant2_1;
62
	LookupTableDynamic_64_294_Breakpoints_dim1_2 = Constant2_2;
63
	LookupTableDynamic_64_294_Breakpoints_dim1_3 = Constant2_3;
64
	LookupTableDynamic_64_294_Breakpoints_dim1_4 = Constant2_4;
65
	LookupTableDynamic_64_294_Breakpoints_dim1_5 = Constant2_5;
66
	LookupTableDynamic_64_294_Breakpoints_dim1_6 = Constant2_6;
67
	LookupTableDynamic_64_294_dimJump_1 = 1;
68
	LookupTableDynamic_64_294_index_dim_1_1 = if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_6) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
69
		5
70
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_5) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
71
		5
72
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_4) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
73
		4
74
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_3) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
75
		3
76
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_2) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
77
		2
78
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_1) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
79
		1
80
	    else 1;
81
	LookupTableDynamic_64_294_coords_dim_1_1 = if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_6) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
82
		LookupTableDynamic_64_294_Breakpoints_dim1_5
83
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_5) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
84
		LookupTableDynamic_64_294_Breakpoints_dim1_5
85
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_4) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
86
		LookupTableDynamic_64_294_Breakpoints_dim1_4
87
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_3) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
88
		LookupTableDynamic_64_294_Breakpoints_dim1_3
89
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_2) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
90
		LookupTableDynamic_64_294_Breakpoints_dim1_2
91
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_1) or abs_real(Constant3_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 ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_6) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
95
		6
96
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_5) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
97
		6
98
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_4) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
99
		5
100
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_3) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
101
		4
102
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_2) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
103
		3
104
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_1) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
105
		2
106
	    else 2;
107
	LookupTableDynamic_64_294_coords_dim_1_2 = if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_6) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
108
		LookupTableDynamic_64_294_Breakpoints_dim1_6
109
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_5) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
110
		LookupTableDynamic_64_294_Breakpoints_dim1_6
111
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_4) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
112
		LookupTableDynamic_64_294_Breakpoints_dim1_5
113
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_3) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
114
		LookupTableDynamic_64_294_Breakpoints_dim1_4
115
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_2) or abs_real(Constant3_1 - LookupTableDynamic_64_294_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
116
		LookupTableDynamic_64_294_Breakpoints_dim1_3
117
	    else if ((Constant3_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_1) or abs_real(Constant3_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 = Constant3_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_below_PP
152
*)
153
node  LookupTableDynamic_below_PP(_virtual : bool;)
154
returns(Out1_1 : real;
155
	Out1_2 : real;
156
	Out1_3 : real;
157
	Out1_4 : real;
158
	Out1_5 : real;
159
	Out1_6 : real;);
160
var Constant1_1 : real;
161
	Constant1_2 : real;
162
	Constant1_3 : real;
163
	Constant1_4 : real;
164
	Constant1_5 : real;
165
	Constant1_6 : real;
166
	Constant2_1 : real;
167
	Constant2_2 : real;
168
	Constant2_3 : real;
169
	Constant2_4 : real;
170
	Constant2_5 : real;
171
	Constant2_6 : real;
172
	Constant3_1 : real;
173
	Constant3_2 : real;
174
	Constant3_3 : real;
175
	Constant3_4 : real;
176
	Constant3_5 : real;
177
	Constant3_6 : real;
178
	LookupTableDynamic_1 : real;
179
	LookupTableDynamic_2 : real;
180
	LookupTableDynamic_3 : real;
181
	LookupTableDynamic_4 : real;
182
	LookupTableDynamic_5 : real;
183
	LookupTableDynamic_6 : real;
184
	__time_step : real;
185
	__nb_step : int;
186
let
187
	Constant1_1 = 12.000000000000000;
188
	Constant1_2 = 23.000000000000000;
189
	Constant1_3 = 44.000000000000000;
190
	Constant1_4 = 55.000000000000000;
191
	Constant1_5 = 66.000000000000000;
192
	Constant1_6 = 77.000000000000000;
193
	Constant2_1 = 2.000000000000000;
194
	Constant2_2 = 3.000000000000000;
195
	Constant2_3 = 4.000000000000000;
196
	Constant2_4 = 5.000000000000000;
197
	Constant2_5 = 6.000000000000000;
198
	Constant2_6 = 7.000000000000000;
199
	Constant3_1 = 2.300000000000000;
200
	Constant3_2 = 3.000000000000000;
201
	Constant3_3 = 4.400000000000000;
202
	Constant3_4 = 5.000000000000000;
203
	Constant3_5 = 6.600000000000000;
204
	Constant3_6 = 7.000000000000000;
205
	LookupTableDynamic_1 = LookupTableDynamic_64_294_ext_node(Constant3_1, Constant2_1, Constant2_2, Constant2_3, Constant2_4, Constant2_5, Constant2_6, Constant1_1, Constant1_2, Constant1_3, Constant1_4, Constant1_5, Constant1_6);
206
	LookupTableDynamic_2 = LookupTableDynamic_64_294_ext_node(Constant3_2, Constant2_1, Constant2_2, Constant2_3, Constant2_4, Constant2_5, Constant2_6, Constant1_1, Constant1_2, Constant1_3, Constant1_4, Constant1_5, Constant1_6);
207
	LookupTableDynamic_3 = LookupTableDynamic_64_294_ext_node(Constant3_3, Constant2_1, Constant2_2, Constant2_3, Constant2_4, Constant2_5, Constant2_6, Constant1_1, Constant1_2, Constant1_3, Constant1_4, Constant1_5, Constant1_6);
208
	LookupTableDynamic_4 = LookupTableDynamic_64_294_ext_node(Constant3_4, Constant2_1, Constant2_2, Constant2_3, Constant2_4, Constant2_5, Constant2_6, Constant1_1, Constant1_2, Constant1_3, Constant1_4, Constant1_5, Constant1_6);
209
	LookupTableDynamic_5 = LookupTableDynamic_64_294_ext_node(Constant3_5, Constant2_1, Constant2_2, Constant2_3, Constant2_4, Constant2_5, Constant2_6, Constant1_1, Constant1_2, Constant1_3, Constant1_4, Constant1_5, Constant1_6);
210
	LookupTableDynamic_6 = LookupTableDynamic_64_294_ext_node(Constant3_6, Constant2_1, Constant2_2, Constant2_3, Constant2_4, Constant2_5, Constant2_6, Constant1_1, Constant1_2, Constant1_3, Constant1_4, Constant1_5, Constant1_6);
211
	Out1_1 = LookupTableDynamic_1;
212
	Out1_2 = LookupTableDynamic_2;
213
	Out1_3 = LookupTableDynamic_3;
214
	Out1_4 = LookupTableDynamic_4;
215
	Out1_5 = LookupTableDynamic_5;
216
	Out1_6 = LookupTableDynamic_6;
217
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
218
	__nb_step = (0 -> ((pre __nb_step) + 1));
219
tel
220