ERROR:Data2Mem Tool不能区分连续的存储空间

ERROR:Data2Mem Tool不能区分连续的存储空间_第1张图片ERROR:Data2Mem Tool不能区分连续的存储空间_第2张图片"ERROR:Data2MEM:31 - Out of bounds code segment for ram space in 'system_bd.bmm'.
Memory space 'microblaze_0.lmb_bram_combined' occupies [0x00000000:0x0001FFFF]
Code segment #4 occupies [0x00000050:0x000053FB]"

Solution

Resolution 1

Data2MEM does not support contiguous memories generated from EDK.

To work around this, use a linker script to place the application code sections in the separate memory regions. 

XPS provides a tool called "Generate Linker Script" to help create a linker script that maps the application code to the two memories. 

To open this tool in XPS, select Tools -> Generate Linker Script.


Resolution 2:

The default EDK linker script generates an ELF file with a single program header. A loader program (in this case, Data2MEM) reads this header to download the ELF onto the memory. Because the memory regions are contiguous, it is logical to just give the START_ADDR option to the linker and the linker uses the address to generate the ELF file; however, Data2MEM cannot distinguish between contiguous memories, and an error results.

The solution is to change your linker script to generate program headers for each physical memory. The PHDRS construct in the linker script can be used to generate a program header. In this case, the linker generates two program headers, one for each physical memory in the ELF file. Data2MEM can download the ELF file correctly into the appropriate memories as it now reads two headers, one for each physical memory region.

For more information on ELF program headers, see:
http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_mono/ld.html#SEC23

Resolution 3:

An alternate solution to this problem is to modify the BMM file by hand and run Data2MEM in stand-alone mode.

NOTE: This solution will work only with contiguous, equal-sized memory spaces. 

1. Run the entire hardware flow in XPS (Tools -> Update Bitstream) or in ISE, so that an annotated BMM has been generated.
2. Modify the BMM file to put all the BUS BLOCKs into one ADDRESS BLOCK. Adjust the address of the one, primary address block to span the entire address region.
3. Save the BMM file, and run Data2MEM in stand-alone mode, as shown below:

> data2mem -bm system_bd.bmm -bd executable.elf tag top_level_tag_name 
> -bt system.bit -o b down.bit

... where top_level_tag_name is the top address block instance name.

The download.bit file produced should have the entire bitstream initialized.

你可能感兴趣的:(File,application,存储,download,each,linker)