Page 1 of 1

How to allocate the SDRAM

PostPosted: Sat Dec 19, 2015 11:46 pm
by Richardye
Hi guys,

I have got one question regarding allocating the SDRAM. I have read several related posts in the forum, and I saw that when allocating the SDRAM, I should start with the offset 0x100000 which is 16 mb like this

Code: Select all
e_alloc(pDRAM,0x01000000,msize)


However, in the example of fft2d and matmul-16, the allocation instruction used the offset 0 not 0x01000000. Does anybody know why ? It is a little bit confusing...

Code: Select all
e_alloc(pDRAM,0x00000000,msize)


Best Regards,
Richard

Re: How to allocate the SDRAM

PostPosted: Tue Jan 12, 2016 3:09 pm
by sebraa
If you check the original linker scripts, you will notice that the shared memory area is 32 MB in size and divided in two parts. The first part is reserved for the C library and other stuff, the second part is reserved for the heap.

If you do not use the heap on the Epiphany cores, you can use the upper half of shared memory freely (offset 0x00100000).
If you do not use functions from the C library on the Epiphany cores, you can use the lower half of shared memory freely (offset 0).