09-17-2014 10:02 AM
I have just finished created the software for a uBlaze that I use in ISE. I need the software to be run from the BRAMs because it gives me error when trying to use the ilmb controller.
When I add the .elf in ISE and then I program the board, the program in uBlaze is not executed. So, I read on the Internet that I could use data2mem. But when I use it, I have a problem. I use this command:
data2mem -bm edkBmmFile.bmm -bd eth_TRM_controller_sw_v1.elf -bt top.bit -o b new.bit
What I want to do is to insert the program on the ".elf" in the ".bit" and create a new ".bit". And I get:
ERROR:Data2MEM:33 - Matching ADDRESS_SPACE for code segment #2 not found in 'edk BmmFile.bmm'. Code segment #2 occupies [0x8C000000:0x8C019D87]
If you have a look at the memory map of uBlaze in XPS and at ".bmm" file you can see a difference. This is the memory map:
and this is the ".bmm" file:
ADDRESS_MAP microblaze_0 MICROBLAZE 100 ADDRESS_SPACE lmb_bram_combined COMBINED [0x00000000:0x0000ffff] ADDRESS_RANGE RAMB32 BUS_BLOCK Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_0 [31:30] INPUT = lmb_bram_combined_0.mem ; Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_1 [29:28] INPUT = lmb_bram_combined_1.mem ; Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_2 [27:26] INPUT = lmb_bram_combined_2.mem ; Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_3 [25:24] INPUT = lmb_bram_combined_3.mem ; Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_4 [23:22] INPUT = lmb_bram_combined_4.mem ; Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_5 [21:20] INPUT = lmb_bram_combined_5.mem ; Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_6 [19:18] INPUT = lmb_bram_combined_6.mem ; Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_7 [17:16] INPUT = lmb_bram_combined_7.mem ; Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_8 [15:14] INPUT = lmb_bram_combined_8.mem ; Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_9 [13:12] INPUT = lmb_bram_combined_9.mem ; Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_10 [11:10] INPUT = lmb_bram_combined_10.mem ; Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_11 [9:8] INPUT = lmb_bram_combined_11.mem ; Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_12 [7:6] INPUT = lmb_bram_combined_12.mem ; Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_13 [5:4] INPUT = lmb_bram_combined_13.mem ; Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_14 [3:2] INPUT = lmb_bram_combined_14.mem ; Inst_uBlaze_v9/lmb_bram/lmb_bram/ramb36_15 [1:0] INPUT = lmb_bram_combined_15.mem ; END_BUS_BLOCK; END_ADDRESS_RANGE; END_ADDRESS_SPACE; END_ADDRESS_MAP;
But if I change this line to this:
ADDRESS_SPACE lmb_bram_combined COMBINED [0x8C000000:0x8FFFFFFF]
Then I get this:
ERROR:Data2MEM:29 - Inconsistent address space size in ADDRESS_SPACE 'microblaze_0.lmb_bram_combined'. ADDRESS_SPACE was defined as 0x04000000 bytes, but the ADDRESS_RANGE total is 0x00010000 bytes.
So, I have the following questions:
Thanks in advance,
09-17-2014 11:09 AM
On the first error please refer to this link http://www.xilinx.com/support/answers/21121.htm
You have mentioned that you want to run the software from BRAM , did you try changing the linker script to execute the application from BRAM.
Why do you want to associated the BRAM address space in the bmm tothe DDR address mapping?
09-18-2014 02:44 AM
first of all thanks you very much for your answers. I'm sorry, but yesterday I did not explain the problem properly. I will do it now. The problem is:
My program is big and does not fit in BRAM, that's why I have to use DDR2 RAM. I indicate this in the linker script:
I am using this microBlaze from xilinx ISE, so I add the .elf file to the project. The problem is that I create the .bit, I program theFPGA and the program is not executed. I think this is because nobody programed de DDR2 with the program. The question is:
Is there any way to execute a program from DDR RAM directly? What I would like to have is a .bit file that, when programmed, configured the FPGA with the uBlaze and made the program run from DDR RAM.
Thanks in advance,
09-18-2014 05:52 AM
I believe in this case you need to have a small boot ROM or flash to initialize the DDR with the required elf file and give the location to processor for start executing the elf.
09-18-2014 06:58 AM
thanks you four your help, now I know what I have to do: I have to indicate in the linker to run the program from DDR Ram and program the FPGA with a .bit with the bootloader. Then, I have to program the flash memory in my board with the srec program.
The problem I have now is that I cannot program the flash from SDK because I get an error message, but I will publish a new thread for this.
Thans a lot,
09-24-2014 08:50 AM - edited 09-24-2014 08:51 AM
The BMM file is just for your BRAMs (local memory, or axi bram), not your DDR memory.
So, when the Microblaze comes out of reset, it will expect code at address 0x0 (or where ever your boot vector is set in the Microblaze configuration), your vector sections will be here. Then since the reset of your sections are in the drr, the microblaze will fetch the instructions from here.
So, your BRAMs will only contain your vector sections and you need to program the DDR with your ELF file. This can be done in the SDK tool via run/debug configurations Or via XMD.
I recommend that you view the EDK CTT guide as this shows the debug flow (4.1):