Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (5.59 KB)

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

    
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 23:07:59
5
(*
6
Original block name: TriggeredEnabled_Subsystem_PP/Enabled_Counter
7
*)
8
node  Enabled_Counter_115_759_automaton(In1_1 : real;
9
	_isEnabled : bool;
10
	_isTriggered : bool;
11
	__time_step : real;
12
	__nb_step : int;)
13
returns(Out1_1 : real;
14
	Out2_1 : real;);
15
var pre_Out1_1 : real;
16
	pre_Out2_1 : real;
17
let
18
	pre_Out1_1 = if (__nb_step > 0) then
19
		(pre Out1_1)
20
	    else 0.000000000000000;
21
	pre_Out2_1 = if (__nb_step > 0) then
22
		(pre Out2_1)
23
	    else 0.000000000000000;
24
	automaton enabled_Enabled_Counter_115_759
25
	state Active_Enabled_Counter_115_759:
26
	unless (not _isEnabled) restart Inactive_Enabled_Counter_115_759
27
	let
28
		automaton triggered_Enabled_Counter_115_759
29
	state Active_triggered_Enabled_Counter_115_759:
30
	unless (not _isTriggered) resume Inactive_triggered_Enabled_Counter_115_759
31
	let
32
		(Out1_1, Out2_1) = Enabled_Counter_115_759(In1_1, __time_step, __nb_step);
33
	tel
34

    
35
	state Inactive_triggered_Enabled_Counter_115_759:
36
	unless _isTriggered resume Active_triggered_Enabled_Counter_115_759
37
	let
38
		Out1_1 = pre_Out1_1;
39
		Out2_1 = pre_Out2_1;
40
	tel
41

    
42

    
43
	tel
44

    
45
	state Inactive_Enabled_Counter_115_759:
46
	unless _isEnabled resume Active_Enabled_Counter_115_759
47
	let
48
		Out1_1 = pre_Out1_1;
49
		Out2_1 = pre_Out2_1;
50
	tel
51

    
52

    
53
tel
54

    
55
(*
56
Original block name: TriggeredEnabled_Subsystem_PP/Enabled_Counter
57
*)
58
node  Enabled_Counter_115_759(In1_1 : real;
59
	__time_step : real;
60
	__nb_step : int;)
61
returns(Out1_1 : real;
62
	Out2_1 : real;);
63
var Add_1 : real;
64
	UnitDelay_1 : real;
65
let
66
	Add_1 = 0.0 + In1_1 + UnitDelay_1;
67
	UnitDelay_1 = (0.000000000000000 -> (pre Add_1));
68
	Out1_1 = Add_1;
69
	Out2_1 = UnitDelay_1;
70
tel
71

    
72
(*
73
Original block name: TriggeredEnabled_Subsystem_PP/case_held_held_held
74
*)
75
node  case_held_held_held_130_534_automaton(Cpre_compx_1 : real;
76
	Enable_1 : real;
77
	_isEnabled : bool;
78
	_isTriggered : bool;
79
	__time_step : real;
80
	__nb_step : int;)
81
returns(Ccor_x_1 : real;
82
	pre_x_1 : real;
83
	Out1_1 : real;);
84
var pre_Ccor_x_1 : real;
85
	pre_pre_x_1 : real;
86
	pre_Out1_1 : real;
87
let
88
	pre_Ccor_x_1 = if (__nb_step > 0) then
89
		(pre Ccor_x_1)
90
	    else 0.000000000000000;
91
	pre_pre_x_1 = if (__nb_step > 0) then
92
		(pre pre_x_1)
93
	    else 0.000000000000000;
94
	pre_Out1_1 = if (__nb_step > 0) then
95
		(pre Out1_1)
96
	    else 0.000000000000000;
97
	automaton enabled_case_held_held_held_130_534
98
	state Active_case_held_held_held_130_534:
99
	unless (not _isEnabled) restart Inactive_case_held_held_held_130_534
100
	let
101
		automaton triggered_case_held_held_held_130_534
102
	state Active_triggered_case_held_held_held_130_534:
103
	unless (not _isTriggered) resume Inactive_triggered_case_held_held_held_130_534
104
	let
105
		(Ccor_x_1, pre_x_1, Out1_1) = case_held_held_held_130_534(Cpre_compx_1, Enable_1, __time_step, __nb_step);
106
	tel
107

    
108
	state Inactive_triggered_case_held_held_held_130_534:
