Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (2.68 KB)

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

    
3
-- Compiler: Lustre compiler 2 (nasa_toLustre.ToLustre.m)
4
-- Time: 12-Mar-2019 21:22:37
5
(*
6
Original block name: TriggeredEnabled_Subsystem2/Enabled_Counter
7
*)
8
node  Enabled_Counter_341_967(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 = 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

    
22
node  Enabled_Counter_341_967_triggeredSS(In1_1 : real;
23
	_isEnabled : bool;
24
	_isTriggered : bool;
25
	__time_step : real;
26
	__nb_step : int;)
27
returns(Out1_1 : real;
28
	Out2_1 : real;);
29
var pre_Out1_1 : real;
30
	pre_Out2_1 : real;
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
	(Out1_1, Out2_1) = merge(_isTriggered;
39
		 (activate Enabled_Counter_341_967 every _isTriggered)(In1_1, __time_step, __nb_step);
40
		(pre_Out1_1, pre_Out2_1));
41
tel
42

    
43
(*
44
Original block name: TriggeredEnabled_Subsystem2/Enabled_Counter
45
*)
46
node  Enabled_Counter_341_967_condExecSS(In1_1 : real;
47
	_isEnabled : bool;
48
	_isTriggered : bool;
49
	__time_step : real;
50
	__nb_step : int;)
51
returns(Out1_1 : real;
52
	Out2_1 : real;);
53
var pre_Out1_1 : real;
54
	pre_Out2_1 : real;
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
	(Out1_1, Out2_1) = merge(_isEnabled;
63
		 (activate Enabled_Counter_341_967_triggeredSS every _isEnabled restart every (false -> (_isEnabled and (not (pre _isEnabled)))))(In1_1, _isEnabled, _isTriggered, __time_step, __nb_step);
64
		(pre_Out1_1, pre_Out2_1));
65
tel
66

    
67
(*
68
Original block name: TriggeredEnabled_Subsystem2
69
*)
70
node  TriggeredEnabled_Subsystem2(In1_1 : real;
71
	Enable_1 : bool;
72
	Trigger_1 : bool;)
73
returns(Out1_1 : real;
74
	Out2_1 : real;);
75
var ExecutionCond_of_Enabled_Counter_341_967 : bool;
76
	TriggerCond_of_Enabled_Counter_341_967 : bool;
77
	EnableCond_of_Enabled_Counter_341_967 : bool;
78
	Enabled_Counter_1 : real;
79
	Enabled_Counter_2 : real;
80
	__time_step : real;
81
	__nb_step : int;
82
let
83
	EnableCond_of_Enabled_Counter_341_967 = Enable_1;
84
	TriggerCond_of_Enabled_Counter_341_967 = (false -> (Trigger_1 and (not (pre Trigger_1))));
85
	ExecutionCond_of_Enabled_Counter_341_967 = (EnableCond_of_Enabled_Counter_341_967 and TriggerCond_of_Enabled_Counter_341_967);
86
	(Enabled_Counter_1, Enabled_Counter_2) = Enabled_Counter_341_967_condExecSS(In1_1, EnableCond_of_Enabled_Counter_341_967, TriggerCond_of_Enabled_Counter_341_967, __time_step, __nb_step);
87
	Out1_1 = Enabled_Counter_1;
88
	Out2_1 = Enabled_Counter_2;
89
	__time_step = (0.0 -> ((pre __time_step) + 1.0));
90
	__nb_step = (0 -> ((pre __nb_step) + 1));
91
tel
92