[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - Shared dram and eCore local memory

Shared dram and eCore local memory

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

Shared dram and eCore local memory

Postby Anthony » Wed Jun 03, 2015 3:12 am

hi!i have looked up the internal.ldf ,since there are 32MB memery for shared dram ,and each ecore has a space of 32Kb, but when the srec file load on epiphany platform , do the datas preserve in ecore local memory and the codes lie in the shared dram?
also,i wanna know in which case should i use shared dram and in which case should i use ecore local memory,since they all can share datas between host and epiphany,i just feel confused...expect for your answer!
Thanks!
Anthony
 
Posts: 16
Joined: Thu May 28, 2015 7:59 am

Re: Shared dram and eCore local memory

Postby skinner » Thu Jun 04, 2015 3:56 pm

Hi !

I'm quite new with epiphany programming so this has to be taken with caution. After reading the eSDK documentation i can tell that the answer you're looking for depends on what configuration you used during the compilation of your epiphany program. That is to say, if you used legacy.ldf, everything (data and code) will be stored in the external SDRAM. If you used fast.ldf, only the standard libraries will be stored in the external SDRAM and the user code, data and stack will be loaded locally on the target eCore. Finally, if you used internal.ldf, everything will be stored into the local memory space of the target eCore.

Note that you always can manually specify whether or not certain parts of your code should be stored locally or in the external memory using some assembler code (see eSDK documentation).

Since there is no OS on the eCores, everything is up to you as far as data and code placement is concerned. That allows a huge modularity for your programs but you also have to be careful not to override some already used data and stuff like that.

Finally, i would say that whether you should use the internal or external memory depends on the performances you want to achieve with your program. In fact, if the data/code are stored locally, they will be extremely fast to use. If an eCore has to access data into another eCore memory space, it will also be fast due to the on-chip communication but not as fast as if all was local. And if you place some data or code in the external memory, it will be really slower to access since it will imply off-chip communications.

I hope i answered your questions !

Thomas.
skinner
 
Posts: 21
Joined: Mon Jun 01, 2015 11:14 pm

Re: Shared dram and eCore local memory

Postby Anthony » Fri Jun 05, 2015 8:52 am

Anthony
 
Posts: 16
Joined: Thu May 28, 2015 7:59 am

Re: Shared dram and eCore local memory

Postby skinner » Fri Jun 05, 2015 2:19 pm

Hi Anthony !

Glad my answer helped you :)

I'm not qualified enough to tell if your code is wrong but i do think you should first try to open a shared memory segment on the host side that would be accessible for both the host and the epiphany.

As I stated in my recent post (viewtopic.php?f=13&t=2500) there seems to be two functions aiming at allocating some shared memory (in the external SDRAM). You can have their full prototypes directly in the headers of e-hal-api library or in the eSDK official documentation (http://www.adapteva.com/docs/epiphany_arch_ref.pdf).

Once you opened the shared memory space in the host program, you can then write or read anything in it from the host or device side. On the device side however you need to access the previously created memory space. If you used e_allocate, you only have to read/write in the correct address space but if you used e_shm_allocate then you will have to "attach" the memory segment onto the eCore by calling e_shm_attach.

For further details, the official reference manual is very well done and explain a lot of things. Although I'm quite sure it doesn't mention the e_shm_xxx functions so you could give a look at the included headers (see the sdk/epiphany-libs/tools/include directory) and, for example the hello-world sample given on the parallella distribution.

Regards,

Thomas.
skinner
 
Posts: 21
Joined: Mon Jun 01, 2015 11:14 pm

Re: Shared dram and eCore local memory

Postby Anthony » Sun Jun 07, 2015 9:24 am

Hi,thomas,it's so kind of u to answer my question. in the hello-world example,just like you said,it used e_alloc function to allocate a section for shared memory,but in the dotproduct example,there isn't a e_alloc function in the host,it seems that directly using address in host and device side also can share datas, i feel puzzled about this.and wonder if e_alloc function is necessary to use in host side,so that two platforms can transfer data in this way,what‘s your opinion?

regards

Anthony
Anthony
 
Posts: 16
Joined: Thu May 28, 2015 7:59 am

Re: Shared dram and eCore local memory

Postby skinner » Tue Jun 09, 2015 10:01 pm

Hi Anthony !

From my point of view you have to use e_alloc to use the shared memory. As far as i understand the only difference between using e_alloc and directly reading/writing into the memory is that the e_alloc function while take care of things like basic offset into the shared space and stuff like that while if you only use e_write and e_read, you will have to do some checking for the addresses yourself.

Hope it answers your question !

Thomas.
skinner
 
Posts: 21
Joined: Mon Jun 01, 2015 11:14 pm

Re: Shared dram and eCore local memory

Postby Anthony » Wed Jun 10, 2015 2:06 am

Anthony
 
Posts: 16
Joined: Thu May 28, 2015 7:59 am

Re: Shared dram and eCore local memory

Postby skinner » Wed Jun 10, 2015 3:27 am

Hi Anthony,

Unfortunately i don't have the time to write a full answer but i just realised that i forgot the don't in the you "don't have to" use e_alloc even though i think it's better to use it. I'll try to write a full answer to your question later !

Thomas.
skinner
 
Posts: 21
Joined: Mon Jun 01, 2015 11:14 pm

Re: Shared dram and eCore local memory

Postby skinner » Thu Jun 11, 2015 9:20 pm

Hi Anthony !

Sorry for the wait ! The offset needed in the e_read function is the offset inside the memory referenced by the first parameter, that is to say inside the memory space you created. You can check that in the headers of the source code of the HAL library by looking at the e_mem_t (or something like that, i don't have the reference right now) type. You'll see that those structures keep a "base" address field, referencing the beginning of the allocated area. So to access a specific place inside this area, you give an offset and go to base+offset address.

So on the eiphany side you basically have to do the same, keeping in mind the right offsets :)

Hope it helps !

Thomas.
skinner
 
Posts: 21
Joined: Mon Jun 01, 2015 11:14 pm

Re: Shared dram and eCore local memory

Postby Anthony » Fri Jun 12, 2015 1:55 am

Anthony
 
Posts: 16
Joined: Thu May 28, 2015 7:59 am


Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 14 guests

cron