Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
2,080 Views

warning with on chip memory data items width

hello,  

 

 

I use quartus II 8.0 and statixII gx ep2s60GX. 

I made a modification in my current design (which works well) in .vhd file. 

 

Now I've got this warning from onchip memory. 

 

 

 

 

Warning: Width of data items in "memory_0.hex" is greater than the memory width. Wrapping data items to subsequent addresses. 

 

Warning: Data at line (2) of memory initialization file "init_file_0.hex" is too wide to fit in one 

memory word. Wrapping data to subsequent addresses. 

it continues to Data at line (11). 

 

When I have this warning my design doesn't work well and some functionalities are missing. 

 

Is there someone who can help me to solve my probleme. 

Of course I want to know what happened. 

 

 

Thanks. If you have any question please ask. 

 

ps: This not a probleme with the size of the on-chip memory with ".hex" file.
0 Kudos
12 Replies
Altera_Forum
Honored Contributor I
339 Views

I would first suggest you to switch to latest version of Quartus II. Also this warnings should not affect on your design unless you are using it to store Nios II program binary and NIOS II's reset location is located in your on chip memory.

Altera_Forum
Honored Contributor I
339 Views

in my design I use onchip memory to store .hex program from nios II. 

 

I can try to download the new version but I don't think this problem is linked to the quartus version because my "old" design work. 

 

I've just modify an entity on my design.
Altera_Forum
Honored Contributor I
339 Views

hello,  

 

I downloaded the last version of quartus. I've got the same thing and always this bad warning about my onchip memory and .hex file. 

 

thanks for help.
Altera_Forum
Honored Contributor I
339 Views

I finally figured this out yesterday... 

 

I used Elf2Hex to convert my elf file into the hex file(s). The format of the .hex file was (spaces added by me to separate the fields): 

 

:20 aaaa 00 dd..dd cc 

:20 aaab 00 dd..dd cc 

 

Where aaaa == an address, dd..dd is 32 hex bytes of data, and cc is the checksum. aaab is a different address which happens to be 8 more than aaaa. For example, if aaaa was 1230, then aaab would be 1238.  

 

There were two key things that helped me figure it out. 

1. Really figuring out what the warning said "is too wide to fit in one memory word"... The key phrase was "one memory word". A memory word in my system is 32-bits, which is why when I had 32 hex bytes, it only increased the address by 8 (one for each 4 byte group).  

2. Looking at a default memory file created by the sopc system: 

:04 aaaa 00 dd..dd cc 

:04 aaab 00 dd..dd cc 

Where aaab - aaaa is only 1, and dd..dd is only 4 hex bytes. 

 

So, the key is that the Quartus tools want to have only one memory word (32-bits or 4 hex bytes in my system) PER LINE of the .hex file. 

 

In the elf2hex converter, there is an option called "--record=<length>" where you can set the maximum number of words per line. The default apparently is 20 (for me at least). Changing my makefiles to use --record=4 created a .hex file that had only 4 bytes per line and produced no warnings.
Altera_Forum
Honored Contributor I
339 Views

Hi 

 

Thanks for the information. 

It worked for me. Very precise information. 

 

Thanks again. 

Raj
Altera_Forum
Honored Contributor I
339 Views

Yes, very precise. Thank you. 

 

Anyway, it seems that it is safe to live with this warning, right?
Altera_Forum
Honored Contributor I
339 Views

This piece of information is still very important for Quartus II 13.0 release. Hope altera can fix it in next revision.

Altera_Forum
Honored Contributor I
339 Views

Good work erics96. Great to see a detailed resolution published. Thanks:)

Altera_Forum
Honored Contributor I
339 Views

Hi, 

 

I'm having similar warnings. My hex file is being generated by NIOS ii SBT for eclipse. From this link (https://www.altera.com/support/support-resources/knowledge-base/solutions/rd03252015_881.html) altera shows the solution. 

 

"Description 

You may see this warning when using memory initialization files generated by the mem_init make target in the makefile generated by the Nios® II Embedded Design Suite (EDS). 

 

The reason for this warning is that the Quartus® II software expects the record length within .hex files to match the data port width of the memory that is initialized. 

 

Workaround/Fix 

To change the generated .hex files to have a record length that matches the memory data port width, modify the mem_init.mk file within the BSP directory: 

 

