Project

General

Profile

Download (2.46 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:21:33
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
node  _XOR_Bitwise_Unsigned_8(x : int;
33
	y : int;)
34
returns(z : int;);
35
let
36
	z = ( ((x + y) mod 2) + (2 * (((x / 2) + (y / 2)) mod 2)) + (4 * (((x / 4) + (y / 4)) mod 2)) + (8 * (((x / 8) + (y / 8)) mod 2)) + (16 * (((x / 16) + (y / 16)) mod 2)) + (32 * (((x / 32) + (y / 32)) mod 2)) + (64 * (((x / 64) + (y / 64)) mod 2)) + (128 * (((x / 128) + (y / 128)) mod 2)) );
37
tel
38

    
39
node  _XOR_Bitwise_Signed_8(x : int;
40
	y : int;)
41
returns(z : int;);
42
var x2 : int;
43
	y2 : int;
44
let
45
	x2 = if (x < 0) then
46
		(256 + x)
47
	    else x;
48
	y2 = if (y < 0) then
49
		(256 + y)
50
	    else y;
51
	z = int_to_int8(_XOR_Bitwise_Unsigned_8(x2, y2));
52
tel
53

    
54
(*
55
Original block name: BitwiseXOR_int8_PP
56
*)
57
node  BitwiseXOR_int8_PP(In1_1 : int;
58
	In2_1 : int;
59
	In3_1 : int;
60
	In4_1 : int;
61
	In4_2 : int;
62
	In4_3 : int;
63
	In5_1 : int;
64
	In5_2 : int;
65
	In5_3 : int;
66
	In6_1 : int;
67
	In6_2 : int;
68
	In6_3 : int;)
69
returns(Out1_1 : int;
70
	Out2_1 : int;
71
	Out2_2 : int;
72
	Out2_3 : int;
73
	Out3_1 : int;
74
	Out3_2 : int;
75
	Out3_3 : int;
76
	Out4_1 : int;);
77
var Bitwise_1 : int;
78
	Bitwise1_1 : int;
79
	Bitwise1_2 : int;
80
	Bitwise1_3 : int;
81
	Bitwise2_1 : int;
82
	Bitwise2_2 : int;
83
	Bitwise2_3 : int;
84
	Bitwise3_1 : int;
85
	__time_step : real;
86
	__nb_step : int;
87
let
88
	Bitwise_1 = _XOR_Bitwise_Signed_8(In1_1, In2_1);
89
	Bitwise1_1 = _XOR_Bitwise_Signed_8(In3_1, In4_1);
90
	Bitwise1_2 = _XOR_Bitwise_Signed_8(In3_1, In4_2);
91
	Bitwise1_3 = _XOR_Bitwise_Signed_8(In3_1, In4_3);
92
	Bitwise2_1 = _XOR_Bitwise_Signed_8(In5_1, 217);
93
	Bitwise2_2 = _XOR_Bitwise_Signed_8(In5_2, 217);
94
	Bitwise2_3 = _XOR_Bitwise_Signed_8(In5_3, 217);
95
	Bitwise3_1 = _XOR_Bitwise_Signed_8(In6_1, _XOR_Bitwise_Signed_8(In6_2, In6_3));
96
	Out1_1 = Bitwise_1;
97
	Out2_1 = Bitwise1_1;
98
	Out2_2 = Bitwise1_2;
99
	Out2_3 = Bitwise1_3;
100
	Out3_1 = Bitwise2_1;
101
	Out3_2 = Bitwise2_2;
102
	Out3_3 = Bitwise2_3;
103
	Out4_1 = Bitwise3_1;
104
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
105
	__nb_step = (0 -> ((pre __nb_step) + 1));
106
tel
107

    
(187-187/1153)