Project

General

Profile

Download (3.85 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:03:52
5
node  abs_int(x : int;)
6
returns(y : int;);
7
let
8
	y = if (x >= 0) then
9
		x
10
	    else (- x);
11
tel
12

    
13
node  rem_int_int(x : int;
14
	y : int;)
15
returns(z : int;);
16
let
17
	z = if ((y = 0) or (x = 0)) then
18
		0
19
	    else ((x mod y) - (if (((x mod y) <> 0) and (x <= 0)) then abs_int(y) else 0));
20
tel
21

    
22
node  bool_to_int(x : bool;)
23
returns(y : int;);
24
let
25
	y = if x then
26
		1
27
	    else 0;
28
tel
29

    
30
node  int_to_int32(x : int;)
31
returns(y : int;);
32
let
33
	y = if (x > 2147483647) then
34
		(-2147483648 + rem_int_int(( x - 2147483647 - 1 ), 4294967296))
35
	    else if (x < -2147483648) then
36
		(2147483647 + rem_int_int(( x + 2147483648 + 1 ), 4294967296))
37
	    else x;
38
tel
39

    
40
node  int_to_uint8(x : int;)
41
returns(y : int;);
42
let
43
	y = if (x > 255) then
44
		(0 + rem_int_int(( x - 255 - 1 ), 256))
45
	    else if (x < 0) then
46
		(255 + rem_int_int(( x + 0 + 1 ), 256))
47
	    else x;
48
tel
49

    
50
(*
51
Original block name: goto_from_test_PP/Subsystem
52
*)
53
node  Subsystem_69_006(In1_1 : real;
54
	A_link_1 : real;
55
	__time_step : real;
56
	__nb_step : int;)
57
returns(Out1_1 : real;);
58
var Add_1 : real;
59
let
60
	Add_1 = 0.0 + In1_1 + A_link_1;
61
	Out1_1 = Add_1;
62
tel
63

    
64
(*
65
Original block name: goto_from_test_PP/Subsystem1
66
*)
67
node  Subsystem1_78_220(In1_1 : int;
68
	In1_2 : int;
69
	B_link_1 : int;
70
	B_link_2 : int;
71
	__time_step : real;
72
	__nb_step : int;)
73
returns(Out1_1 : int;
74
	Out1_2 : int;);
75
var Add_1 : int;
76
	Add_2 : int;
77
let
78
	Add_1 = int_to_int32(0 + In1_1 + B_link_1);
79
	Add_2 = int_to_int32(0 + In1_2 + B_link_2);
80
	Out1_1 = Add_1;
81
	Out1_2 = Add_2;
82
tel
83

    
84
(*
85
Original block name: goto_from_test_PP/Subsystem2
86
*)
87
node  Subsystem2_86_005(In1_1 : bool;
88
	In1_2 : bool;
89
	In1_3 : bool;
90
	In1_4 : bool;
91
	In1_5 : bool;
92
	In1_6 : bool;
93
	C_link_1 : bool;
94
	C_link_2 : bool;
95
	C_link_3 : bool;
96
	C_link_4 : bool;
97
	C_link_5 : bool;
98
	C_link_6 : bool;
99
	__time_step : real;
100
	__nb_step : int;)
101
returns(Out1_1 : int;
102
	Out1_2 : int;
103
	Out1_3 : int;
104
	Out1_4 : int;
105
	Out1_5 : int;
106
	Out1_6 : int;);
107
var Add_1 : int;
108
	Add_2 : int;
109
	Add_3 : int;
110
	Add_4 : int;
111
	Add_5 : int;
112
	Add_6 : int;
113
let
114
	Add_1 = int_to_uint8(0 + bool_to_int(In1_1) + bool_to_int(C_link_1));
115
	Add_2 = int_to_uint8(0 + bool_to_int(In1_2) + bool_to_int(C_link_2));
116
	Add_3 = int_to_uint8(0 + bool_to_int(In1_3) + bool_to_int(C_link_3));
117
	Add_4 = int_to_uint8(0 + bool_to_int(In1_4) + bool_to_int(C_link_4));
118
	Add_5 = int_to_uint8(0 + bool_to_int(In1_5) + bool_to_int(C_link_5));
119
	Add_6 = int_to_uint8(0 + bool_to_int(In1_6) + bool_to_int(C_link_6));
120
	Out1_1 = Add_1;
121
	Out1_2 = Add_2;
122
	Out1_3 = Add_3;
123
	Out1_4 = Add_4;
124
	Out1_5 = Add_5;
125
	Out1_6 = Add_6;
126
tel
127

    
128
(*
129
Original block name: goto_from_test_PP
130
*)
131
node  goto_from_test_PP(In1_1 : real;
132
	In2_1 : int;
133
	In2_2 : int;
134
	In3_1 : bool;
135
	In3_2 : bool;
136
	In3_3 : bool;
137
	In3_4 : bool;
138
	In3_5 : bool;
139
	In3_6 : bool;)
140
returns(Out1_1 : real;
141
	Out2_1 : int;
142
	Out2_2 : int;
143
	Out3_1 : int;
144
	Out3_2 : int;
145
	Out3_3 : int;
146
	Out3_4 : int;
147
	Out3_5 : int;
148
	Out3_6 : int;);
149
var Subsystem_1 : real;
150
	Subsystem1_1 : int;
151
	Subsystem1_2 : int;
152
	Subsystem2_1 : int;
153
	Subsystem2_2 : int;
154
	Subsystem2_3 : int;
155
	Subsystem2_4 : int;
156
	Subsystem2_5 : int;
157
	Subsystem2_6 : int;
158
	__time_step : real;
159
	__nb_step : int;
160
let
161
	Subsystem_1 = Subsystem_69_006(In1_1, In1_1, __time_step, __nb_step);
162
	(Subsystem1_1, Subsystem1_2) = Subsystem1_78_220(In2_1, In2_2, In2_1, In2_2, __time_step, __nb_step);
163
	(Subsystem2_1, Subsystem2_2, Subsystem2_3, Subsystem2_4, Subsystem2_5, Subsystem2_6) = Subsystem2_86_005(In3_1, In3_2, In3_3, In3_4, In3_5, In3_6, In3_1, In3_2, In3_3, In3_4, In3_5, In3_6, __time_step, __nb_step);
164
	Out1_1 = Subsystem_1;
165
	Out2_1 = Subsystem1_1;
166
	Out2_2 = Subsystem1_2;
167
	Out3_1 = Subsystem2_1;
168
	Out3_2 = Subsystem2_2;
169
	Out3_3 = Subsystem2_3;
170
	Out3_4 = Subsystem2_4;
171
	Out3_5 = Subsystem2_5;
172
	Out3_6 = Subsystem2_6;
173
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
174
	__nb_step = (0 -> ((pre __nb_step) + 1));
175
tel
176

    
(1069-1069/1153)