Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (7.65 KB)

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

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

    
13
(*
14
Original block name: enable_DTI_PP/EnabledSubsystem4/Discrete_minus_TimeIntegrator
15
*)
16
node  Discrete_minus_TimeIntegrator_69_270(f_lpar_x_rpar__1 : real;
17
	__time_step : real;
18
	__nb_step : int;)
19
returns(F_lpar_x_rpar__1 : real;);
20
var Sample_1 : real;
21
	Sum6_1 : real;
22
	UnitDelay_1 : real;
23
let
24
	Sample_1 = (f_lpar_x_rpar__1 * 1.000000000000000);
25
	Sum6_1 = 0.0 + Sample_1 + UnitDelay_1;
26
	UnitDelay_1 = (0.000000000000000 -> (pre Sum6_1));
27
	F_lpar_x_rpar__1 = UnitDelay_1;
28
tel
29

    
30
(*
31
Original block name: enable_DTI_PP/EnabledSubsystem4/Discrete_minus_TimeIntegrator1
32
*)
33
node  Discrete_minus_TimeIntegrator1_70_296(f_lpar_x_rpar__1 : real;
34
	reset_falling_1 : bool;
35
	__time_step : real;
36
	__nb_step : int;)
37
returns(F_lpar_x_rpar__1 : real;);
38
var Constant_1 : real;
39
	DataTypeConversion_1 : real;
40
	DataTypeConversion1_1 : real;
41
	Init_1 : real;
42
	Product_1 : real;
43
	Product2_1 : real;
44
	Sample_1 : real;
45
	Sum1_1 : real;
46
	Sum2_1 : real;
47
	Sum3_1 : real;
48
	Sum4_1 : real;
49
	Sum5_1 : real;
50
	Sum6_1 : real;
51
	UnitDelay_1 : real;
52
	UnitDelay1_1 : real;
53
	UnitDelay2_1 : bool;
54
	eq0_1 : bool;
55
	ne1_1 : bool;
56
	zero_1 : real;
57
let
58
	Constant_1 = 0.000000000000000;
59
	DataTypeConversion_1 = bool_to_real(eq0_1);
60
	DataTypeConversion1_1 = bool_to_real(ne1_1);
61
	Init_1 = 0.000000000000000;
62
	Product_1 = 1.0 * Init_1 * UnitDelay1_1;
63
	Product2_1 = 1.0 * Sum3_1 * DataTypeConversion_1 * DataTypeConversion1_1;
64
	Sample_1 = (f_lpar_x_rpar__1 * 1.000000000000000);
65
	Sum1_1 = 0.0 + Sample_1 + Sum2_1;
66
	Sum2_1 = 0.0 + Sum4_1 + Product_1;
67
	Sum3_1 = 0.0 - UnitDelay_1 + Init_1;
68
	Sum4_1 = 0.0 + UnitDelay_1 + Product2_1;
69
	Sum5_1 = 0.0 + UnitDelay_1 + Product_1;
70
	Sum6_1 = 0.0 + Sum5_1 + Product2_1;
71
	UnitDelay_1 = (0.000000000000000 -> (pre Sum1_1));
72
	UnitDelay1_1 = (1.000000000000000 -> (pre Constant_1));
73
	UnitDelay2_1 = (false -> (pre reset_falling_1));
74
	eq0_1 = (bool_to_real(reset_falling_1) <= zero_1);
75
	ne1_1 = (bool_to_real(UnitDelay2_1) > zero_1);
76
	zero_1 = 0.000000000000000;
77
	F_lpar_x_rpar__1 = Sum6_1;
78
tel
79

    
80
(*
81
Original block name: enable_DTI_PP/EnabledSubsystem4/Discrete_minus_TimeIntegrator2
82
*)
83
node  Discrete_minus_TimeIntegrator2_72_059(f_lpar_x_rpar__1 : real;
84
	x0_1 : real;
85
	__time_step : real;
86
	__nb_step : int;)
87
returns(F_lpar_x_rpar__1 : real;);
88
var Constant_1 : real;
89
	Product_1 : real;
90
	Sample_1 : real;
91
	Sum1_1 : real;
92
	Sum2_1 : real;
93
	Sum6_1 : real;
94
	UnitDelay_1 : real;
95
	UnitDelay1_1 : real;
96
let
97
	Constant_1 = 0.000000000000000;
98
	Product_1 = 1.0 * x0_1 * UnitDelay1_1;
99
	Sample_1 = (f_lpar_x_rpar__1 * 1.000000000000000);
