<s> INIT_BRAM_SIZE = <NUM_LIT> <EOL> INIT_DRAM_SIZE = <NUM_LIT> * <NUM_LIT> * <NUM_LIT> <EOL> DSIZE = <NUM_LIT:4> <EOL> init_memory = CoramMemory ( <NUM_LIT> , <NUM_LIT:32> , INIT_BRAM_SIZE ) <EOL> init_channel = CoramChannel ( <NUM_LIT> , <NUM_LIT:64> ) <EOL> def initialize ( ) : <EOL> init_channel . read ( ) <EOL> for dram_addr in range ( <NUM_LIT:0> , INIT_DRAM_SIZE , INIT_BRAM_SIZE * DSIZE ) : <EOL> init_channel . read ( <NUM_LIT:0> ) <EOL> init_memory . read ( <NUM_LIT:0> , dram_addr , INIT_BRAM_SIZE ) <EOL> if dram_addr >= INIT_DRAM_SIZE - ( INIT_BRAM_SIZE * DSIZE ) : <EOL> init_channel . write ( <NUM_LIT:1> ) <EOL> else : <EOL> init_channel . write ( <NUM_LIT:0> ) <EOL> def finalize ( ) : <EOL> init_channel . write ( <NUM_LIT:0> ) <EOL> DATA_SIZE = <NUM_LIT> * <NUM_LIT> * <NUM_LIT> <EOL> RAM_SIZE = <NUM_LIT> * <NUM_LIT:1> <EOL> USED_RAM_SIZE = <NUM_LIT> * <NUM_LIT:1> <EOL> SIMD_SIZE = <NUM_LIT:32> <EOL> REPEAT = ( ( DATA_SIZE / ( USED_RAM_SIZE * ( SIMD_SIZE / <NUM_LIT:8> ) ) ) - <NUM_LIT:2> ) / <NUM_LIT:2> <EOL> ram0 = CoramMemory ( <NUM_LIT:0> , SIMD_SIZE , RAM_SIZE ) <EOL> ram1 = CoramMemory ( <NUM_LIT:1> , SIMD_SIZE , RAM_SIZE ) <EOL> channel = CoramChannel ( <NUM_LIT:0> , <NUM_LIT:64> ) <EOL> def main ( ) : <EOL> print ( "<STR_LIT>" ) <EOL> read_addr = <NUM_LIT:0> <EOL> sum = <NUM_LIT:0> <EOL> ram0 . write_nonblocking ( <NUM_LIT:0> , read_addr + <NUM_LIT:0> * USED_RAM_SIZE * ( SIMD_SIZE / <NUM_LIT:8> ) , USED_RAM_SIZE ) <EOL> ram0 . wait ( ) <EOL> channel . write ( USED_RAM_SIZE ) <EOL> ram1 . write_nonblocking ( <NUM_LIT:0> , read_addr + <NUM_LIT:1> * USED_RAM_SIZE * ( SIMD_SIZE / <NUM_LIT:8> ) , USED_RAM_SIZE ) <EOL> ram1 . wait ( ) <EOL> channel . write ( USED_RAM_SIZE ) <EOL> for i in range ( REPEAT ) : <EOL> print ( "<STR_LIT>" % i ) <EOL> read_addr += ( USED_RAM_SIZE * ( SIMD_SIZE / <NUM_LIT:8> ) ) * <NUM_LIT:2> <EOL> sum = channel . read ( ) <EOL> ram0 . write_nonblocking ( <NUM_LIT:0> , read_addr , USED_RAM_SIZE ) <EOL> ram0 . wait ( ) <EOL> channel . write ( USED_RAM_SIZE ) <EOL> sum = channel . read ( ) <EOL> ram1 . write_nonblocking ( <NUM_LIT:0> , read_addr + USED_RAM_SIZE * ( SIMD_SIZE / <NUM_LIT:8> ) , USED_RAM_SIZE ) <EOL> ram1 . wait ( ) <EOL> channel . write ( USED_RAM_SIZE ) <EOL> sum = channel . read ( ) <EOL> sum = channel . read ( ) <EOL> print ( '<STR_LIT>' , sum ) <EOL> channel . write ( <NUM_LIT:0> ) <EOL> while True : <EOL> initialize ( ) <EOL> main ( ) <EOL> finalize ( ) </s>
