[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 - Slow Epiphany

Slow Epiphany

Any technical questions about the Epiphany chip and Parallella HW Platform.

Moderator: aolofsson

Slow Epiphany

Postby AndyC » Wed Aug 20, 2014 7:50 pm

AndyC
 
Posts: 184
Joined: Fri Jun 27, 2014 5:46 pm

Re: Slow Epiphany

Postby aolofsson » Wed Aug 20, 2014 8:02 pm

Please explain why you think it should be fast?

If you are reading (loading) directly out of global DDR, it takes hundreds of clock cycles to do every read, so it's going to be very slow. Every read in the program is blocking,and the read has to first go through the mesh-->off chip elink-->FPGA logic-->AXI bus on Zynq-->memory controller-->DRAM (and back).

Andreas
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: Slow Epiphany

Postby AndyC » Wed Aug 20, 2014 8:42 pm

Thanks for the reply.

So shared ram is global dram, this is where my misunderstanding was.

How do I copy data from the host into the epiphany ram then?

Thanks

Andy
AndyC
 
Posts: 184
Joined: Fri Jun 27, 2014 5:46 pm

Re: Slow Epiphany

Postby greytery » Wed Aug 20, 2014 9:18 pm

Andy,

Write beats read - which is a write plus read.
Best to push data to the Epiphany rather than pull the data from the Epiphany.
Send minimum data (e.g. results) back to the shared DRAM.

Think of it like yer typical home broadband link, with download speed way, way better than upload speed.

(Try getting your head round the e-loader utilities)

Cheers,
tery
User avatar
greytery
 
Posts: 205
Joined: Sat Dec 07, 2013 12:19 pm
Location: ^Wycombe, UK

Re: Slow Epiphany

Postby AndyC » Wed Aug 20, 2014 9:30 pm

Hi Tery,

Thanks for the info.

What I am really confused about is how to write to the eram from the host without stepping on code, stack etc.

I thought the shared_dram section did some kind of mapping but I was wrong on that!

If I define a global buffer in eram in the epiphany code how can I tell where it is from the arm side as its going to move around depending on the code size isn't it?

Cheers

Andy
AndyC
 
Posts: 184
Joined: Fri Jun 27, 2014 5:46 pm

Re: Slow Epiphany

Postby notzed » Wed Aug 20, 2014 11:54 pm

I talked a bit about memory in this thread, which is somewhat related although about the shared memory.

viewtopic.php?f=13&t=1655

For on-core code the "easiest" "solution" is to hard-code the memory locations if you want to write to them from the arm - but this is really only easy for simple prototypes and doesn't scale. You can also read the memory on the core using dma (or e_memcpy iirc) so only the epiphany code needs to know it's local address. In general you want to do this anyway due to the fan-out of the number of cores. That just shifts the addressing problem to the shared memory though and it still needs a solution.

When I hit this problem last year my first solution was to use a script to extract the symbol offsets from the compiled elf file and turn them into a header file that I could include. The ARM code would then use the offsets to calculate on-core or shared-memory addresses "by hand". At least I could write code without having to manually implement a linker with pen and paper.

Putting everything in a single struct can help with the work involved. You can also use the linker to assign fixed addresses but TBH I find this even less acceptable because again you're literally using a pen and paper to do what the linker is supposed to be doing.

But that still sucked hard so I spent a couple of months writing my own solution based on a more realistic and flexible model of the cpu capabilities. However I have no idea if the "new sdk" with the new device driver will simply break all that: and if it breaks it too hard i'm not sure when (or even if) i would have it working again. I may just never "upgrade".

Elf is designed to be simple so it isn't much work to add symbolic lookup to the esdk. I was pretty amazed when I saw the initial solution of using srec files: I mean I though that was pretty arcane and clumsy when I used it once in uni around '91 and it's much less code to just read the elf file directly. I could understand it being used as a first-cut prototype to get something booted (actually not really) but it should never have been part of the public release.

You really shouldn't be using volatile for any of those pointers fwiw.
notzed
 
Posts: 331
Joined: Mon Dec 17, 2012 12:28 am
Location: Australia

Re: Slow Epiphany

Postby AndyC » Thu Aug 21, 2014 5:28 am

Hi,

Thanks for the info.

I just had volatile in there to try stop the optimiser doing silly things, but thats another story!

Cheers

Andy
AndyC
 
Posts: 184
Joined: Fri Jun 27, 2014 5:46 pm

Re: Slow Epiphany

Postby AndyC » Thu Aug 21, 2014 7:28 am

Hi Again,

I changed all the code to write to the eram and it now runs in 11ms. I will try putting the in and out buffers in different pages to see if that speeds it up a bit more.

11ms is still 36 times slower, what else might I be doing wrong?

Now I just meet to automate the address resolution with a script and generate a .h file, thanks for the pointers you have been very helpful.

Cheers

Andy
AndyC
 
Posts: 184
Joined: Fri Jun 27, 2014 5:46 pm

Re: Slow Epiphany

Postby AndyC » Thu Aug 21, 2014 8:01 am

Ok, O3 optimization, fast-maths, input and output buffers in different pages gives me 8.7ms, arm with no optimisation is 0.3ms.

So it is 29 times slower.

I can't believe the epiphany is this slow, where else might I be going wrong?
AndyC
 
Posts: 184
Joined: Fri Jun 27, 2014 5:46 pm

Re: Slow Epiphany

Postby AndyC » Thu Aug 21, 2014 9:37 am

AndyC
 
Posts: 184
Joined: Fri Jun 27, 2014 5:46 pm

Next

Return to Epiphany and Parallella Q & A

Who is online

Users browsing this forum: No registered users and 16 guests

cron