Project

General

Profile

Download (5.23 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:41
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_Kuuvect_PP/Gain3
53
*)
54
node  Gain3_63_012(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_Kuuvect_PP/Gain4
71
*)
72
node  Gain4_64_008(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_Kuuvect_PP/Gain5
89
*)
90
node  Gain5_65_007(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_Kuuvect_PP/Gain6
107
*)
108
node  Gain6_66_014(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_Kuuvect_PP/Gain7
133
*)
134
node  Gain7_67_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_Kuuvect_PP/Gain8
159
*)
160
node  Gain8_68_006(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_Kuuvect_PP
185
*)
186
node  gain_test_Kuuvect_PP(In1_1 : real;
187
	In2_1 : int;
188
	In3_1 : bool;
189
	In4_1 : real;
190
	In4_2 : real;
191
	In5_1 : int;
192
	In5_2 : int;
193
	In6_1 : bool;
194
	In6_2 : bool;
195
	In7_1 : real;
196
	In7_2 : real;
197
	In8_1 : int;
198
	In8_2 : int;
199
	In9_1 : bool;
200
	In9_2 : bool;)
201
returns(Out1_1 : real;
202
	Out2_1 : real;
203
	Out3_1 : real;
204
	Out4_1 : real;
205
	Out5_1 : int;
206
	Out6_1 : int;
207
	Out7_1 : real;
208
	Out7_2 : real;
209
	Out8_1 : int;
210
	Out8_2 : int;
211
	Out9_1 : int;
212
	Out9_2 : int;);
213
var Gain_1 : real;
214
	Gain1_1 : real;
215
	Gain2_1 : real;
216
	Gain3_1 : real;
217
	Gain4_1 : int;
218
	Gain5_1 : int;
219
	Gain6_1 : real;
220
	Gain6_2 : real;
221
	Gain7_1 : int;
222
	Gain7_2 : int;
223
	Gain8_1 : int;
224
	Gain8_2 : int;
225
	__time_step : real;
226
	__nb_step : int;
227
let
228
	Gain_1 = (In1_1 * 1.000000000000000);
229
	Gain1_1 = (int_to_real(In2_1) * 1.000000000000000);
230
	Gain2_1 = if In3_1 then
231
		1.000000000000000
232
	    else 0.0;
233
	Gain3_1 = Gain3_63_012(In4_1, In4_2, __time_step, __nb_step);
234
	Gain4_1 = Gain4_64_008(In5_1, In5_2, __time_step, __nb_step);
235
	Gain5_1 = Gain5_65_007(In6_1, In6_2, __time_step, __nb_step);
236
	(Gain6_1, Gain6_2) = Gain6_66_014(In7_1, In7_2, __time_step, __nb_step);
237
	(Gain7_1, Gain7_2) = Gain7_67_007(In8_1, In8_2, __time_step, __nb_step);
238
	(Gain8_1, Gain8_2) = Gain8_68_006(In9_1, In9_2, __time_step, __nb_step);
239
	Out1_1 = Gain_1;
240
	Out2_1 = Gain1_1;
241
	Out3_1 = Gain2_1;
242
	Out4_1 = Gain3_1;
243
	Out5_1 = Gain4_1;
244
	Out6_1 = Gain5_1;
245
	Out7_1 = Gain6_1;
246
	Out7_2 = Gain6_2;
247
	Out8_1 = Gain7_1;
248
	Out8_2 = Gain7_2;
249
	Out9_1 = Gain8_1;
250
	Out9_2 = Gain8_2;
251
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
252
	__nb_step = (0 -> ((pre __nb_step) + 1));
253
tel
254

    
(1066-1066/1153)