Project

General

Profile

Download (1.24 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:40:39
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  int_to_int8(x : int;)
23
returns(y : int;);
24
let
25
	y = if (x > 127) then
26
		(-128 + rem_int_int(( x - 127 - 1 ), 256))
27
	    else if (x < -128) then
28
		(127 + rem_int_int(( x + 128 + 1 ), 256))
29
	    else x;
30
tel
31

    
32
(*
33
Original block name: Ground
34
*)
35
node  Ground(In1_1 : int;
36
	In2_1 : real;
37
	In3_1 : bool;)
38
returns(Out1_1 : int;
39
	Out2_1 : real;
40
	Out3_1 : bool;);
41
var Add_1 : int;
42
	Add1_1 : real;
43
	Ground_1 : int;
44
	Ground1_1 : real;
45
	Ground2_1 : bool;
46
	LogicalOperator_1 : bool;
47
	__time_step : real;
48
	__nb_step : int;
49
let
50
	Add_1 = int_to_int8(0 + In1_1 + Ground_1);
51
	Add1_1 = 0.0 + In2_1 + Ground1_1;
52
	Ground_1 = 0;
53
	Ground1_1 = 0.0;
54
	Ground2_1 = false;
55
	LogicalOperator_1 = ( In3_1 and Ground2_1 );
56
	Out1_1 = Add_1;
57
	Out2_1 = Add1_1;
58
	Out3_1 = LogicalOperator_1;
59
	__time_step = (0.0 -> ((pre __time_step) + 0.100000000000000));
60
	__nb_step = (0 -> ((pre __nb_step) + 1));
61
tel
62

    
(781-781/1153)