100
	Sum1_1 = 0.0 + Sample_1 + Sum2_1;
101
	Sum2_1 = 0.0 + UnitDelay_1 + Product_1;
102
	Sum6_1 = 0.0 + UnitDelay_1 + Product_1;
103
	UnitDelay_1 = (0.000000000000000 -> (pre Sum1_1));
104
	UnitDelay1_1 = (1.000000000000000 -> (pre Constant_1));
105
	F_lpar_x_rpar__1 = Sum6_1;
106
tel
107

    
108
(*
109
Original block name: enable_DTI_PP/EnabledSubsystem4/Discrete_minus_TimeIntegrator3
110
*)
111
node  Discrete_minus_TimeIntegrator3_73_055(f_lpar_x_rpar__1 : real;
112
	reset_level_1 : bool;
113
	x0_1 : real;
114
	__time_step : real;
115
	__nb_step : int;)
116
returns(F_lpar_x_rpar__1 : real;);
117
var Add_1 : real;
118
	Constant_1 : real;
119
	DataTypeConversion_1 : real;
120
	DataTypeConversion1_1 : real;
121
	DataTypeConversion2_1 : real;
122
	Product_1 : real;
123
	Product1_1 : real;
124
	Product2_1 : real;
125
	Sample_1 : real;
126
	Sum1_1 : real;
127
	Sum2_1 : real;
128
	Sum3_1 : real;
129
	Sum4_1 : real;
130
	Sum5_1 : real;
131
	Sum6_1 : real;
132
	UnitDelay_1 : real;
133
	UnitDelay1_1 : real;
134
	UnitDelay2_1 : bool;
135
	eq0_1 : bool;
136
	ne0_1 : bool;
137
	ne1_1 : bool;
138
	zero_1 : real;
139
let
140
	Add_1 = 0.0 + Product1_1 + Product2_1;
141
	Constant_1 = 0.000000000000000;
142
	DataTypeConversion_1 = bool_to_real(ne0_1);
143
	DataTypeConversion1_1 = bool_to_real(eq0_1);
144
	DataTypeConversion2_1 = bool_to_real(ne1_1);
145
	Product_1 = 1.0 * x0_1 * UnitDelay1_1;
146
	Product1_1 = 1.0 * Sum3_1 * DataTypeConversion_1;
147
	Product2_1 = 1.0 * Sum3_1 * DataTypeConversion1_1 * DataTypeConversion2_1;
148
	Sample_1 = (f_lpar_x_rpar__1 * 1.000000000000000);
149
	Sum1_1 = 0.0 + Sample_1 + Sum2_1;
150
	Sum2_1 = 0.0 + Sum4_1 + Product_1;
151
	Sum3_1 = 0.0 - UnitDelay_1 + x0_1;
152
	Sum4_1 = 0.0 + UnitDelay_1 + Add_1;
153
	Sum5_1 = 0.0 + UnitDelay_1 + Product_1;
154
	Sum6_1 = 0.0 + Sum5_1 + Add_1;
155
	UnitDelay_1 = (0.000000000000000 -> (pre Sum1_1));
156
	UnitDelay1_1 = (1.000000000000000 -> (pre Constant_1));
157
	UnitDelay2_1 = (false -> (pre reset_level_1));
158
	eq0_1 = (bool_to_real(reset_level_1) = zero_1);
159
	ne0_1 = (bool_to_real(reset_level_1) <> zero_1);
160
	ne1_1 = (bool_to_real(UnitDelay2_1) <> zero_1);
161
	zero_1 = 0.000000000000000;
162
	F_lpar_x_rpar__1 = Sum6_1;
163
tel
164

    
165
(*
166
Original block name: enable_DTI_PP/EnabledSubsystem4
167
*)
168
node  EnabledSubsystem4_65_273_automaton(In1_1 : real;
169
	Enable_1 : bool;
170
	_isEnabled : bool;
171
	__time_step : real;
172
	__nb_step : int;)
173
returns(Out1_1 : real;
174
	Out2_1 : real;
175
	Out3_1 : real;
176
	Out4_1 : real;);
177
var pre_Out1_1 : real;
178
	pre_Out2_1 : real;
179
	pre_Out3_1 : real;
180
	pre_Out4_1 : real;
181
let
182
	pre_Out1_1 = if (__nb_step > 0) then
183
		(pre Out1_1)
184
	    else 0.000000000000000;
185
	pre_Out2_1 = if (__nb_step > 0) then
