minimac refactor: move memory code to memory.py and add checks
minimac refactor: recode minimac_sync.v with Migen