are ports blocking?

If you have a simple question and just want an answer.
Post Reply
woodsb
Experienced Member
Posts: 79
Joined: Thu Nov 17, 2016 11:24 pm

are ports blocking?

Post by woodsb »

Hello:

If p_in is an input buffered port, does a "p_in :> x;" statement inside a while(1) loop block the loop execution until the next time the buffered port is full?

If not, what happens each time the statement is encountered?

Thanks,
Bill


User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

woodsb
Experienced Member
Posts: 79
Joined: Thu Nov 17, 2016 11:24 pm

Post by woodsb »

Thanks for the response. Reading the linked material prompted another question.

The summary states that "An input removes data from a port’s FIFO. The processor waits only if the FIFO is empty." What happens if I use a buffered port that is larger than the size of the input pin specification, for example "in buffered port :32 p_in = XS1_PORT_8A ;"?

Can the "p_in :> x;" statement pull partial data from the FIFO in a non-blocking manner, or will the processor wait until all 4 8-bit portions are in the FIFO?

Thanks,
Bill
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm
Contact:

Post by Bianco »

There's the partin, partout and some related library functions to do that.

https://www.xmos.com/download/private/I ... 283%29.pdf

Should be valid too for XS2.
woodsb
Experienced Member
Posts: 79
Joined: Thu Nov 17, 2016 11:24 pm

Post by woodsb »

Thanks for the further references. I'm wondering, what is the default value? That is, what happens if I use a buffered port that is larger than the size of the input pin specification, for example "in buffered port :32 p_in = XS1_PORT_8A ;"? Will "p_in :> x;" block or pull out partial results or something else?

What should I do if I want the "p_in :> x;" statement to wait until the FIFO is full?
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm
Contact:

Post by Bianco »

By default the full buffer width is used
woodsb
Experienced Member
Posts: 79
Joined: Thu Nov 17, 2016 11:24 pm

Post by woodsb »

Does that mean that for "in buffered port :32 p_in = XS1_PORT_8A ;" the default mode for "p_in :> x;" is to block?
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm
Contact:

Post by Bianco »

Yes it will block until 32 bits have been clocked in.
woodsb
Experienced Member
Posts: 79
Joined: Thu Nov 17, 2016 11:24 pm

Post by woodsb »

Thanks for the help!

sincerely,
Bill
Post Reply