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
are ports blocking?
-
- Experienced Member
- Posts: 79
- Joined: Thu Nov 17, 2016 11:24 pm
-
- XCore Legend
- Posts: 1913
- Joined: Thu Jun 10, 2010 11:43 am
-
- Experienced Member
- Posts: 79
- Joined: Thu Nov 17, 2016 11:24 pm
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
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
-
- XCore Expert
- Posts: 754
- Joined: Thu Dec 10, 2009 6:56 pm
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.
https://www.xmos.com/download/private/I ... 283%29.pdf
Should be valid too for XS2.
-
- Experienced Member
- Posts: 79
- Joined: Thu Nov 17, 2016 11:24 pm
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?
What should I do if I want the "p_in :> x;" statement to wait until the FIFO is full?
-
- XCore Expert
- Posts: 754
- Joined: Thu Dec 10, 2009 6:56 pm
By default the full buffer width is used
-
- Experienced Member
- Posts: 79
- Joined: Thu Nov 17, 2016 11:24 pm
Does that mean that for "in buffered port :32 p_in = XS1_PORT_8A ;" the default mode for "p_in :> x;" is to block?
-
- XCore Expert
- Posts: 754
- Joined: Thu Dec 10, 2009 6:56 pm
Yes it will block until 32 bits have been clocked in.
-
- Experienced Member
- Posts: 79
- Joined: Thu Nov 17, 2016 11:24 pm
Thanks for the help!
sincerely,
Bill
sincerely,
Bill