We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Showing results for 
Search instead for 
Did you mean: 
Visitor drkow19
Registered: ‎05-08-2014

Zynq EMAC PS Device Problems

Hi all, I'm working with a Zynq 7020 and the integrated EMAC PS device for sending Ethernet packets out the gigabit port that is on our ZedBoard. I have it working pretty good, TX only (sending frames to a connected PC) and reaching 85% of the bandwidth of my PC's gigabit Ethernet card. I am having two issues right now:


1) I call XEmacPs_BdRingFromHwTx() to get the finished BDs from the EMAC. We are using polling. Immediately after calling this and receiving about 1 to 20 or so BDs that have finished, I want to check the status of each BD by calling XEmacPs_BdGetStatus(). When running at full speed, during the first iteration every BD in the ring (except the last one) has the done bit (bit 31) set, but the last BD in my ring does not have the complete bit set. It only has the last bit and the wrap bit. Then, as it wraps around the BDs, the 0th, 1st, 6th, and so on in a weird pattern, BDs that I get returned have the same problem, the done bit is not set. But I found that by calling XEmacPs_BdRingFromHwTx(), then looping through a for loop for 10000 iterations of doing nothing before I check the statuses, then they are all fine, and all the done bits are set! This is really not the desired behavior, I should be able to check the status as soon as the BDs are taken from the hardware. There is no way we can waste cycles like that.


2) I am currently sending one frame (one BD) at a time, and there are tens or hundreds of lines of code before the next BD is sent. By send, I mean calling XEmacPs_BdRingToHw() with 1 BD, and then immediately calling XEmacPs_Transmit(). I am able to do this without error, and extremely fast, because I am hitting 85% of gigabit traffic. But when I try to send two frames near back-to-back by calling XEmacPs_BdRingToHw(), XEmacPs_Transmit() for the first BD, and XEmacPs_BdRingToHw(), XEmacPs_Transmit() for the next BD, it errors out after a while. It sends a few frames ok, then will throw an error. The number of packets before failure varies with my packet generation speed. One of these packets is full sized (1514 bytes) and the next is minimum size (64 bytes). If I delay 10000 iterations after sending the first packet before sending the next, it works fine. If I try to call XEmacPs_BdRingToHw() with both BDs, then just call XEmacPs_Transmit() once, it still fails in the same timeframe. But the weirder thing is the error message flag is blank! The error handler is like this: static void XEmacPsErrorHandler(void *Callback, u8 Direction, u32 ErrorWord). The interrupt fires, and the direction is correct (1 for TX) but the ErrorWord is 0.


Any help on these issues is greatly appreciated. Thanks!

0 Kudos
1 Reply
Observer lixiaolin126
Registered: ‎12-01-2013

Re: Zynq EMAC PS Device Problems

I meet the same question, is there a bug in the ZYNQ PS GEM? 

0 Kudos