How can we verify a memory whose address location is swapped

In reply to RonakShah:

In reply to debashis_paul:
You can fill up entire memory with address as data pattern and read back entire memory with return data as address value
so have test list this
Address value Data value
0x0 → 0x0
0x1 → 0x1
0x20 → 0x20
and so on.
your read data will mismatch and catch this issue.

Still in this algorithm, since the address location is swapped, we will get the data that we have written … so when we right 'h20 to address 0x20, it will write in 0x40, and when we read from 0x20, it will read from 0x40, but data will be same as 20, so it will match.