Forum Discussion

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

Hex to Mif file converter for LM32 Hex files

I have ported the LatticeMico32 to an Altera Cyclone. I have a 8K x 32 memory but the hex file I have has 4 words per line and I get the following line while trying to compile in quartus II 13.1

Warning (113009): Data at line (1) of memory initialization file "yo.hex" is too wide to fit in one memory word. Wrapping data to subsequent addresses.

The program used to generate the hex file, lm32-objcopy.exe does not have an option to make less than 4 32-bit words per line.

Does altera have any tools that could convert the files to the right format or mif file? I tried the elf2mif program but it doesn't seem to be working on cygwin nor my elf files..is it only for NIOS elf files?

Salman

2 Replies

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

    I haven't used the elf2mif for non Altera's elfs, but I have used a converter srec_cat or SRecord program to do many similar conversions in the past.

    http://srecord.sourceforge.net/

    It was originally a srecord conversion tool, but now includes many popular memory formats.

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

    Thanks...much better than trying to modify the files by hand and multiple unix utilities...

    Salman

    --- Quote Start ---

    I haven't used the elf2mif for non Altera's elfs, but I have used a converter srec_cat or SRecord program to do many similar conversions in the past.

    http://srecord.sourceforge.net/

    It was originally a srecord conversion tool, but now includes many popular memory formats.

    Pete

    --- Quote End ---