EDK: Losing messages when using putfsl_interruptable together with getfsl_interruptable

Hi all,

I discovered that I _lose messages_ when using an Fast Simplex Link (FSL) to transfer data from one MB to another using the interruptable macros putfsl_interruptible and getfsl_interruptible (BTW, I'm using EDK 8.1i SP2). I'm not losing any messages when I use the non-interruptible versions (putfsl, getfsl) or when I replace only one interruptible version with a non-interruptible version.

So in short the following combinations of getfsl and putfsl work:

putfsl, getfsl; putfsl_interruptible, getfsl; putfsl, getfsl_interruptible;

The not working combination is:

putfsl_interruptible, getfsl_interruptible;

Does anyone has any idea why this may be the case, and how to fix this problem?

Below is some example of code that loses messages is the following (Please note that I omit the programme entry point bits):

-The code for the first MicroBlaze: char* message = "hello world\r\n"; void hello (void) { int i; xil_printf ("(hello started)\n"); for (i = 0; message[i] != 0; i++) { putfsl_interruptible(message[i], 0); } putfsl_interruptible(0xFF, 0); xil_printf ("(hello done)\n"); return; }

-The code for the second MicroBlaze: void world (void) { xil_printf ("world started \r\n"); unsigned char c; int message = 0; getfsl(message, 0); c = (char) message; while (c != 0xFF) { xil_printf("%c",c); getfsl_interruptible(message, 0); c = (char) message; } xil_printf ("\r\n"); xil_printf ("world gone \r\n"); return; }

BTW, I replaced the putfsl_interruptable macro with the following due to problems with the originally supplied version:

#define putfsl_interruptible(val, id) \ asm volatile ("\n1:\n\tnput\t%0,rfsl" #id "\n\t" \ "addic\tr18,r0,0\n\t" \ "bnei\tr18,1b\n" \ :: "d" (val) : "r18")

The source for this macro is Sylvain Munaut who posted it in Message-ID:

In Message-ID: Austin Lesea from Xilinx states that this macro seems to be correct.

Cheers Bernhard

--
William of Ockham, Albert Einstein, and Stephen Hawking walk into a bar.
Bartender: Oh, NO! Not another bloody parallel programming joke.
Reply to
Bernhard Sputh
Loading thread data ...

Hi all,

a quick update from my side. Testing has revealed that we seem to do something wrong in our `interrupt when data available' code for the FSL. When disabling the generation of interrupts the putfsl_interruptible and getfsl_interruptible macros work.

I'm puzzled why interrupt generation should result in a loss of messages on the FSL. Does anybody has an idea why this may be the case?

Cheers Bernhard

--
William of Ockham, Albert Einstein, and Stephen Hawking walk into a bar.
Bartender: Oh, NO! Not another bloody parallel programming joke.
Reply to
Bernhard Sputh

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.