Project

General

Profile

Bug #72 » TriggeredEnabled_Subsystem2.LUSTREC.lus

Hamza Bourbouh, 03/22/2019 03:52 AM

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

    
3
-- Compiler: Lustre compiler 2 (nasa_toLustre.ToLustre.m)
4
-- Time: 12-Mar-2019 22:09:05
5
(*
6
Original block name: TriggeredEnabled_Subsystem2/Enabled_Counter
7
*)
8
node  Enabled_Counter_11_121(In1_1 : real;
9
	__time_step : real;
10
	__nb_step : int;)
11
returns(Out1_1 : real;
12
	Out2_1 : real;);
13
var Add_1 : real;
14
	UnitDelay_1 : real;
15
let
16
	Add_1 = 0.0 + In1_1 + UnitDelay_1;
17
	UnitDelay_1 = (0.0 -> (pre Add_1));
18
	Out1_1 = Add_1;
19
	Out2_1 = UnitDelay_1;
20
tel
21
node  Enabled_Counter_11_121_triggeredSS(In1_1 : real;
22
	_isEnabled : bool;
23
	_isTriggered : bool;
24
	__time_step : real;
25
	__nb_step : int;)
26
returns(Out1_1 : real;
27
	Out2_1 : real;);
28
var pre_Out1_1 : real;
29
	pre_Out2_1 : real;
30
	_isTriggered_clock : bool clock;
31
let
32
	pre_Out1_1 = if (__nb_step > 0) then
33
		(pre Out1_1)
34
	    else 0.0;
35
	pre_Out2_1 = if (__nb_step > 0) then
36
		(pre Out2_1)
37
	    else 0.0;
38
	_isTriggered_clock = _isTriggered;
39
	(Out1_1, Out2_1) = (merge _isTriggered_clock 
40
		(true -> Enabled_Counter_11_121((In1_1 when _isTriggered_clock), (__time_step when _isTriggered_clock), (__nb_step when _isTriggered_clock))) 
41
		(false -> (pre_Out1_1, pre_Out2_1) when false(_isTriggered_clock)));
42
tel
43

    
44

    
45
node  Enabled_Counter_11_121_condExecSS(In1_1 : real;
46
	_isEnabled : bool;
47
	_isTriggered : bool;
48
	__time_step : real;
49
	__nb_step : int;)
50
returns(Out1_1 : real;
51
	Out2_1 : real;);
52
var pre_Out1_1 : real;
53
	pre_Out2_1 : real;
54
	_isEnabled_clock : bool clock;
55
let
56
	pre_Out1_1 = if (__nb_step > 0) then
57
		(pre Out1_1)
58
	    else 0.0;
59
	pre_Out2_1 = if (__nb_step > 0) then
60
		(pre Out2_1)
61
	    else 0.0;
62
	_isEnabled_clock = _isEnabled;
63
	(Out1_1, Out2_1) = (merge _isEnabled_clock 
64
		(true -> (Enabled_Counter_11_121_triggeredSS((In1_1 when _isEnabled_clock), (_isEnabled when _isEnabled_clock), (_isTriggered when _isEnabled_clock), (__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock)) every (false -> (_isEnabled_clock and (not (pre _isEnabled_clock)))))) 
65
		(false -> (pre_Out1_1, pre_Out2_1) when false(_isEnabled_clock)));
66
tel
67

    
68

    
69
(*
70

    
71
node  TriggeredEnabled_Subsystem2(In1_1 : real;
72
	Enable_1 : bool;
73
	Trigger_1 : bool;)
74
returns(Out1_1 : real;
75
	Out2_1 : real;);
76
var ExecutionCond_of_Enabled_Counter_11_121 : bool;
77
	TriggerCond_of_Enabled_Counter_11_121 : bool;
78
	EnableCond_of_Enabled_Counter_11_121 : bool;
79
	Enabled_Counter_1 : real;
80
	Enabled_Counter_2 : real;
81
	__time_step : real;
82
	__nb_step : int;
83
let
84
	EnableCond_of_Enabled_Counter_11_121 = Enable_1;
85
	TriggerCond_of_Enabled_Counter_11_121 = (false -> (Trigger_1 and (not (pre Trigger_1))));
86
	ExecutionCond_of_Enabled_Counter_11_121 = (EnableCond_of_Enabled_Counter_11_121 and TriggerCond_of_Enabled_Counter_11_121);
87
	(Enabled_Counter_1, Enabled_Counter_2) = Enabled_Counter_11_121_condExecSS(In1_1, EnableCond_of_Enabled_Counter_11_121, TriggerCond_of_Enabled_Counter_11_121, __time_step, __nb_step);
88
	Out1_1 = Enabled_Counter_1;
89
	Out2_1 = Enabled_Counter_2;
90
	__time_step = (0.0 -> ((pre __time_step) + 1.0));
91
	__nb_step = (0 -> ((pre __nb_step) + 1));
92
tel
93

    
94
*)
(1-1/2)