Forum Discussion

JPrig's avatar
JPrig
Icon for New Contributor rankNew Contributor
6 years ago

How to generate a .dat file for on-chip flash for simulation?

Hi,

I generated a User Flash Memory IP for a Max 10 device. In the wizard I chose to initialize the UFM from a user-defined file, which for simulation needs to be a .dat file.

However, I cannot figure out how to create such a file. I found something in the documentation for Nios II, but I do not use Nios II in my design. Is there other possibilities to create such a file?

Regards, Julia

4 Replies

  • You can use below code for your .dat file. Please try and see whether it works. 1. 00000000 2. 00000001 3. 00000002 4. 00000003 5. ... 6. ... 7. 000047FA 8. 000047FB 9. 000047FC 10. 000047FD 11. 000047FE 12. 000047FF
    • JPrig's avatar
      JPrig
      Icon for New Contributor rankNew Contributor

      Hi Shyan,

      thanks for the help, but unfortunately it did not work.

      The tool still complains that it cannot open the file, even though the file is in the same directory and the top-level UFM auto-generated file.

      Regards,

      Julia

  • Hi Julia, I have no idea how to generate .dat file nor i found information about format.

    Quartus copy your .hex file to simulation directory and seems it is ok from modelsim.

    If your file is .mif format, open with quartus "open file" then "save as" .hex, change on qsys.

    When you launch modelsim, memory file is fetched from simulation directory.

    Googling around the closest solution i found was this:

    https://stackoverflow.com/questions/23193206/inferred-ram-doesnt-initialize-in-modelsim-altera-edition

    Please tell me back if this helped.

    Regards

    Roberto

    • JPrig's avatar
      JPrig
      Icon for New Contributor rankNew Contributor

      Hi Roberto,

      Thank for the reply.

      Unfortunately it did not help. I use Aldec Riviera PRO and not Modelsim.

      I created a hex file with the correct name and placed it together with the UFM IP, but the tool still complains that it cannot open the file.

      The function seems to work in hardware, so I think I will just have to do without it in simulation.

      Regards, Julia