Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (7.36 KB)

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

    
3
-- Compiler: Lustre compiler 2 (nasa_toLustre.ToLustre.m)
4
-- Time: 20-Mar-2019 13:42:54
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_22_136(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.0);
25
	Sum6_1 = 0.0 + Sample_1 + UnitDelay_1;
26
	UnitDelay_1 = (0.0 -> (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_60_517(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.0;
59
	DataTypeConversion_1 = bool_to_real(eq0_1);
60
	DataTypeConversion1_1 = bool_to_real(ne1_1);
61
	Init_1 = 0.0;
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.0);
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.0 -> (pre Sum1_1));
72
	UnitDelay1_1 = (1.0 -> (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.0;
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_130_530(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.0;
98
	Product_1 = 1.0 * x0_1 * UnitDelay1_1;
99
	Sample_1 = (f_lpar_x_rpar__1 * 1.0);
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.0 -> (pre Sum1_1));
104
	UnitDelay1_1 = (1.0 -> (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_159_114(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.0;
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.0);
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.0 -> (pre Sum1_1));
156
	UnitDelay1_1 = (1.0 -> (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.0;
162
	F_lpar_x_rpar__1 = Sum6_1;
163
tel
164

    
165
(*
166
Original block name: enable_DTI_PP/EnabledSubsystem4
167
*)
168
node  EnabledSubsystem4_18_599_condExecSS(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
	_isEnabled_clock : bool clock;
182
let
183
	pre_Out1_1 = if (__nb_step > 0) then
184
		(pre Out1_1)
185
	    else 0.0;
186
	pre_Out2_1 = if (__nb_step > 0) then
187
		(pre Out2_1)
188
	    else 0.0;
189
	pre_Out3_1 = if (__nb_step > 0) then
190
		(pre Out3_1)
191
	    else 0.0;
192
	pre_Out4_1 = if (__nb_step > 0) then
193
		(pre Out4_1)
194
	    else 0.0;
195
	_isEnabled_clock = _isEnabled;
196
	(Out1_1, Out2_1, Out3_1, Out4_1) = (merge _isEnabled_clock 
197
		(true -> (EnabledSubsystem4_18_599((In1_1 when _isEnabled_clock), (Enable_1 when _isEnabled_clock), (__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock)) every (false -> (_isEnabled_clock and (not (pre _isEnabled_clock)))))) 
198
		(false -> (pre_Out1_1, pre_Out2_1, pre_Out3_1, pre_Out4_1) when false(_isEnabled_clock)));
199
tel
200

    
201
(*
202
Original block name: enable_DTI_PP/EnabledSubsystem4
203
*)
204
node  EnabledSubsystem4_18_599(In1_1 : real;
205
	Enable_1 : bool;
206
	__time_step : real;
207
	__nb_step : int;)
208
returns(Out1_1 : real;
209
	Out2_1 : real;
210
	Out3_1 : real;
211
	Out4_1 : real;);
212
var Add_1 : real;
213
	Discrete_minus_TimeIntegrator_1 : real;
214
	Discrete_minus_TimeIntegrator1_1 : real;
215
	Discrete_minus_TimeIntegrator2_1 : real;
216
	Discrete_minus_TimeIntegrator3_1 : real;
217
let
218
	Add_1 = 0.0 + bool_to_real(Enable_1) + In1_1;
219
	Discrete_minus_TimeIntegrator_1 = Discrete_minus_TimeIntegrator_22_136(Add_1, __time_step, __nb_step);
220
	Discrete_minus_TimeIntegrator1_1 = Discrete_minus_TimeIntegrator1_60_517(Add_1, Enable_1, __time_step, __nb_step);
221
	Discrete_minus_TimeIntegrator2_1 = Discrete_minus_TimeIntegrator2_130_530(Add_1, In1_1, __time_step, __nb_step);
222
	Discrete_minus_TimeIntegrator3_1 = Discrete_minus_TimeIntegrator3_159_114(Add_1, Enable_1, In1_1, __time_step, __nb_step);
223
	Out1_1 = Discrete_minus_TimeIntegrator_1;
224
	Out2_1 = Discrete_minus_TimeIntegrator1_1;
225
	Out3_1 = Discrete_minus_TimeIntegrator2_1;
226
	Out4_1 = Discrete_minus_TimeIntegrator3_1;
227
tel
228

    
229
(*
230
Original block name: enable_DTI_PP
231
*)
232
node  enable_DTI_PP(In1_1 : bool;
233
	In2_1 : real;)
234
returns(Out7_1 : real;
235
	Out8_1 : real;
236
	Out9_1 : real;
237
	Out10_1 : real;);
238
var ExecutionCond_of_EnabledSubsystem4_18_599 : bool;
239
	EnabledSubsystem4_1 : real;
240
	EnabledSubsystem4_2 : real;
241
	EnabledSubsystem4_3 : real;
242
	EnabledSubsystem4_4 : real;
243
	__time_step : real;
244
	__nb_step : int;
245
let
246
	ExecutionCond_of_EnabledSubsystem4_18_599 = In1_1;
247
	(EnabledSubsystem4_1, EnabledSubsystem4_2, EnabledSubsystem4_3, EnabledSubsystem4_4) = EnabledSubsystem4_18_599_condExecSS(In2_1, In1_1, ExecutionCond_of_EnabledSubsystem4_18_599, __time_step, __nb_step);
248
	Out7_1 = EnabledSubsystem4_1;
249
	Out8_1 = EnabledSubsystem4_2;
250
	Out9_1 = EnabledSubsystem4_3;
251
	Out10_1 = EnabledSubsystem4_4;
252
	__time_step = (0.0 -> ((pre __time_step) + 1.0));
253
	__nb_step = (0 -> ((pre __nb_step) + 1));
254
tel
255