## lustrec / optim / oversampling / oversampling0.lus @ 6a93d814

History | View | Annotate | Download (438 Bytes)

1 | 6a93d814 | xthirioux | |
---|---|---|---|

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(c:bool clock; x:int) 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 = toto = 0 (*true fby false fby c*); |
||

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

23 | tel |
||

24 | *) |