by over9000 » Tue Jan 13, 2015 5:13 am
If the output is different from the input, you're probably not synchronising stuff properly.
Either that or your host/epiphany programs are set up wrong. At a minimum, you need to declare memory areas (variables) that will change as being volatile.
It's been a while since I looked at ||a programming, but you can set up shared buffer areas. How you use them is up to you. I think that you should use one area for synchronisation primitives (eg, head and tail pointers, software mutexes) and the other for data buffers. There's no hardware-based mutual exclusion or mailbox/queue type primitives between CPU (ARM) and EPU (Epiphany) or between Epiphany cores (or at least they're too esoteric to get into) so you need to look up algorithms for implementing (at least) mutexes in software (eg, Dijkstra's algorithm). You can do some transfers between cores without locks, too. I wrote on the topic a while back. Or maybe try looking up "lock-free producer consumer" on the net. It might throw up a more readable explanation of the idea I came up with.
But definitely check that you're using volatile (assuming C) and understand what it means.