Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Simulink / src_many_files / DiscretePulseGenerator_sample_2_PP.LUSTREC.lus @ cd1faebc

History | View | Annotate | Download (9.15 KB)

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

    
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 23:10:45
5
node  abs_real(x : real;)
6
returns(y : real;);
7
let
8
	y = if (x >= 0.0) then
9
		x
10
	    else (- x);
11
tel
12

    
13
(*
14
Original block name: DiscretePulseGenerator_sample_2_PP/SignalBuilder
15
*)
16
node  SignalBuilder_63_839(__time_step : real;
17
	__nb_step : int;)
18
returns(Signal1_1 : real;
19
	Signal2_1 : real;);
20
var Demux_1 : real;
21
	Demux_2 : real;
22
	FromWs_1 : real;
23
	FromWs_2 : real;
24
	FromWs_73_874_time_1_1 : real;
25
	FromWs_73_874_data_1_1 : real;
26
	FromWs_73_874_time_1_2 : real;
27
	FromWs_73_874_data_1_2 : real;
28
	FromWs_73_874_time_1_3 : real;
29
	FromWs_73_874_data_1_3 : real;
30
	FromWs_73_874_time_2_1 : real;
31
	FromWs_73_874_data_2_1 : real;
32
	FromWs_73_874_time_2_2 : real;
33
	FromWs_73_874_data_2_2 : real;
34
	FromWs_73_874_time_2_3 : real;
35
	FromWs_73_874_data_2_3 : real;
36
let
37
	Demux_1 = FromWs_1;
38
	Demux_2 = FromWs_2;
39
	FromWs_73_874_time_1_1 = 0.000000000000000;
40
	FromWs_73_874_data_1_1 = 1.000000000000000;
41
	FromWs_73_874_time_1_2 = 1000.000000000000000;
42
	FromWs_73_874_data_1_2 = 1.000000000000000;
43
	FromWs_73_874_time_1_3 = 1000000.000000000000000;
44
	FromWs_73_874_data_1_3 = 1.000000000000000;
45
	FromWs_1 = if (((__time_step >= FromWs_73_874_time_1_1) or abs_real(__time_step - FromWs_73_874_time_1_1) <= 0.000000000000113686837721616030) and ((__time_step < FromWs_73_874_time_1_2) and abs_real(__time_step - FromWs_73_874_time_1_2) > 0.000000000000113686837721616030)) then
46
		(((FromWs_73_874_data_1_1 * (FromWs_73_874_time_1_2 - __time_step)) + (FromWs_73_874_data_1_2 * (__time_step - FromWs_73_874_time_1_1))) / (FromWs_73_874_time_1_2 - FromWs_73_874_time_1_1))
47
	    else (((FromWs_73_874_data_1_2 * (FromWs_73_874_time_1_3 - __time_step)) + (FromWs_73_874_data_1_3 * (__time_step - FromWs_73_874_time_1_2))) / (FromWs_73_874_time_1_3 - FromWs_73_874_time_1_2));
48
	FromWs_73_874_time_2_1 = 0.000000000000000;
49
	FromWs_73_874_data_2_1 = 2.000000000000000;
50
	FromWs_73_874_time_2_2 = 1000.000000000000000;
51
	FromWs_73_874_data_2_2 = 2.000000000000000;
52
	FromWs_73_874_time_2_3 = 1000000.000000000000000;
53
	FromWs_73_874_data_2_3 = 2.000000000000000;
54
	FromWs_2 = if (((__time_step >= FromWs_73_874_time_2_1) or abs_real(__time_step - FromWs_73_874_time_2_1) <= 0.000000000000113686837721616030) and ((__time_step < FromWs_73_874_time_2_2) and abs_real(__time_step - FromWs_73_874_time_2_2) > 0.000000000000113686837721616030)) then
55
		(((FromWs_73_874_data_2_1 * (FromWs_73_874_time_2_2 - __time_step)) + (FromWs_73_874_data_2_2 * (__time_step - FromWs_73_874_time_2_1))) / (FromWs_73_874_time_2_2 - FromWs_73_874_time_2_1))
56
	    else (((FromWs_73_874_data_2_2 * (FromWs_73_874_time_2_3 - __time_step)) + (FromWs_73_874_data_2_3 * (__time_step - FromWs_73_874_time_2_2))) / (FromWs_73_874_time_2_3 - FromWs_73_874_time_2_2));
57
	Signal1_1 = Demux_1;
58
	Signal2_1 = Demux_2;
