Page 1 of 1

master instruction

Posted: Thu Feb 23, 2017 4:36 pm
by cschopges
Hey,

what does the following instruction mean (what does master stand for)?

master {
c :> 1;
}

Re: master instruction

Posted: Thu Feb 23, 2017 5:08 pm
by infiniteimprobability
in the above case, not much. Firstly it's inputting from a channel into a constant (which I guess is a typo!?) but secondly it's a single input.

Bit when you do:

master {
c :> array[0];
c: > array[1];
c: > array[2];
c: > array[3]}

it makes it into a transaction. This means that the switch path is setup at the beginning and closed at the end, as opposed to being setup and closed for each data unit for a normal channel. Each input in between then boils down to a single instruction, making it faster.
A streaming channel always keeps the path open, which may be restrictive if you have limited switch paths (you get 4 between tiles).

The above is a compromise which gives good performance but only blocks the switch path during the transaction.


See here for a full example:
https://www.xmos.com/published/how-use- ... r-channels

Re: master instruction

Posted: Fri Feb 24, 2017 1:08 pm
by cschopges
Yes, typo. Only the master was important :)

Thanks much clearer now.

Does the other end of the transaction need to use the slave{...} instruction or will it work even if not used?

Re: master instruction

Posted: Fri Feb 24, 2017 1:09 pm
by infiniteimprobability
Does the other end of the transaction need to use the slave{...} instruction or will it work even if not used?
Definitely - otherwise the channel protocol will mismatch and you'll get an exception...