Memory data misplaced when initializing from .hex file
I`m using Quartus Prime 18.1 Lite, Model Sim 10.5 Starter, and Cyclone IV FPGA.
I`ve created a 1-PORT ROM from Basic Functions library, with 256 words of 16 bits. I`m trying to initialize it with following *.hex file:
:1000000000010002000300040005000600070008CC
:100010000010001A001B001C001D001E001F002005
:00000001FF
That represents following table:
However, when I simulate this memory component in ModelSim, memory content is misplaced, and I get 8-word wide gap of zero data:
And if I try to upload this to real FPGA, then I get exactly the same behaviour.
I`ve tried to verify my hex file by opening it in various hex viewers, and all of them read correct data.
I can`t use Quartus to edit and save hex file, because later I`ll initialize my memory with Atmel Studio generated files. These files also suffer from the same problem.
Is there any way to fix this? May be I need to use some file format convertor? And why, in first place, only Quartus/ModelSim read this file wrong, while any of 3rd-party viewers do it right?