Check the value of FSL_M_Control in the MicroBlaze

cmicroblazexilinx

I wrote a hardware accelerator which communicates with a MicroBlaze over FSL. In the Microblaze C code I would like to use putfsl() in a loop until the hardware accelerator signals the MicroBlaze that it should exit the loop:

while( <FSL_M_Control is not 1> )
{
    putfsl(*foo, 0);
    foo++;
}

Is it possible to get the value of FSL_M_Control and use it to exit the loop? If it is how could I do that?

Best Answer

Just so we're clear, you mean FSL_M_Control of the IP, which is FSL_S_Control on the microblaze, right? Because FSL_M_Control is driven by the microblaze...

The fast answer is "no".

However, the functions cgetfsl and getfsl will make a read and report FSL_S_Control through the carry bit, meaning they set the carry bit if FSL_S_Control = '0' when you use cgetfsl and vice-versa. Keep in mind that the FSL transaction has to be valid, i.e. FSL_S_Exist must be driven otherwise these functions blocks. You can verify the carry bit with the macro fsl_isinvalid.

do {
    putfsl(*foo++, 0);
    getfsl(dummy, 0);
    fsl_isinvalid(dummy); /* fsl_isinvalid doesn't return a value, this assign the carry bit to the variable dummy. This has for effect to put the value of FSL_S_Control into dummy */
 } while(!dummy);