lustrec/test/src/clocks/oversampling0.lus @ b8ae1bbc
1  

2 
node f(x :int ) returns (cpt , y :int ) 
3 
let

4 
y = x + 1; 
5 
cpt = (0 fby cpt) + 1; 
6 
tel

7  
8 
node g(x :int ; c : bool ) returns (out :int ) 
9 
var t, cpt , y, last_y :int; 
10 
let

11 
(cpt , y) = f(t); 
12 
t = merge c (true > x) (false > last_y when false(c)); 
13 
last_y = 0 fby y; 
14 
out = y when false(c); 
15 
tel

16 
(*

17 
node main (x:int) returns (out :int; c:bool)

18 
var toto:int;

19 
let

20 
toto = 1 ;

21 
c = true fby false fby c;

22 
out = g(x,toto=0);

23 
tel

24 
*)

 « Previous
 1
 2
 3
 Next »