cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
aminfar1
Explorer
Explorer
4,079 Views
Registered: ‎01-09-2009

blocking or nonblocking FSL?

I am confused about the use of nonblocking FSL in C programs. Why do we need a nonblocking FSL? For example, in the code below, I think we need to use blocking FSL.

 

....

//do square root

putfsl(val, id);

getfsl(square_root_val, id);

//use square_root_val...

 

if we should use blocking FSL here, then my question is what happens if we use nonblocking FSL? Can you come up with an example that nonblocking FSL is useful (or preferred)?

Message Edited by aminfar1 on 10-30-2009 09:56 PM
0 Kudos
2 Replies
goran
Xilinx Employee
Xilinx Employee
4,069 Views
Registered: ‎08-06-2007

Hi,

 

There is a function to see if the non-blocking FSL operation was succesful or not. Can't check it up since I'm home right now.

You should find them in the manuals on the standalone libraries. 

 

Non-blocking is used when you don't want to stall MicroBlaze until the FSL operation can be performed.

Ex. You are receiving data from two FSL inputs but you don't know which arrives first.

Instead of blocking on the first FSL port, you can check each of them in turn for results.

 

Before we added extended FSL operation functionality, non-blocking was the only way to handle interrupts while doing FSL operation, now FSL operation can be interruptable.

 

Göran

jagron
Adventurer
Adventurer
4,056 Views
Registered: ‎01-04-2008

Goran is right, there are actually 4 flavors of FSL operations:

 

* Blocking and non-blocking:

 

Blocking are synchronous, and will return when the operation (put/get) is complete.  Non-blocking operations can fail (if the FSL is full or empty) and the status of the operation must be checked in order to ensure that the FSL operation completed.   Non-blocking operations are useful when trying to poll FSLs.

 

* Interruptible, and non-interruptible:

 

Interruptible FSL operations allow the processor to respond to asynchronous external interrupt events.  Non-interruptible are atomic, and cannot be interrupted by external interrupts.  If you aren't using interrupts, these differences will not affect you.

 

-Jason