Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (1.03 KB)

1 4748b215 hbourbou
-- This file has been generated by CoCoSim2.
2
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 23:05:11
5
#open <conv>
6
node  abs_int(x : int;)
7
returns(y : int;);
8
let
9
	y = if (x >= 0) then
10
		x
11
	    else (- x);
12
tel
13
14
node  rem_int_int(x : int;
15
	y : int;)
16
returns(z : int;);
17
let
18
	z = if ((y = 0) or (x = 0)) then
19
		0
20
	    else ((x mod y) - (if (((x mod y) <> 0) and (x <= 0)) then abs_int(y) else 0));
21
tel
22
23
node  int_to_int32(x : int;)
24
returns(y : int;);
25
let
26
	y = if (x > 2147483647) then
27
		(-2147483648 + rem_int_int(( x - 2147483647 - 1 ), 4294967296))
28
	    else if (x < -2147483648) then
29
		(2147483647 + rem_int_int(( x + 2147483648 + 1 ), 4294967296))
30
	    else x;
31
tel
32
33
(*
34
Original block name: Sum10_PP
35
*)
36
node  Sum10_PP(In19_1 : real;
37
	In20_1 : int;)
38
returns(Out12_1 : int;);
39
var Add11_1 : int;
40
	__time_step : real;
41
	__nb_step : int;
42
let
43
	Add11_1 = int_to_int32(0 + int_to_int32(real_to_int(In19_1)) + In20_1);
44
	Out12_1 = Add11_1;
45
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
46
	__nb_step = (0 -> ((pre __nb_step) + 1));
47
tel