Altera memory init file (.hex/.mif) generation using gcc objcopy - how to change base address??

Hi,

I would like to load a on-chip ROM in a Altera Stratix device with the data produced by the linker script shown below. Since the text segment is not located at address 0x00000000, ModelSim, or altera_mf.v rather, produces the following error:

# ERROR: rom.hex, line 1, Unknown record type. # ERROR: rom.hex, line 1, Invalid checksum.

Any suggestions? I'm basically looking for a way to relocate the base address to 0 without actually affecting the data produced by the linker, as I need to keep everything statically linked.

Thanks,

Edmond

--- rom.ld (linker script) ---

MEMORY { rom : ORIGIN = 0x08000000, LENGTH = 4k }

SECTIONS { .text : { . = ALIGN(4); *(.text) _text_end = . ; } > rom }

--- rom.hex ---

:020000040800F2 :100000003C040A0024080005AC8800002408000A0B :100010000E000041000000000000000D0000000084 :1000200000000000000000000000000000000000D0 :1000300000000000000000000000000000000000C0 :1000400000000000000000000000000000000000B0 :1000500000000000000000000000000000000000A0 :100060000000000000000000000000000000000090 :100070000000000000000000000000000000000080 :100080000000000000000000000000000000000070 :100090000000000000000000000000000000000060 :1000A0000000000000000000000000000000000050 :1000B0000000000000000000000000000000000040 :1000C0000000000000000000000000000000000030 :1000D0000000000000000000000000000000000020 :1000E0000000000000000000000000000000000010 :1000F0000000000000000000000000000000000000 :100100000000000D1500FFFF2108000103E00008BA :1001100000000000000000000000000000000000DF :1001200000000000000000000000000000000000CF :1001300000000000000000000000000000000000BF :1001400000000000000000000000000000000000AF :10015000000000000000000000000000000000009F :10016000000000000000000000000000000000008F :10017000000000000000000000000000000000007F :10018000000000000000000000000000000000006F :10019000000000000000000000000000000000005F :1001A000000000000000000000000000000000004F :1001B000000000000000000000000000000000003F :1001C000000000000000000000000000000000002F :1001D000000000000000000000000000000000001F :1001E000000000000000000000000000000000000F :1001F00000000000000000000000000000000000FF :0400000508000000EF :00000001FF

Reply to
Edmond Coté
Loading thread data ...

Hi Edmund,

Our simulation team says that you have hit a missing feature in the altera_mf.v simulation model (extended linear address record), and they have opened a software issue to track adding this feature to a future release of Quartus. In the interim, you should be able to remove the first line of the hex file and the ROM contents should be relocated to base address 0, allowing correct simulation.

Vaughn

Reply to
vbetz

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.