<s> DATA_SIZE = <NUM_LIT> * <NUM_LIT> <EOL> RAM_SIZE = <NUM_LIT> * <NUM_LIT:16> <EOL> REPEAT = DATA_SIZE / RAM_SIZE <EOL> read_ram0 = CoramMemory ( <NUM_LIT:0> , <NUM_LIT:32> , RAM_SIZE ) <EOL> read_ram1 = CoramMemory ( <NUM_LIT:1> , <NUM_LIT:32> , RAM_SIZE ) <EOL> write_ram0 = CoramMemory ( <NUM_LIT:2> , <NUM_LIT:32> , RAM_SIZE ) <EOL> write_ram1 = CoramMemory ( <NUM_LIT:3> , <NUM_LIT:32> , RAM_SIZE ) <EOL> channel = CoramChannel ( <NUM_LIT:0> , <NUM_LIT:32> ) <EOL> def ctrl_thread ( ) : <EOL> read_addr = <NUM_LIT:0> <EOL> write_addr = DATA_SIZE * <NUM_LIT:4> <EOL> sum = <NUM_LIT:0> <EOL> read_ram0 . write_nonblocking ( <NUM_LIT:0> , read_addr , RAM_SIZE ) <EOL> read_ram0 . wait ( ) <EOL> channel . write ( read_addr ) <EOL> read_ram1 . write_nonblocking ( <NUM_LIT:0> , read_addr + RAM_SIZE * <NUM_LIT:4> , RAM_SIZE ) <EOL> read_ram1 . wait ( ) <EOL> channel . write ( read_addr + RAM_SIZE * <NUM_LIT:4> ) <EOL> for i in range ( ( REPEAT - <NUM_LIT:2> ) / <NUM_LIT:2> ) : <EOL> read_addr += RAM_SIZE * <NUM_LIT:4> * <NUM_LIT:2> <EOL> sum = channel . read ( ) <EOL> write_ram0 . read_nonblocking ( <NUM_LIT:0> , write_addr , RAM_SIZE ) <EOL> read_ram0 . write_nonblocking ( <NUM_LIT:0> , read_addr , RAM_SIZE ) <EOL> write_ram0 . wait ( ) <EOL> read_ram0 . wait ( ) <EOL> channel . write ( read_addr ) <EOL> sum = channel . read ( ) <EOL> write_ram1 . read_nonblocking ( <NUM_LIT:0> , write_addr + RAM_SIZE * <NUM_LIT:4> , RAM_SIZE ) <EOL> read_ram1 . write_nonblocking ( <NUM_LIT:0> , read_addr + RAM_SIZE * <NUM_LIT:4> , RAM_SIZE ) <EOL> write_ram1 . wait ( ) <EOL> read_ram1 . wait ( ) <EOL> channel . write ( read_addr + RAM_SIZE * <NUM_LIT:4> ) <EOL> write_addr += RAM_SIZE * <NUM_LIT:4> * <NUM_LIT:2> <EOL> sum = channel . read ( ) <EOL> write_ram0 . read_nonblocking ( <NUM_LIT:0> , write_addr , RAM_SIZE ) <EOL> write_ram0 . wait ( ) <EOL> sum = channel . read ( ) <EOL> write_ram1 . read_nonblocking ( <NUM_LIT:0> , write_addr + RAM_SIZE * <NUM_LIT:4> , RAM_SIZE ) <EOL> write_ram1 . wait ( ) <EOL> print ( '<STR_LIT>' , sum ) <EOL> ctrl_thread ( ) </s>
