<s> import sys <EOL> import os <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . dirname ( os . path . dirname ( os . path . dirname ( os . path . dirname ( os . path . abspath ( __file__ ) ) ) ) ) ) <EOL> from pycoram . pycoram import * <EOL> def fib ( v ) : <EOL> if v <= <NUM_LIT:0> : return <NUM_LIT:0> <EOL> if v == <NUM_LIT:1> : return <NUM_LIT:1> <EOL> r0 = <NUM_LIT:0> <EOL> r1 = <NUM_LIT:1> <EOL> for i in range ( v - <NUM_LIT:1> ) : <EOL> prev_r1 = r1 <EOL> r1 = r0 + r1 <EOL> r0 = prev_r1 <EOL> return r1 <EOL> def ctrl_thread ( ) : <EOL> iochannel = CoramIoChannel ( idx = <NUM_LIT:0> , datawidth = <NUM_LIT:32> ) <EOL> while True : <EOL> a = iochannel . read ( ) <EOL> rslt = fib ( a ) <EOL> iochannel . write ( rslt ) </s>
