Project

General

Profile

Download (2.06 KB) Statistics
| Branch: | Tag: | Revision:
1
-- This file has been generated by CoCoSim2.
2

    
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 22:30:12
5
node  _make_clock(period : int;
6
	phase : int;)
7
returns(clk : bool;);
8
var count : int;
9
let
10
	count = (((period - phase) -> ((pre count) + 1)) mod period);
11
	clk = (count = 0);
12
tel
13

    
14
(*
15
Original block name: DigitalClock_PP/EnabledSubsystem
16
*)
17
node  EnabledSubsystem_22_500_automaton(_isEnabled : bool;
18
	__time_step : real;
19
	__nb_step : int;)
20
returns(Out1_1 : real;);
21
var pre_Out1_1 : real;
22
let
23
	pre_Out1_1 = if (__nb_step > 0) then
24
		(pre Out1_1)
25
	    else 0.000000000000000;
26
	automaton enabled_EnabledSubsystem_22_500
27
	state Active_EnabledSubsystem_22_500:
28
	unless (not _isEnabled) restart Inactive_EnabledSubsystem_22_500
29
	let
30
		Out1_1 = EnabledSubsystem_22_500(__time_step, __nb_step);
31
	tel
32

    
33
	state Inactive_EnabledSubsystem_22_500:
34
	unless _isEnabled restart Active_EnabledSubsystem_22_500
35
	let
36
		Out1_1 = pre_Out1_1;
37
	tel
38

    
39

    
40
tel
41

    
42
(*
43
Original block name: DigitalClock_PP/EnabledSubsystem
44
*)
45
node  EnabledSubsystem_22_500(__time_step : real;
46
	__nb_step : int;)
47
returns(Out1_1 : real;);
48
var DigitalClock_1 : real;
49
let
50
	DigitalClock_1 = if ((__nb_step mod 5) = 0) then
51
		__time_step
52
	    else if (__nb_step = 0) then
53
		0.0
54
	    else (pre DigitalClock_1);
55
	Out1_1 = DigitalClock_1;
56
tel
57

    
58
(*
59
Original block name: DigitalClock_PP
60
*)
61
node  DigitalClock_PP(In1_1 : real;)
62
returns(Out1_1 : real;
63
	Out2_1 : real;);
64
var DigitalClock_1 : real;
65
	ExecutionCond_of_EnabledSubsystem_22_500 : bool;
66
	EnabledSubsystem_1 : real;
67
	__time_step : real;
68
	__nb_step : int;
69
	_clk_5_0 : bool clock;
70
let
71
	DigitalClock_1 = if ((__nb_step mod 5) = 0) then
72
		__time_step
73
	    else if (__nb_step = 0) then
74
		0.0
75
	    else (pre DigitalClock_1);
76
	ExecutionCond_of_EnabledSubsystem_22_500 = (In1_1 > 0.0);
77
	EnabledSubsystem_1 = EnabledSubsystem_22_500_automaton(ExecutionCond_of_EnabledSubsystem_22_500, __time_step, __nb_step);
78
	Out1_1 = EnabledSubsystem_1;
79
	Out2_1 = DigitalClock_1;
80
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
81
	__nb_step = (0 -> ((pre __nb_step) + 1));
82
	_clk_5_0 = _make_clock(5, 0);
83
tel
84

    
(433-433/1153)