Hi Kyu,
well, first let me explain you a little what we have done.
We have implemented a LEON3 CPU 120 Mhz in our Xilinx Virtex ML605 board, put an RTEMS application, and created a task that executes your reference software. So your reference software is running under RTEMS. We've made small changes to adapt it (compilation issues), but the most important change is that we run this application in the same board that FMC116 is plugged, we don't need another PC connected to it.
So the access to the registers is not via ethernet and your libs. We have implemented an AMBA peripheric for the LEON architecture as a wrapper, and we use APB access to this peripheric, translating it to commands that Stellar IP understands. In fact, we have changed your SIP_MAC_ENGINE for our peripheric.
I hope you understand what I've tried to explain you. I think is important because of course now the times to access to parameters are completely different. In your reference software, each access had to go via ethernet if I'm not wrong, but now, it's just access to the bus in the same board, so I suppose that is quite faster.
In my implementation of sipif_writesipreg, what I do is generate the SIP write command, execute it, and then, in case a postcheck must be done, I make a while with 4 tries reading again the value to check if writing has been done. After each try, if I don't read what I expect, is where I do the sleep. First version had 10ms for each sleep. If I use 1000ms sleep, it seems to work properly in 99% of cases.
Also in read functions, what I do is access to my peripheral with the read command, and then wait in a loop with 4 tries for the ACK command to be read. On each of the tries, I have also an sleep of 10 ms.
The sleeps of your reference software haven't been changed.
It must also be taken into account that there are several printf's that has the same effect than sleep calls in the sense of write timings.
I hope you understand it all. Let me know if it's not the case.
THANKS A LOT!!
Víctor Martín, IEEC