patmos: some changes in memory stage