Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (2.65 KB)

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

    
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 20-Sep-2018 14:53:13
5
(*
6
Original block name: TriggeredEnabled_Subsystem2/Enabled_Counter
7
*)
8
node  Enabled_Counter_9_066_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_9_066
25
	state Active_Enabled_Counter_9_066:
26
	unless (not _isEnabled) restart Inactive_Enabled_Counter_9_066
27
	let
28
		automaton triggered_Enabled_Counter_9_066
29
	state Active_triggered_Enabled_Counter_9_066:
30
	unless (not _isTriggered) resume Inactive_triggered_Enabled_Counter_9_066
31
	let
32
		(Out1_1, Out2_1) = Enabled_Counter_9_066(In1_1, __time_step, __nb_step);
33
	tel
34

    
35
	state Inactive_triggered_Enabled_Counter_9_066:
36
	unless _isTriggered resume Active_triggered_Enabled_Counter_9_066
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_9_066:
46
	unless _isEnabled restart Active_Enabled_Counter_9_066
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_Subsystem2/Enabled_Counter
57
*)
58
node  Enabled_Counter_9_066(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_Subsystem2
74
*)
75
node  TriggeredEnabled_Subsystem2(In1_1 : real;
76
	Enable_1 : bool;
77
	Trigger_1 : bool;)
78
returns(Out1_1 : real;
79
	Out2_1 : real;);
80
var ExecutionCond_of_Enabled_Counter_9_066 : bool;
81
	TriggerCond_of_Enabled_Counter_9_066 : bool;
82
	EnableCond_of_Enabled_Counter_9_066 : bool;
83
	Enabled_Counter_1 : real;
84
	Enabled_Counter_2 : real;
85
	__time_step : real;
86
	__nb_step : int;
87
let
88
	EnableCond_of_Enabled_Counter_9_066 = Enable_1;
89
	TriggerCond_of_Enabled_Counter_9_066 = (false -> (Trigger_1 and (not (pre Trigger_1))));
90
	ExecutionCond_of_Enabled_Counter_9_066 = (EnableCond_of_Enabled_Counter_9_066 and TriggerCond_of_Enabled_Counter_9_066);
91
	(Enabled_Counter_1, Enabled_Counter_2) = Enabled_Counter_9_066_automaton(In1_1, EnableCond_of_Enabled_Counter_9_066, TriggerCond_of_Enabled_Counter_9_066, __time_step, __nb_step);
92
	Out1_1 = Enabled_Counter_1;
93
	Out2_1 = Enabled_Counter_2;
94
	__time_step = (0.0 -> ((pre __time_step) + 1.000000000000000));
95
	__nb_step = (0 -> ((pre __nb_step) + 1));
96
tel
97