Sign in

username:

password:



Not a member?

Search Comp.Arch.FPGA



Search tips

fpga by Keywords

Altera | ASIC | CPLD | Cyclone | DCM | DDR | DSP | Ethernet | ISE | JTAG | Linux | LVDS | Microblaze | ML310 | Modelsim | NIOS | OPB | PCI | Quartus | RocketIO | SDRAM | Spartan | Spartan3 | SRAM | Stratix | Verilog | VHDL | Virtex | Virtex-4 | Virtex-II | Xilinx | XST

Ads

See Also

DSPEmbedded SystemsElectronics

Comp.Arch.FPGA | Malloc on PowerPC on VirtexII pro


There are 3 messages in this thread.

You are currently looking at messages 0 to 3.

Malloc on PowerPC on VirtexII pro - Tibo - 2005-11-07 08:45:00

hi, 

I'm using a PPC405 on a Virtex2 pro. I try to allocate memory
with malloc() function. It compiles without any problem but malloc
returns NULL => no memory is allocated. I set the heap size at 0x0800 in
docm. I set need_xil_malloc to false since xil_malloc seems to be used
only for MicroBlaze. 

What's wrong ? 

Thanks for answer. 

Tibo 

ISE 7.1 / EDK 7.1 / SDK with no kernel 
______________________________
Join the blogging team on FPGARelated.com and earn rewards! Details Here.



Re: Malloc on PowerPC on VirtexII pro - Alan Nishioka - 2005-11-07 12:11:00

Tibo wrote:

> I'm using a PPC405 on a Virtex2 pro. I try to allocate memory
> with malloc() function. It compiles without any problem but malloc
> returns NULL => no memory is allocated. I set the heap size at 0x0800 in
> docm. I set need_xil_malloc to false since xil_malloc seems to be used
> only for MicroBlaze.
>
> ISE 7.1 / EDK 7.1 / SDK with no kernel

Are you using a custom linker script?
The STACK_SIZE and HEAP_SIZE variables are only used by the linker
script.

If you add --verbose to the -Wl linker options (Applications/Compiler
Options/Advanced) the linker script will be output when you compile.
This is also a good way to get the default linker script to read and
modify.

If your memory space is contiguous, (ie. it just has a start address,
followed by text, followed by data, followed by bss) you should
probably just be using the default linker script.

If you need to use a custom linker script you need to read the default
linker script to see what it does with HEAP_SIZE, and modify your
custom linker script.

Alan Nishioka
a...@nishioka.com

______________________________
Join the blogging team on FPGARelated.com and earn rewards! Details Here.

Re: Malloc on PowerPC on VirtexII pro - Peter Ryser - 2005-11-07 12:24:00

How much memory are you trying to allocate? 0x800
is only 2KB.
Instead of using heap that small it might be better to allocate static 
data structures anyway.

- Peter


Tibo wrote:
> hi, 
> 
> I'm using a PPC405 on a Virtex2 pro. I try to allocate memory
> with malloc() function. It compiles without any problem but malloc
> returns NULL => no memory is allocated. I set the heap size at 0x0800 in
> docm. I set need_xil_malloc to false since xil_malloc seems to be used
> only for MicroBlaze. 
> 
> What's wrong ? 
> 
> Thanks for answer. 
> 
> Tibo 
> 
> ISE 7.1 / EDK 7.1 / SDK with no kernel