Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Quartus8.1 Memory Initialization File Warning

I have made a ROM and its memory Initialization file:Hexadecimal (Intel-Format) File in my project, when I complied my design , there has a critical warning:Can't read Memory Initialization File or Hexadecimal (Intel-Format) File ROM1.hex -- setting all initial values to 0.

I don't know how to correct my Hexadecimal File. I have ever made a ROM and memory Initialization file in Quartus7.2, and there is no warning about this when I complied my design.

Any suggestion would be greatly appreciated!

10 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    There is something realy wired going on in Quartus 8.1

    A *.Hex File, added as a *.hex file in the megawizzard, is modified after a full compile. so its contest is different. and there is no nios nor epcs stuff, it's a simple 1port rom.

    only help here ... write protect the hex file !

    try to open your hex file with quartus and see if it looks right, then save it and try again.

    if this message appears again, add this file to the poject maybe quartus doesn't find this file. open your memory with the wizzard and check the path you have entered. do you have spaces inside your path ?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for you help, but I still have not solve my problems.

    When I found the Critical Warning: Can't read Memory Initialization File or Hexadecimal (Intel-Format) File ROM1.hex -- setting all initial values to 0.

    I try to open the *.hex file,but I can not open it again.As you can see the messages from the following picture. I uploaded it from my computer.

    I have meet the same situation many times, and I don not know why.

    I am sure that I have add the *.hex file to my project, and the *.hex file is directly in the directory where I found my project,as you can see from the attached pictures.

    Thank you again.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Dear senlin,

    as MSchmitt already mentioned, there is a problem with the MegaWizard that overwrites your .hex or .mif files.

    So to solve the problem you could try to generate your ROM1 module with the MegaWizard. The MegaWizard will generate (and overwrite your previous!) ROM1.hex file.

    You can now copy your own ROM1.hex file over the generated ROM1.hex file.

    Hope this helps!

    祝福!

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    right,

    each time the megawizzard is finished, the files are overwritten. thats why i set the file attributes for the memory initialisation files to write protect.

    so if you set this attribut, you can run the wizzard and compile the project.

    if you regenerate the memory initialisation file *hex or *.mif then do not forget to set the attribut again.

    for me this helps.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thank you for your help!

    First, I generate the ROM module use the QuartusII MeagWizard Plug-In manager.

    And I want to describe what I understand about your suggestions:

    Every time after a QuartusII software full complie, the content of *.hex file would be modified. It meas that the content of *.hex file is not what I set, it could be any possible data, right?

    Second,

    To Mschmitt:

    Your suggestion "write protect the hex file", do you mean that when I creat the *.hex file, I should then right click the file and set its attribute "read-only" ?

    I could not find anywhere in QuartusII8.1 software to set the attribute of the *.hex file---"write protect the hex file".

    Third,

    To sanmao:

    Do you mean that after I complied the project and I could copy my own ROM1.hex to replace the modified ROM1.hex, and the content of my ROM1 module is right what I set(the content of my own ROM1.hex) without complie the project again? I don not understand it clearly!!

    Thank you again for your generous help!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    dear senlin,

    1) I do not know a way how to avoid this overwriting when using MegaWizard. It looks to me like a software bug.

    2) So, if you prepare a .mif or .hex file and put it in your project directory it will be overwritten by MegaWizard if you specify a memory initialization file with this (for you intended OK) filename. The memory initialization file generated by MegaWizard is a template with all memory content zero.

    3) Two possible solutions:

    3.I. Copy your own .mif or .hex file from another location to the project directory and overwrite the MegaWizard generated .mif or .hex file. This should be done each time AFTER you run MegaWizard.

    3.II. As MSchmitt suggests, to write protect your .mif or .hex file, so that MegaWizard can not overwrite. This looks to me the effecient solution to this problem.

    Good luck!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    yes, use the standard method of write protecting a file, i guess quartus does not have such a feature. so within file explorer right clic ....

    second, if you replace your rom.hex file AFTER compile then the fpga image does not contain the new value, as it is modified AFTER compilation.

    meaning, you should modify your rom-hex after megawizzard but before compilation, and do not forget read-only.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    There is another way that I prefer. Instead of using the megawizard to set the name of the MIF/HEX file. Assign the MIF/HEX file using the assignment editor. Then if you need to change it, you don't have to re-run the megawizard.

    Assignments->Assignment Editor.

    The assignment type is "parameter". The parameter name is "INIT_FILE". Here is what an example from one of my QSF files looks like:

    set_parameter -name INIT_FILE trio_boot_loader_epcs.hex -to "trio_sopc:trio_sopc_inst|epcs_controller:the_epcs_controller|altsyncram:the_boot_copier_rom"

    Jake
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thank you very much!

    I understand your suggestions and I think I have solve the problems.

    Thanks again.