Channel Array Use

Technical questions regarding the XTC tools and programming with XMOS.
robertxmos
XCore Addict
Posts: 169
Joined: Fri Oct 23, 2015 10:23 am

Post by robertxmos »

Sending chanends around is the way interfaces work.
If you compiler some code you can see it happening.

The client gets a chanend to the server.
It dynamically creates a chanend and passes its ID down the server's chanend.
The server now has a reply chanend to that client and non of the others.
When done, the client frees it's chanend.
The channends are 'connected' dynamically - there is no permanent channel (although streaming channels keep the connection live during their lifetime).

I would take the asm and wrap it in appropriate functions (inline?).
The https://www.xmos.com/download/private/x ... 1.1%29.pdf
alongside (simple) client interface asm output should give you enough information.


MarcAntigny
Active Member
Posts: 61
Joined: Tue Feb 13, 2018 2:50 pm

Post by MarcAntigny »

Yes, I was investigating on interface at the same time but I didn't know that it is possible to use inline assembly to work with.
First I'll try with interface arrays (which exist cf this note https://www.xmos.com/download/private/a ... 0.a%29.pdf)
And if it is not enough I'll take a look at an asm version.
Thanks robert.
MarcAntigny
Active Member
Posts: 61
Joined: Tue Feb 13, 2018 2:50 pm

Post by MarcAntigny »

So I tried using interface array and... "interface used as both client and server in one task". The compiler is assuming again that the index could be all of the values in the indexData array (even it won't on runtime) so it raises an error.
Interface are not an easier way to achieve what I want, it doesn't work.
I gave a look at asm for communications but there is really few examples. If anybody as a clue on how to use it, it would be really welcomed.
robertxmos
XCore Addict
Posts: 169
Joined: Fri Oct 23, 2015 10:23 am

Post by robertxmos »

I would create an easy interface and look at the output assembler (-save-temps).
Compare this will the getr and freer instructions in the architecture document.
Post Reply