UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor vbmazter
Visitor
5,841 Views
Registered: ‎04-18-2012

Separate memories for heap and stack?

Jump to solution

Hi,

 

I implemented a Microblaze system with DDR3 access. Because I need quiet some heap, I need mapped it to the DDR RAM. Unfortunately EDK claims that the heap must always go together with the stack, i.e. also on the DDR RAM.

 

As expected, this slows down the applications running on Microblaze by around a factor of two in my case.

 

Why can't I separate heap (to DDR) and stack (to BRAM)? Is there any way around this limitation?

 

Thanks,

Regards,

martin

0 Kudos
1 Solution

Accepted Solutions
Participant schneemann79
Participant
7,834 Views
Registered: ‎05-02-2009

Re: Separate memories for heap and stack?

Jump to solution

Hi vbmazter,

 

you are right I had the same problem a while ago. Stack and heap can only be located together in the same memory region. Most probably the reason for this is the implementation of the run-time libraries (libxil.a, libc.a). These libs were developed for computer systems were heap and stack always go together in "external" DRAM. Libxil might be a more specific library for Xilinx purposes than libc, but the heap and stack management principles might rather be the same.

0 Kudos
5 Replies
Scholar austin
Scholar
5,836 Views
Registered: ‎02-27-2008

Re: Separate memories for heap and stack?

Jump to solution

v,

 

Did you see that this question was already asked, and answered?

 

http://forums.xilinx.com/t5/EDK-and-Platform-Studio/Seperate-BSS-Stack-and-Heap/td-p/55691

Austin Lesea
Principal Engineer
Xilinx San Jose
0 Kudos
Participant schneemann79
Participant
7,835 Views
Registered: ‎05-02-2009

Re: Separate memories for heap and stack?

Jump to solution

Hi vbmazter,

 

you are right I had the same problem a while ago. Stack and heap can only be located together in the same memory region. Most probably the reason for this is the implementation of the run-time libraries (libxil.a, libc.a). These libs were developed for computer systems were heap and stack always go together in "external" DRAM. Libxil might be a more specific library for Xilinx purposes than libc, but the heap and stack management principles might rather be the same.

0 Kudos
Visitor vbmazter
Visitor
5,808 Views
Registered: ‎04-18-2012

Re: Separate memories for heap and stack?

Jump to solution

@Mr. Lesea,

I read that thread several times, but I don't feel that it gives the answer to my question. They were talking about the bss segment...not sure why they mention heap there though. Sure, your colleague is saying there that the linker script can do any assignment I like, but that's not the case as I mentioned above.

 

@schneemann:

I second that. There seems no way around co-locating heap and stack unfortunately.

 

Thanks for your answers!

0 Kudos
Visitor roketroket
Visitor
5,774 Views
Registered: ‎05-28-2012

Re: Separate memories for heap and stack?

Jump to solution
Hi,

Can you provide me a Xilinx ISE project which has a Microblaze and a DDR3 controller for Micron MT41J64M16LA device?

Spartan 6 XC6SLX45T is what i m using.

(My board is a custom board http://www.enterpoint.co.uk/raggedstone/RaggedStone_User_Manual_Issue_1_02.pdf and i face some problems with executing code from DDR3)

Thanks
0 Kudos
Visitor roketroket
Visitor
5,775 Views
Registered: ‎05-28-2012

Re: Separate memories for heap and stack?

Jump to solution

Hi,

 

Can you provide me a Xilinx ISE project which has a Microblaze and a DDR3 controller for Micron MT41J64M16LA device?

 

Spartan 6 XC6SLX45T is what i m using.

 

(My board is a custom board http://www.enterpoint.co.uk/raggedstone/RaggedStone_User_Manual_Issue_1_02.pdf and i face some problems with executing code from DDR3)

 

Thanks

 

metinburak@gmail.com

0 Kudos