Let cpu_[physical]_memory() calls pass a boolean 'is_write' argument