Find the ELF_TO_HEX_CMD_NO_BOOTLOADER command 

add the following switch: 

--record=/8 

This problem is scheduled to be resolved in a future release of the Quartus II software." 

 

 

Based on the solution above, I'm not sure where to add the switch that was mentioned above. 

 

The boot loader command I found on my mem_init.mk file is below 

"ELF_TO_HEX_CMD_NO_BOOTLOADER = $(ELF2HEX) $< $(mem_start_address) $(mem_end_address) --width=$(mem_hex_width)  

$(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@" 

 

Question is where to add the --record=/8?
Altera_Forum
Honored Contributor I
339 Views

 

--- Quote Start ---  

Hi, 

 

I'm having similar warnings. My hex file is being generated by NIOS ii SBT for eclipse. From this link (https://www.altera.com/support/support-resources/knowledge-base/solutions/rd03252015_881.html) altera shows the solution. 

 

"Description 

You may see this warning when using memory initialization files generated by the mem_init make target in the makefile generated by the Nios® II Embedded Design Suite (EDS). 

 

The reason for this warning is that the Quartus® II software expects the record length within .hex files to match the data port width of the memory that is initialized. 

 

Workaround/Fix 

To change the generated .hex files to have a record length that matches the memory data port width, modify the mem_init.mk file within the BSP directory: 

 

Find the ELF_TO_HEX_CMD_NO_BOOTLOADER command 

add the following switch: 

--record=/8 

This problem is scheduled to be resolved in a future release of the Quartus II software." 

 

 

Based on the solution above, I'm not sure where to add the switch that was mentioned above. 

 

The boot loader command I found on my mem_init.mk file is below 

"ELF_TO_HEX_CMD_NO_BOOTLOADER = $(ELF2HEX) $< $(mem_start_address) $(mem_end_address) --width=$(mem_hex_width)  

$(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@" 

 

Question is where to add the --record=/8? 

--- Quote End ---  

 

 

 

Hello I am facing the same problem. The question is where to add it; 

 

The boot loader command I found on my mem_init.mk file is below 

"ELF_TO_HEX_CMD_NO_BOOTLOADER = $(ELF2HEX) $< $(mem_start_address) $(mem_end_address) --width=$(mem_hex_width)  

$(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@" 

 

Question is where to add the --record=/8? 

 

As you can see in the following, I have appended it but still the same warning 

ELF_TO_HEX_CMD_NO_BOOTLOADER = $(ELF2HEX) $< $(mem_start_address) $(mem_end_address) --width=$(mem_hex_width) --record=/8  

$(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@ 

 

Need help. 

Thank you all.
Altera_Forum
Honored Contributor I
339 Views

ELF_TO_HEX_CMD_NO_BOOTLOADER = $(ELF2HEX) --record=4 $< $(mem_start_address) $(mem_end_address) --width=$(mem_hex_width)  

$(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@ 

 

I get the idea from the reply of @erics96 

 

"In the elf2hex converter, there is an option called "--record=<length>" where you can set the maximum number of words per line... 

Changing my makefiles to use --record=4 created a .hex file that had only 4 bytes per line and produced no warnings."
Altera_Forum
Honored Contributor I
339 Views

Hello, 

I am trying to convert the preloader from ELF to .hex to boot the HPS of a Cyclone V from the FPGA. 

(cf https://rocketboards.org/foswiki/documentation/bootfromfpga140 ), with a DE10-nano board. 

However, I got warnings : Warning (113015): Width of data items in "preloader.hex" is greater than the memory width. Wrapping data items to subsequent addresses. Found 1148 warnings, reporting 10 

So according to this thread, I ned to make match my memory data port width ( 8bit) with the record length. 

I do not have a mem_init.mk file on my computer, 

just a makefile to compile the preloader. 

 

 

The command to convert to hex file is : 

arm-altera-eabi-objcopy -O ihex --adjust-vma -0xc0000000 uboot-socfpga/spl/u-boot-spl preloader.hex 

 

I am using Quartus 17.1. 

is there is a argument I can use for arm-altera-eabi-objcopy to set up this record length ? 

 

The website https://manned.org/arm-none-eabi-objcopy lists and explain the command, but the only one I saw is interleave-width and it do not seem solve my problem. 

 

Could you help me please ? 

 

Regards, 

Neudorf.
Reply