<s> from migen import * <EOL> class Mem ( Module ) : <EOL> def __init__ ( self ) : <EOL> self . specials . mem = Memory ( <NUM_LIT:16> , <NUM_LIT:2> ** <NUM_LIT:12> , init = list ( range ( <NUM_LIT:20> ) ) ) <EOL> def memory_test ( dut ) : <EOL> for i in range ( <NUM_LIT:5> ) : <EOL> yield dut . mem [ i ] . eq ( <NUM_LIT> + i ) <EOL> yield <EOL> for i in range ( <NUM_LIT:10> ) : <EOL> value = yield dut . mem [ i ] <EOL> print ( value ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> dut = Mem ( ) <EOL> run_simulation ( dut , memory_test ( dut ) ) </s>
