Page 1 of 1

COPRTHR-2: Host calls from the epiphany

PostPosted: Sun Nov 26, 2017 11:29 am
by nickoppen
Hi,

Has anyone used USRCALL to execute a routine on the host from the co-processor? I'm giving it a go as a way of signalling back to the host that there is data in shared memory that can be retrieved.

Following the API ref to the letter, I declare and define my routine on the host:

Code: Select all
int epip_callback(int coreId, int i);
USRCALL(epip_callback, 1);
int epip_callback(int coreId, int i)
{
    printf("call back received from: %i", coreId);

}


and then in the Kernel:

Code: Select all
int epip_callback(int coreId, int i);

void __attribute__((interrupt)) int_isr()
{
    epip_callback(coprthr_corenum(), 0);
}


However, I get the compiler error:

gcc -g -DDEBUG -I. -I/usr/local/browndeer/coprthr2/include -I/opt/adapteva/esdk/tools/host/include -c egdma.c -o egdma.o
egdma.c:13:24: error: expected ‘)’ before numeric constant
USRCALL(epip_callback, 1);

(Up arrow under the 1)

If I remove the second argument the host compile but the call in the kernel code says that the call is undefined.

Does anyone understand USRCALL and how it works. The API ref is very terse.

nick

Re: COPRTHR-2: Host calls from the epiphany

PostPosted: Mon Nov 27, 2017 7:41 pm
by dar
Nick,
I have implemented user-defined host calls. Let me look into this to see what is going on. I will follow up.

Re: COPRTHR-2: Host calls from the epiphany

PostPosted: Tue Nov 28, 2017 6:56 am
by nickoppen
Thanks dar,

I've updated my git repository (https://github.com/nickoppen/egDMA) with the call back code in it.

nick

Re: COPRTHR-2: Host calls from the epiphany

PostPosted: Sat Dec 09, 2017 2:54 pm
by dar
Nick,
Just an update. The documentation is unclear, but the bigger issue is that when I ported to the 2016 parallella image, symbol changes for this feature were overlooked. The changes from 2015 to 2016 images included completely changing the ABI symbol naming conventions and required going through and adjusting in many places. This got overlooked. I will update when I get this resolved and my test code is able to link.
-DAR

Re: COPRTHR-2: Host calls from the epiphany

PostPosted: Fri Dec 15, 2017 9:58 am
by nickoppen
Thanks David,

I'll keep an eye out for updates.

nick

Re: COPRTHR-2: Host calls from the epiphany

PostPosted: Thu Oct 25, 2018 9:12 am
by nickoppen
Hi Davi,

Have you had a chance to update the code to reflect the changes?

I'm still working on the idea that the ARM cores and the epiphany cores can work together in parallel so that the results from the epiphany processing can be collated on the host cores while the epiphany cores are working on the next chunk of data. I was hoping to use host calls to kick off a process on the ARM to retrieve the data from shared memory.

If there is another way of doing this I'd be glad for some pointers.

nick