Project

General

Profile

Download (6.7 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:23
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_Ku_PP/Gain3
53
*)
54
node  Gain3_69_007(u_1 : real;
55
	u_2 : real;
56
	__time_step : real;
57
	__nb_step : int;)
58
returns(Out1_1 : real;);
59
var K_1 : real;
60
	K_2 : real;
61
	Product_1 : real;
62
let
63
	K_1 = 2.000000000000000;
64
	K_2 = 5.000000000000000;
65
	Product_1 = 0.0 + (K_1 * u_1) + (K_2 * u_2);
66
	Out1_1 = Product_1;
67
tel
68

    
69
(*
70
Original block name: gain_test_Ku_PP/Gain4
71
*)
72
node  Gain4_70_007(u_1 : int;
73
	u_2 : int;
74
	__time_step : real;
75
	__nb_step : int;)
76
returns(Out1_1 : int;);
77
var K_1 : int;
78
	K_2 : int;
79
	Product_1 : int;
80
let
81
	K_1 = 2;
82
	K_2 = 5;
83
	Product_1 = int_to_int16(0 + (int_to_int16(K_1) * int_to_int16(u_1)) + (int_to_int16(K_2) * int_to_int16(u_2)));
84
	Out1_1 = Product_1;
85
tel
86

    
87
(*
88
Original block name: gain_test_Ku_PP/Gain5
89
*)
90
node  Gain5_72_009(u_1 : bool;
91
	u_2 : bool;
92
	__time_step : real;
93
	__nb_step : int;)
94
returns(Out1_1 : int;);
95
var K_1 : bool;
96
	K_2 : bool;
97
	Product_1 : int;
98
let
99
	K_1 = true;
100
	K_2 = true;
101
	Product_1 = int_to_uint16(0 + (bool_to_int(K_1) * bool_to_int(u_1)) + (bool_to_int(K_2) * bool_to_int(u_2)));
102
	Out1_1 = Product_1;
103
tel
104

    
105
(*
106
Original block name: gain_test_Ku_PP/Gain6
107
*)
108
node  Gain6_73_007(u_1 : real;
109
	u_2 : real;
110
	__time_step : real;
111
	__nb_step : int;)
112
returns(Out1_1 : real;
113
	Out1_2 : real;);
114
var K_1 : real;
115
	K_2 : real;
116
	K_3 : real;
117
	K_4 : real;
118
	Product_1 : real;
119
	Product_2 : real;
120
let
121
	K_1 = 2.000000000000000;
122
	K_2 = 6.000000000000000;
123
	K_3 = 5.000000000000000;
124
	K_4 = 8.000000000000000;
125
	Product_1 = 0.0 + (K_1 * u_1) + (K_3 * u_2);
126
	Product_2 = 0.0 + (K_2 * u_1) + (K_4 * u_2);
127
	Out1_1 = Product_1;
128
	Out1_2 = Product_2;
129
tel
130

    
131
(*
132
Original block name: gain_test_Ku_PP/Gain7
133
*)
134
node  Gain7_74_007(u_1 : int;
135
	u_2 : int;
136
	__time_step : real;
137
	__nb_step : int;)
138
returns(Out1_1 : int;
139
	Out1_2 : int;);
140
var K_1 : int;
141
	K_2 : int;
142
	K_3 : int;
143
	K_4 : int;
144
	Product_1 : int;
145
	Product_2 : int;
146
let
147
	K_1 = 2;
148
	K_2 = 6;
149
	K_3 = 5;
150
	K_4 = 8;
151
	Product_1 = int_to_int16(0 + (int_to_int16(K_1) * int_to_int16(u_1)) + (int_to_int16(K_3) * int_to_int16(u_2)));
152
	Product_2 = int_to_int16(0 + (int_to_int16(K_2) * int_to_int16(u_1)) + (int_to_int16(K_4) * int_to_int16(u_2)));
153
	Out1_1 = Product_1;
154
	Out1_2 = Product_2;
155
tel
156

    
157
(*
158
Original block name: gain_test_Ku_PP/Gain8
159
*)
160
node  Gain8_75_007(u_1 : bool;
161
	u_2 : bool;
162
	__time_step : real;
163
	__nb_step : int;)
164
returns(Out1_1 : int;
165
	Out1_2 : int;);
166
var K_1 : bool;
167
	K_2 : bool;
168
	K_3 : bool;
169
	K_4 : bool;
170
	Product_1 : int;
171
	Product_2 : int;
172
let
173
	K_1 = true;
174
	K_2 = true;
175
	K_3 = true;
176
	K_4 = true;
177
	Product_1 = int_to_uint16(0 + (bool_to_int(K_1) * bool_to_int(u_1)) + (bool_to_int(K_3) * bool_to_int(u_2)));
178
	Product_2 = int_to_uint16(0 + (bool_to_int(K_2) * bool_to_int(u_1)) + (bool_to_int(K_4) * bool_to_int(u_2)));
179
	Out1_1 = Product_1;
180
	Out1_2 = Product_2;
181
tel
182

    
183
(*
184
Original block name: gain_test_Ku_PP/Gain9
185
*)
186
node  Gain9_76_007(u_1 : real;
187
	u_2 : real;
188
	u_3 : real;
189
	u_4 : real;
190
	u_5 : real;
191
	u_6 : real;
192
	__time_step : real;
193
	__nb_step : int;)
194
returns(Out1_1 : real;
195
	Out1_2 : real;
196
	Out1_3 : real;
197
	Out1_4 : real;
198
	Out1_5 : real;
199
	Out1_6 : real;);