59
tel
60

    
61
(*
62
Original block name: DiscretePulseGenerator_sample_2_PP
63
*)
64
node  DiscretePulseGenerator_sample_2_PP(_virtual : bool;)
65
returns(Out1_1 : real;
66
	Out2_1 : real;);
67
var SignalBuilder_1 : real;
68
	SignalBuilder_2 : real;
69
	SignalBuilder_63_839_time_1_1 : real;
70
	SignalBuilder_63_839_data_1_1 : real;
71
	SignalBuilder_63_839_time_1_2 : real;
72
	SignalBuilder_63_839_data_1_2 : real;
73
	SignalBuilder_63_839_time_1_3 : real;
74
	SignalBuilder_63_839_data_1_3 : real;
75
	SignalBuilder_63_839_time_1_4 : real;
76
	SignalBuilder_63_839_data_1_4 : real;
77
	SignalBuilder_63_839_time_1_5 : real;
78
	SignalBuilder_63_839_data_1_5 : real;
79
	SignalBuilder_63_839_time_1_6 : real;
80
	SignalBuilder_63_839_data_1_6 : real;
81
	SignalBuilder_63_839_time_1_7 : real;
82
	SignalBuilder_63_839_data_1_7 : real;
83
	SignalBuilder_63_839_time_2_1 : real;
84
	SignalBuilder_63_839_data_2_1 : real;
85
	SignalBuilder_63_839_time_2_2 : real;
86
	SignalBuilder_63_839_data_2_2 : real;
87
	SignalBuilder_63_839_time_2_3 : real;
88
	SignalBuilder_63_839_data_2_3 : real;
89
	SignalBuilder_63_839_time_2_4 : real;
90
	SignalBuilder_63_839_data_2_4 : real;
91
	SignalBuilder_63_839_time_2_5 : real;
92
	SignalBuilder_63_839_data_2_5 : real;
93
	__time_step : real;
94
	__nb_step : int;
95
let
96
	SignalBuilder_63_839_time_1_1 = 0.000000000000000;
97
	SignalBuilder_63_839_data_1_1 = -0.005000000000000;
98
	SignalBuilder_63_839_time_1_2 = 4.000000000000000;
99
	SignalBuilder_63_839_data_1_2 = 0.150000000000000;
100
	SignalBuilder_63_839_time_1_3 = 4.000000000000000;
101
	SignalBuilder_63_839_data_1_3 = 0.720000000000000;
102
	SignalBuilder_63_839_time_1_4 = 6.000000000000000;
103
	SignalBuilder_63_839_data_1_4 = 0.950000000000000;
104
	SignalBuilder_63_839_time_1_5 = 6.000000000000000;
105
	SignalBuilder_63_839_data_1_5 = 0.000000000000000;
106
	SignalBuilder_63_839_time_1_6 = 10.000000000000000;
107
	SignalBuilder_63_839_data_1_6 = 0.000000000000000;
108
	SignalBuilder_63_839_time_1_7 = 10000.000000000000000;
109
	SignalBuilder_63_839_data_1_7 = 0.000000000000000;
110
	SignalBuilder_1 = if (((__time_step >= SignalBuilder_63_839_time_1_1) or abs_real(__time_step - SignalBuilder_63_839_time_1_1) <= 0.000000000000000888178419700125) and ((__time_step < SignalBuilder_63_839_time_1_2) and abs_real(__time_step - SignalBuilder_63_839_time_1_2) > 0.000000000000000888178419700125)) then
111
		(((SignalBuilder_63_839_data_1_1 * (SignalBuilder_63_839_time_1_2 - __time_step)) + (SignalBuilder_63_839_data_1_2 * (__time_step - SignalBuilder_63_839_time_1_1))) / (SignalBuilder_63_839_time_1_2 - SignalBuilder_63_839_time_1_1))
112
	    else if (((__time_step >= SignalBuilder_63_839_time_1_3) or abs_real(__time_step - SignalBuilder_63_839_time_1_3) <= 0.000000000000000888178419700125) and ((__time_step < SignalBuilder_63_839_time_1_4) and abs_real(__time_step - SignalBuilder_63_839_time_1_4) > 0.000000000000000888178419700125)) then
113
		(((SignalBuilder_63_839_data_1_3 * (SignalBuilder_63_839_time_1_4 - __time_step)) + (SignalBuilder_63_839_data_1_4 * (__time_step - SignalBuilder_63_839_time_1_3))) / (SignalBuilder_63_839_time_1_4 - SignalBuilder_63_839_time_1_3))
