How can we verify a memory whose address location is swapped

In reply to debashis_paul:

I would say there are two test scenarios where this bug would be revealed:

1- You can implement a task that accesses the memory array itself (through the hierarchical path of the RTL) and checks its content after each read/write operation versus an expected data array in the testcase

2- After each write operation you should read back the whole memory array using the same interface and make sure that the data is written only in 0x20, not 0x20 & 0x40… Of course in your scenario this will not detect that 0x20 was never written. It will just raise an alarm that 0x40 was unnecessarily written.