186
		(pre Out2_1)
187
	    else 0.000000000000000;
188
	pre_Out3_1 = if (__nb_step > 0) then
189
		(pre Out3_1)
190
	    else 0.000000000000000;
191
	pre_Out4_1 = if (__nb_step > 0) then
192
		(pre Out4_1)
193
	    else 0.000000000000000;
194
	automaton enabled_EnabledSubsystem4_65_273
195
	state Active_EnabledSubsystem4_65_273:
196
	unless (not _isEnabled) restart Inactive_EnabledSubsystem4_65_273
197
	let
198
		(Out1_1, Out2_1, Out3_1, Out4_1) = EnabledSubsystem4_65_273(In1_1, Enable_1, __time_step, __nb_step);
199
	tel
200

    
201
	state Inactive_EnabledSubsystem4_65_273:
202
	unless _isEnabled restart Active_EnabledSubsystem4_65_273
203
	let
204
		Out1_1 = pre_Out1_1;
205
		Out2_1 = pre_Out2_1;
206
		Out3_1 = pre_Out3_1;
207
		Out4_1 = pre_Out4_1;
208
	tel
209

    
210

    
211
tel
212

    
213
(*
214
Original block name: enable_DTI_PP/EnabledSubsystem4
215
*)
216
node  EnabledSubsystem4_65_273(In1_1 : real;
217
	Enable_1 : bool;
218
	__time_step : real;
219
	__nb_step : int;)
220
returns(Out1_1 : real;
221
	Out2_1 : real;
222
	Out3_1 : real;
223
	Out4_1 : real;);
224
var Add_1 : real;
225
	Discrete_minus_TimeIntegrator_1 : real;
226
	Discrete_minus_TimeIntegrator1_1 : real;
227
	Discrete_minus_TimeIntegrator2_1 : real;
228
	Discrete_minus_TimeIntegrator3_1 : real;
229
let
230
	Add_1 = 0.0 + bool_to_real(Enable_1) + In1_1;
231
	Discrete_minus_TimeIntegrator_1 = Discrete_minus_TimeIntegrator_69_270(Add_1, __time_step, __nb_step);
232
	Discrete_minus_TimeIntegrator1_1 = Discrete_minus_TimeIntegrator1_70_296(Add_1, Enable_1, __time_step, __nb_step);
233
	Discrete_minus_TimeIntegrator2_1 = Discrete_minus_TimeIntegrator2_72_059(Add_1, In1_1, __time_step, __nb_step);
234
	Discrete_minus_TimeIntegrator3_1 = Discrete_minus_TimeIntegrator3_73_055(Add_1, Enable_1, In1_1, __time_step, __nb_step);
235
	Out1_1 = Discrete_minus_TimeIntegrator_1;
236
	Out2_1 = Discrete_minus_TimeIntegrator1_1;
237
	Out3_1 = Discrete_minus_TimeIntegrator2_1;
238
	Out4_1 = Discrete_minus_TimeIntegrator3_1;
239
tel
240

    
241
(*
242
Original block name: enable_DTI_PP
243
*)
244
node  enable_DTI_PP(In1_1 : bool;
245
	In2_1 : real;)
246
returns(Out7_1 : real;
247
	Out8_1 : real;
248
	Out9_1 : real;
249
	Out10_1 : real;);
250
var ExecutionCond_of_EnabledSubsystem4_65_273 : bool;
251
	EnabledSubsystem4_1 : real;
252
	EnabledSubsystem4_2 : real;
253
	EnabledSubsystem4_3 : real;
254
	EnabledSubsystem4_4 : real;
255
	__time_step : real;
256
	__nb_step : int;
257
let
258
	ExecutionCond_of_EnabledSubsystem4_65_273 = In1_1;
259
	(EnabledSubsystem4_1, EnabledSubsystem4_2, EnabledSubsystem4_3, EnabledSubsystem4_4) = EnabledSubsystem4_65_273_automaton(In2_1, In1_1, ExecutionCond_of_EnabledSubsystem4_65_273, __time_step, __nb_step);
260
	Out7_1 = EnabledSubsystem4_1;
261
	Out8_1 = EnabledSubsystem4_2;
262
	Out9_1 = EnabledSubsystem4_3;
263
	Out10_1 = EnabledSubsystem4_4;
264
	__time_step = (0.0 -> ((pre __time_step) + 1.000000000000000));
265
	__nb_step = (0 -> ((pre __nb_step) + 1));
266
tel
267