114
	    else if (((__time_step >= SignalBuilder_63_839_time_1_5) or abs_real(__time_step - SignalBuilder_63_839_time_1_5) <= 0.000000000000001776356839400250) and ((__time_step < SignalBuilder_63_839_time_1_6) and abs_real(__time_step - SignalBuilder_63_839_time_1_6) > 0.000000000000001776356839400250)) then
115
		(((SignalBuilder_63_839_data_1_5 * (SignalBuilder_63_839_time_1_6 - __time_step)) + (SignalBuilder_63_839_data_1_6 * (__time_step - SignalBuilder_63_839_time_1_5))) / (SignalBuilder_63_839_time_1_6 - SignalBuilder_63_839_time_1_5))
116
	    else if (((__time_step >= SignalBuilder_63_839_time_1_6) or abs_real(__time_step - SignalBuilder_63_839_time_1_6) <= 0.000000000001818989403545856476) and ((__time_step < SignalBuilder_63_839_time_1_7) and abs_real(__time_step - SignalBuilder_63_839_time_1_7) > 0.000000000001818989403545856476)) then
117
		(((SignalBuilder_63_839_data_1_6 * (SignalBuilder_63_839_time_1_7 - __time_step)) + (SignalBuilder_63_839_data_1_7 * (__time_step - SignalBuilder_63_839_time_1_6))) / (SignalBuilder_63_839_time_1_7 - SignalBuilder_63_839_time_1_6))
118
	    else SignalBuilder_63_839_data_1_7;
119
	SignalBuilder_63_839_time_2_1 = 0.000000000000000;
120
	SignalBuilder_63_839_data_2_1 = 0.000000000000000;
121
	SignalBuilder_63_839_time_2_2 = 5.000000000000000;
122
	SignalBuilder_63_839_data_2_2 = 0.000000000000000;
123
	SignalBuilder_63_839_time_2_3 = 5.000000000000000;
124
	SignalBuilder_63_839_data_2_3 = 1.000000000000000;
125
	SignalBuilder_63_839_time_2_4 = 10.000000000000000;
126
	SignalBuilder_63_839_data_2_4 = 1.000000000000000;
127
	SignalBuilder_63_839_time_2_5 = 10000.000000000000000;
128
	SignalBuilder_63_839_data_2_5 = 1.000000000000000;
129
	SignalBuilder_2 = if (((__time_step >= SignalBuilder_63_839_time_2_1) or abs_real(__time_step - SignalBuilder_63_839_time_2_1) <= 0.000000000000000888178419700125) and ((__time_step < SignalBuilder_63_839_time_2_2) and abs_real(__time_step - SignalBuilder_63_839_time_2_2) > 0.000000000000000888178419700125)) then
130
		(((SignalBuilder_63_839_data_2_1 * (SignalBuilder_63_839_time_2_2 - __time_step)) + (SignalBuilder_63_839_data_2_2 * (__time_step - SignalBuilder_63_839_time_2_1))) / (SignalBuilder_63_839_time_2_2 - SignalBuilder_63_839_time_2_1))
131
	    else if (((__time_step >= SignalBuilder_63_839_time_2_3) or abs_real(__time_step - SignalBuilder_63_839_time_2_3) <= 0.000000000000001776356839400250) and ((__time_step < SignalBuilder_63_839_time_2_4) and abs_real(__time_step - SignalBuilder_63_839_time_2_4) > 0.000000000000001776356839400250)) then
132
		(((SignalBuilder_63_839_data_2_3 * (SignalBuilder_63_839_time_2_4 - __time_step)) + (SignalBuilder_63_839_data_2_4 * (__time_step - SignalBuilder_63_839_time_2_3))) / (SignalBuilder_63_839_time_2_4 - SignalBuilder_63_839_time_2_3))
133
	    else if (((__time_step >= SignalBuilder_63_839_time_2_4) or abs_real(__time_step - SignalBuilder_63_839_time_2_4) <= 0.000000000001818989403545856476) and ((__time_step < SignalBuilder_63_839_time_2_5) and abs_real(__time_step - SignalBuilder_63_839_time_2_5) > 0.000000000001818989403545856476)) then
134
		(((SignalBuilder_63_839_data_2_4 * (SignalBuilder_63_839_time_2_5 - __time_step)) + (SignalBuilder_63_839_data_2_5 * (__time_step - SignalBuilder_63_839_time_2_4))) / (SignalBuilder_63_839_time_2_5 - SignalBuilder_63_839_time_2_4))
135
	    else SignalBuilder_63_839_data_2_5;
136
	Out1_1 = SignalBuilder_1;
137
	Out2_1 = SignalBuilder_2;
138
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
139
	__nb_step = (0 -> ((pre __nb_step) + 1));
140
tel
141