109
	unless _isTriggered resume Active_triggered_case_held_held_held_130_534
110
	let
111
		Ccor_x_1 = pre_Ccor_x_1;
112
		pre_x_1 = pre_pre_x_1;
113
		Out1_1 = pre_Out1_1;
114
	tel
115

    
116

    
117
	tel
118

    
119
	state Inactive_case_held_held_held_130_534:
120
	unless _isEnabled resume Active_case_held_held_held_130_534
121
	let
122
		Ccor_x_1 = pre_Ccor_x_1;
123
		pre_x_1 = pre_pre_x_1;
124
		Out1_1 = pre_Out1_1;
125
	tel
126

    
127

    
128
tel
129

    
130
(*
131
Original block name: TriggeredEnabled_Subsystem_PP/case_held_held_held
132
*)
133
node  case_held_held_held_130_534(Cpre_compx_1 : real;
134
	Enable_1 : real;
135
	__time_step : real;
136
	__nb_step : int;)
137
returns(Ccor_x_1 : real;
138
	pre_x_1 : real;
139
	Out1_1 : real;);
140
var Add_1 : real;
141
	UnitDelay_1 : real;
142
let
143
	Add_1 = 0.0 + Cpre_compx_1 + UnitDelay_1;
144
	UnitDelay_1 = (0.000000000000000 -> (pre Add_1));
145
	Ccor_x_1 = Add_1;
146
	pre_x_1 = UnitDelay_1;
147
	Out1_1 = Enable_1;
148
tel
149

    
150
(*
151
Original block name: TriggeredEnabled_Subsystem_PP
152
*)
153
node  TriggeredEnabled_Subsystem_PP(In1_1 : real;
154
	Enable_1 : real;
155
	Trigger_1 : real;)
156
returns(Out1_1 : real;
157
	Out2_1 : real;
158
	Out4_1 : real;
159
	pre_Out1_1 : real;
160
	Out8_1 : real;);
161
var ExecutionCond_of_Enabled_Counter_115_759 : bool;
162
	TriggerCond_of_Enabled_Counter_115_759 : bool;
163
	EnableCond_of_Enabled_Counter_115_759 : bool;
164
	Enabled_Counter_1 : real;
165
	Enabled_Counter_2 : real;
166
	ExecutionCond_of_case_held_held_held_130_534 : bool;
167
	TriggerCond_of_case_held_held_held_130_534 : bool;
168
	EnableCond_of_case_held_held_held_130_534 : bool;
169
	case_held_held_held_1 : real;
170
	case_held_held_held_2 : real;
171
	case_held_held_held_3 : real;
172
	__time_step : real;
173
	__nb_step : int;
174
let
175
	EnableCond_of_Enabled_Counter_115_759 = (Enable_1 > 0.0);
176
	TriggerCond_of_Enabled_Counter_115_759 = (false -> ((Trigger_1 > 0.0) and (not (pre (Trigger_1 > 0.0)))));
177
	ExecutionCond_of_Enabled_Counter_115_759 = (EnableCond_of_Enabled_Counter_115_759 and TriggerCond_of_Enabled_Counter_115_759);
178
	(Enabled_Counter_1, Enabled_Counter_2) = Enabled_Counter_115_759_automaton(In1_1, EnableCond_of_Enabled_Counter_115_759, TriggerCond_of_Enabled_Counter_115_759, __time_step, __nb_step);
179
	EnableCond_of_case_held_held_held_130_534 = (Enable_1 > 0.0);
180
	TriggerCond_of_case_held_held_held_130_534 = (false -> ((Trigger_1 > 0.0) and (not (pre (Trigger_1 > 0.0)))));
181
	ExecutionCond_of_case_held_held_held_130_534 = (EnableCond_of_case_held_held_held_130_534 and TriggerCond_of_case_held_held_held_130_534);
182
	(case_held_held_held_1, case_held_held_held_2, case_held_held_held_3) = case_held_held_held_130_534_automaton(In1_1, Enable_1, EnableCond_of_case_held_held_held_130_534, TriggerCond_of_case_held_held_held_130_534, __time_step, __nb_step);
183
	Out1_1 = Enabled_Counter_1;
184
	Out2_1 = Enabled_Counter_2;
185
	Out4_1 = case_held_held_held_1;
186
	pre_Out1_1 = case_held_held_held_2;
187
	Out8_1 = case_held_held_held_3;
188
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
189
	__nb_step = (0 -> ((pre __nb_step) + 1));
190
tel
191