<s> iochannel = CoramIoChannel ( idx = <NUM_LIT:0> , datawidth = <NUM_LIT:32> ) <EOL> channel = CoramChannel ( idx = <NUM_LIT:0> , datawidth = <NUM_LIT:32> ) <EOL> heap_offset = <NUM_LIT:0> <EOL> start_addr = <NUM_LIT:0> <EOL> goal_addr = <NUM_LIT:0> <EOL> def wait_start ( ) : <EOL> global heap_offset <EOL> global start_addr <EOL> global goal_addr <EOL> heap_offset = iochannel . read ( ) <EOL> start_addr = iochannel . read ( ) <EOL> goal_addr = iochannel . read ( ) <EOL> print ( '<STR_LIT>' % heap_offset ) <EOL> print ( '<STR_LIT>' % start_addr ) <EOL> print ( '<STR_LIT>' % goal_addr ) <EOL> def find_shortest_path ( ) : <EOL> channel . write ( heap_offset ) <EOL> channel . write ( start_addr ) <EOL> channel . write ( goal_addr ) <EOL> cost = channel . read ( ) <EOL> return cost <EOL> def get_cycles ( ) : <EOL> cycles = channel . read ( ) <EOL> return cycles <EOL> def return_answer ( cost , cycles ) : <EOL> print ( '<STR_LIT>' , cost ) <EOL> print ( '<STR_LIT>' , cycles ) <EOL> iochannel . write ( cost ) <EOL> iochannel . write ( cycles ) <EOL> def main ( ) : <EOL> wait_start ( ) <EOL> cost = find_shortest_path ( ) <EOL> cycles = get_cycles ( ) <EOL> return_answer ( cost , cycles ) <EOL> while True : <EOL> main ( ) </s>
