Channel communication: 8 token channel buffer per channel?

Technical discussions around xCORE processors (e.g. xcore-200 & xcore.ai).
Post Reply
User avatar
Chendy
Active Member
Posts: 46
Joined: Tue Nov 02, 2010 4:53 pm

Channel communication: 8 token channel buffer per channel?

Post by Chendy »

Hi,

I trying to do implement some bidirectional communication between 2 'cores'. I'm scare of trying to write to the full buffer (which will crash?? or block??).

After reading http://www.xmos.com/discuss/viewtopic.php?f=6&t=617, I'm wondering if there is a 8 token channel buffer per declared channel? Is this 8 token buffer guaranteed for every declared channel?

Regarding strategies of impletementing bidirectional channel communication, I have read the above proposals which involve remembering how many tokens one has sent. But alternatively, can I simply use more channels; use 2 channels (one for each direction), in order to make things simpler? Would that mean I would have a 8 token buffer in each direction?

Thanks

Chendy


User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am
Contact:

Post by segher »

It is probably easier to first look at channel ends, and then
from that look at what that means for channels.

If you write to a channel end (an OUT instruction), the channel
end accepts that data, and your thread keeps on running. My
(non-comprehensive) tests show each channel end has a
single word buffer for this. When the buffer is full your thread
blocks until the buffer is empty. I haven't investigated how
things behave when you send separate tokens.

If you are sending to a "remote" channel end, i.e. one with
a different node #, the processor switch transmits the data
to the system switch it is connected to, which can buffer quite
a bit of data for elasticity (xlinks are a lot slower than plinks).
If it is sending to a "local" channel end, it never leaves the
pswitch. A channel end also has a receive buffer (also seems
to be one word); if it is empty the data is moved there.

So for a channel, you have two one-word buffers in play,
per direction. The directions are completely independent.
User avatar
Chendy
Active Member
Posts: 46
Joined: Tue Nov 02, 2010 4:53 pm

Post by Chendy »

Thanks segher
Post Reply