Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Simulink / src_many_files / IF_with_EnabledSS_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: 19-Mar-2019 21:16:39
5
(*
6
Original block name: IF_with_EnabledSS_PP/ActionSubsystem1
7
*)
8
node  ActionSubsystem1_8_013_condExecSS(In1_1 : real;
9
	_isEnabled : bool;
10
	__time_step : real;
11
	__nb_step : int;)
12
returns(Out1_1 : real;);
13
var pre_Out1_1 : real;
14
	_isEnabled_clock : bool clock;
15
let
16
	pre_Out1_1 = if (__nb_step > 0) then
17
		(pre Out1_1)
18
	    else 0.0;
19
	_isEnabled_clock = _isEnabled;
20
	Out1_1 = (merge _isEnabled_clock 
21
		(true -> (ActionSubsystem1_8_013((In1_1 when _isEnabled_clock), (__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock)) every (false -> (_isEnabled_clock and (not (pre _isEnabled_clock)))))) 
22
		(false -> (pre_Out1_1) when false(_isEnabled_clock)));
23
tel
24

    
25
(*
26
Original block name: IF_with_EnabledSS_PP/ActionSubsystem1
27
*)
28
node  ActionSubsystem1_8_013(In1_1 : real;
29
	__time_step : real;
30
	__nb_step : int;)
31
returns(Out1_1 : real;);
32
var UnitDelay_1 : real;
33
let
34
	UnitDelay_1 = (0.0 -> (pre In1_1));
35
	Out1_1 = UnitDelay_1;
36
tel
37

    
38
(*
39
Original block name: IF_with_EnabledSS_PP/ActionSubsystem2
40
*)
41
node  ActionSubsystem2_15_018_condExecSS(In1_1 : real;
42
	_isEnabled : bool;
43
	__time_step : real;
44
	__nb_step : int;)
45
returns(Out1_1 : real;);
46
var pre_Out1_1 : real;
47
	_isEnabled_clock : bool clock;
48
let
49
	pre_Out1_1 = if (__nb_step > 0) then
50
		(pre Out1_1)
51
	    else 0.0;
52
	_isEnabled_clock = _isEnabled;
53
	Out1_1 = (merge _isEnabled_clock 
54
		(true -> ActionSubsystem2_15_018((In1_1 when _isEnabled_clock), (__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock))) 
55
		(false -> (pre_Out1_1) when false(_isEnabled_clock)));
56
tel
57

    
58
(*
59
Original block name: IF_with_EnabledSS_PP/ActionSubsystem2
60
*)
61
node  ActionSubsystem2_15_018(In1_1 : real;
62
	__time_step : real;
63
	__nb_step : int;)
64
returns(Out1_1 : real;);
65
var UnitDelay_1 : real;
66
let
67
	UnitDelay_1 = (0.0 -> (pre In1_1));
68
	Out1_1 = UnitDelay_1;
69
tel
70

    
71
(*
72
Original block name: IF_with_EnabledSS_PP/ActionSubsystem3
73
*)
74
node  ActionSubsystem3_22_022_condExecSS(In1_1 : real;
75
	_isEnabled : bool;
76
	__time_step : real;
77
	__nb_step : int;)
78
returns(Out1_1 : real;);
79
var pre_Out1_1 : real;
80
	_isEnabled_clock : bool clock;
81
let
82
	pre_Out1_1 = if (__nb_step > 0) then
83
		(pre Out1_1)
84
	    else 0.0;
85
	_isEnabled_clock = _isEnabled;
86
	Out1_1 = (merge _isEnabled_clock 
87
		(true -> ActionSubsystem3_22_022((In1_1 when _isEnabled_clock), (__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock))) 
88
		(false -> (pre_Out1_1) when false(_isEnabled_clock)));
89
tel
90

    
91
(*
92
Original block name: IF_with_EnabledSS_PP/ActionSubsystem3
93
*)
94
node  ActionSubsystem3_22_022(In1_1 : real;
95
	__time_step : real;
96
	__nb_step : int;)
97
returns(Out1_1 : real;);
98
var UnitDelay_1 : real;
99
let
100
	UnitDelay_1 = (0.0 -> (pre In1_1));
101
	Out1_1 = UnitDelay_1;
102
tel
103

    
104
(*
105
Original block name: IF_with_EnabledSS_PP
106
*)
107
node  IF_with_EnabledSS_PP(In1_1 : int;
108
	In1_2 : int;
109
	In1_3 : int;
110
	In2_1 : real;
111
	In3_1 : int;
112
	In3_2 : int;
113
	In3_3 : int;)
114
returns(Out1_1 : real;
115
	Out2_1 : real;
116
	Out3_1 : real;);
117
var ExecutionCond_of_ActionSubsystem1_8_013 : bool;
118
	ActionSubsystem1_1 : real;
119
	ExecutionCond_of_ActionSubsystem2_15_018 : bool;
120
	ActionSubsystem2_1 : real;
121
	ExecutionCond_of_ActionSubsystem3_22_022 : bool;
122
	ActionSubsystem3_1 : real;
123
	If2_1 : bool;
124
	If2_2 : bool;
125
	If2_3 : bool;
126
	__time_step : real;
127
	__nb_step : int;
128
let
129
	ExecutionCond_of_ActionSubsystem1_8_013 = If2_1;
130
	ActionSubsystem1_1 = ActionSubsystem1_8_013_condExecSS(In2_1, ExecutionCond_of_ActionSubsystem1_8_013, __time_step, __nb_step);
131
	ExecutionCond_of_ActionSubsystem2_15_018 = If2_2;
132
	ActionSubsystem2_1 = ActionSubsystem2_15_018_condExecSS(In2_1, ExecutionCond_of_ActionSubsystem2_15_018, __time_step, __nb_step);
133
	ExecutionCond_of_ActionSubsystem3_22_022 = If2_3;
134
	ActionSubsystem3_1 = ActionSubsystem3_22_022_condExecSS(In2_1, ExecutionCond_of_ActionSubsystem3_22_022, __time_step, __nb_step);
135
	(If2_1, If2_2, If2_3) = if In1_1 > 1 then
136
		(true, false, false)
137
	    else if In3_3 > 0 then
138
		(false, true, false)
139
	    else (false, false, true);
140
	Out1_1 = ActionSubsystem1_1;
141
	Out2_1 = ActionSubsystem2_1;
142
	Out3_1 = ActionSubsystem3_1;
143
	__time_step = (0.0 -> ((pre __time_step) + 0.020));
144
	__nb_step = (0 -> ((pre __nb_step) + 1));
145
tel
146