Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (4.14 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:44:56
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_test3_PP/Subsystem1
15
*)
16
node  Subsystem1_18_600_condExecSS(In1_1 : real;
17
	Enable_1 : bool;
18
	_isEnabled : bool;
19
	__time_step : real;
20
	__nb_step : int;)
21
returns(Out1_1 : real;);
22
var pre_Out1_1 : real;
23
	_isEnabled_clock : bool clock;
24
let
25
	pre_Out1_1 = if (__nb_step > 0) then
26
		(pre Out1_1)
27
	    else 0.0;
28
	_isEnabled_clock = _isEnabled;
29
	Out1_1 = (merge _isEnabled_clock 
30
		(true -> (Subsystem1_18_600((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)))))) 
31
		(false -> (pre_Out1_1) when false(_isEnabled_clock)));
32
tel
33

    
34
(*
35
Original block name: enable_test3_PP/Subsystem1
36
*)
37
node  Subsystem1_18_600(In1_1 : real;
38
	Enable_1 : bool;
39
	__time_step : real;
40
	__nb_step : int;)
41
returns(Out1_1 : real;);
42
var Add_1 : real;
43
	UnitDelay_1 : real;
44
let
45
	Add_1 = 0.0 + bool_to_real(Enable_1) + In1_1;
46
	UnitDelay_1 = (0.0 -> (pre Add_1));
47
	Out1_1 = UnitDelay_1;
48
tel
49

    
50
(*
51
Original block name: enable_test3_PP/Subsystem2
52
*)
53
node  Subsystem2_47_603_condExecSS(In1_1 : real;
54
	Enable_1 : bool;
55
	_isEnabled : bool;
56
	__time_step : real;
57
	__nb_step : int;)
58
returns(Out1_1 : real;);
59
var pre_Out1_1 : real;
60
	_isEnabled_clock : bool clock;
61
let
62
	pre_Out1_1 = if (__nb_step > 0) then
63
		(pre Out1_1)
64
	    else 0.0;
65
	_isEnabled_clock = _isEnabled;
66
	Out1_1 = (merge _isEnabled_clock 
67
		(true -> (Subsystem2_47_603((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)))))) 
68
		(false -> (pre_Out1_1) when false(_isEnabled_clock)));
69
tel
70

    
71
(*
72
Original block name: enable_test3_PP/Subsystem2
73
*)
74
node  Subsystem2_47_603(In1_1 : real;
75
	Enable_1 : bool;
76
	__time_step : real;
77
	__nb_step : int;)
78
returns(Out1_1 : real;);
79
var Add_1 : real;
80
	Memory_1 : real;
81
let
82
	Add_1 = 0.0 + bool_to_real(Enable_1) + In1_1;
83
	Memory_1 = (0.0 -> (pre Add_1));
84
	Out1_1 = Memory_1;
85
tel
86

    
87
(*
88
Original block name: enable_test3_PP/Subsystem3
89
*)
90
node  Subsystem3_69_360_condExecSS(In1_1 : real;
91
	Enable_1 : bool;
92
	_isEnabled : bool;
93
	__time_step : real;
94
	__nb_step : int;)
95
returns(Out1_1 : real;);
96
var pre_Out1_1 : real;
97
	_isEnabled_clock : bool clock;
98
let
99
	pre_Out1_1 = if (__nb_step > 0) then
100
		(pre Out1_1)
101
	    else 0.0;
102
	_isEnabled_clock = _isEnabled;
103
	Out1_1 = (merge _isEnabled_clock 
104
		(true -> Subsystem3_69_360((In1_1 when _isEnabled_clock), (Enable_1 when _isEnabled_clock), (__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock))) 
105
		(false -> (pre_Out1_1) when false(_isEnabled_clock)));
106
tel
107

    
108
(*
109
Original block name: enable_test3_PP/Subsystem3
110
*)
111
node  Subsystem3_69_360(In1_1 : real;
112
	Enable_1 : bool;
113
	__time_step : real;
114
	__nb_step : int;)
115
returns(Out1_1 : real;);
116
var Add_1 : real;
117
let
118
	Add_1 = 0.0 + bool_to_real(Enable_1) + In1_1;
119
	Out1_1 = Add_1;
120
tel
121

    
122
(*
123
Original block name: enable_test3_PP
124
*)
125
node  enable_test3_PP(In1_1 : real;
126
	In2_1 : bool;)
127
returns(Out1_1 : real;
128
	Out2_1 : real;
129
	Out3_1 : real;);
130
var ExecutionCond_of_Subsystem1_18_600 : bool;
131
	Subsystem1_1 : real;
132
	ExecutionCond_of_Subsystem2_47_603 : bool;
133
	Subsystem2_1 : real;
134
	ExecutionCond_of_Subsystem3_69_360 : bool;
135
	Subsystem3_1 : real;
136
	__time_step : real;
137
	__nb_step : int;
138
let
139
	ExecutionCond_of_Subsystem1_18_600 = In2_1;
140
	Subsystem1_1 = Subsystem1_18_600_condExecSS(In1_1, In2_1, ExecutionCond_of_Subsystem1_18_600, __time_step, __nb_step);
141
	ExecutionCond_of_Subsystem2_47_603 = In2_1;
142
	Subsystem2_1 = Subsystem2_47_603_condExecSS(In1_1, In2_1, ExecutionCond_of_Subsystem2_47_603, __time_step, __nb_step);
143
	ExecutionCond_of_Subsystem3_69_360 = In2_1;
144
	Subsystem3_1 = Subsystem3_69_360_condExecSS(In1_1, In2_1, ExecutionCond_of_Subsystem3_69_360, __time_step, __nb_step);
145
	Out1_1 = Subsystem1_1;
146
	Out2_1 = Subsystem2_1;
147
	Out3_1 = Subsystem3_1;
148
	__time_step = (0.0 -> ((pre __time_step) + 0.20));
149
	__nb_step = (0 -> ((pre __nb_step) + 1));
150
tel
151