200
var K_1 : real;
201
	K_2 : real;
202
	K_3 : real;
203
	K_4 : real;
204
	Product_1 : real;
205
	Product_2 : real;
206
	Product_3 : real;
207
	Product_4 : real;
208
	Product_5 : real;
209
	Product_6 : real;
210
let
211
	K_1 = 2.000000000000000;
212
	K_2 = 6.000000000000000;
213
	K_3 = 5.000000000000000;
214
	K_4 = 8.000000000000000;
215
	Product_1 = 0.0 + (K_1 * u_1) + (K_3 * u_2);
216
	Product_3 = 0.0 + (K_1 * u_3) + (K_3 * u_4);
217
	Product_5 = 0.0 + (K_1 * u_5) + (K_3 * u_6);
218
	Product_2 = 0.0 + (K_2 * u_1) + (K_4 * u_2);
219
	Product_4 = 0.0 + (K_2 * u_3) + (K_4 * u_4);
220
	Product_6 = 0.0 + (K_2 * u_5) + (K_4 * u_6);
221
	Out1_1 = Product_1;
222
	Out1_2 = Product_2;
223
	Out1_3 = Product_3;
224
	Out1_4 = Product_4;
225
	Out1_5 = Product_5;
226
	Out1_6 = Product_6;
227
tel
228

    
229
(*
230
Original block name: gain_test_Ku_PP
231
*)
232
node  gain_test_Ku_PP(In1_1 : real;
233
	In2_1 : int;
234
	In3_1 : bool;
235
	In4_1 : real;
236
	In4_2 : real;
237
	In5_1 : int;
238
	In5_2 : int;
239
	In6_1 : bool;
240
	In6_2 : bool;
241
	In7_1 : real;
242
	In7_2 : real;
243
	In8_1 : int;
244
	In8_2 : int;
245
	In9_1 : bool;
246
	In9_2 : bool;
247
	In10_1 : real;
248
	In10_2 : real;
249
	In10_3 : real;
250
	In10_4 : real;
251
	In10_5 : real;
252
	In10_6 : real;)
253
returns(Out1_1 : real;
254
	Out2_1 : real;
255
	Out3_1 : real;
256
	Out4_1 : real;
257
	Out5_1 : int;
258
	Out6_1 : int;
259
	Out7_1 : real;
260
	Out7_2 : real;
261
	Out8_1 : int;
262
	Out8_2 : int;
263
	Out9_1 : int;
264
	Out9_2 : int;
265
	Out10_1 : real;
266
	Out10_2 : real;
267
	Out10_3 : real;
268
	Out10_4 : real;
269
	Out10_5 : real;
270
	Out10_6 : real;);
271
var Gain_1 : real;
272
	Gain1_1 : real;
273
	Gain2_1 : real;
274
	Gain3_1 : real;
275
	Gain4_1 : int;
276
	Gain5_1 : int;
277
	Gain6_1 : real;
278
	Gain6_2 : real;
279
	Gain7_1 : int;
280
	Gain7_2 : int;
281
	Gain8_1 : int;
282
	Gain8_2 : int;
283
	Gain9_1 : real;
284
	Gain9_2 : real;
285
	Gain9_3 : real;
286
	Gain9_4 : real;
287
	Gain9_5 : real;
288
	Gain9_6 : real;
289
	__time_step : real;
290
	__nb_step : int;
291
let
292
	Gain_1 = (In1_1 * 1.000000000000000);
293
	Gain1_1 = (int_to_real(In2_1) * 1.000000000000000);
294
	Gain2_1 = if In3_1 then
295
		1.000000000000000
296
	    else 0.0;
297
	Gain3_1 = Gain3_69_007(In4_1, In4_2, __time_step, __nb_step);
298
	Gain4_1 = Gain4_70_007(In5_1, In5_2, __time_step, __nb_step);
299
	Gain5_1 = Gain5_72_009(In6_1, In6_2, __time_step, __nb_step);
300
	(Gain6_1, Gain6_2) = Gain6_73_007(In7_1, In7_2, __time_step, __nb_step);
301
	(Gain7_1, Gain7_2) = Gain7_74_007(In8_1, In8_2, __time_step, __nb_step);
302
	(Gain8_1, Gain8_2) = Gain8_75_007(In9_1, In9_2, __time_step, __nb_step);
303
	(Gain9_1, Gain9_2, Gain9_3, Gain9_4, Gain9_5, Gain9_6) = Gain9_76_007(In10_1, In10_2, In10_3, In10_4, In10_5, In10_6, __time_step, __nb_step);
304
	Out1_1 = Gain_1;
305
	Out2_1 = Gain1_1;
306
	Out3_1 = Gain2_1;
307
	Out4_1 = Gain3_1;
308
	Out5_1 = Gain4_1;
309
	Out6_1 = Gain5_1;
310
	Out7_1 = Gain6_1;
311
	Out7_2 = Gain6_2;
312
	Out8_1 = Gain7_1;
313
	Out8_2 = Gain7_2;
314
	Out9_1 = Gain8_1;
315
	Out9_2 = Gain8_2;
316
	Out10_1 = Gain9_1;
317
	Out10_2 = Gain9_2;
318
	Out10_3 = Gain9_3;
319
	Out10_4 = Gain9_4;
320
	Out10_5 = Gain9_5;
321
	Out10_6 = Gain9_6;
322
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
323
	__nb_step = (0 -> ((pre __nb_step) + 1));
324
tel
325

    
(1065-1065/1153)