In my design, I use Cyclone V SoC and I need 4 ethernet channels, so I have to use Triple Speed Ethernet IP the extra channels HPS can not provide.
I referred to the example design (Niosii_ethernet_standard_3c120_rgmii.zip) and the timing constraint guide an433 and an477.
It looks like the timing constraint setting by the example is different from the description described in the guide an477, I tried both the way of an477 and the timing used in the example (I set optimization to “speed” already), neither of them pass the timing.
In the example design and my design, it only uses delay in external PHY, this means tx is edge-aligned and same edge, and rx is center-aligned and same edge in fpga.
The differences in the example design and an477 is: in the example design, no multicycle constraint is set, but in an477 and an433, the multicycle constraint should be set for tx path.
I analyzed the failed path, it looks like the data path right before clkctrl_G3 (clockbuffer) is extremely long. (See the picture attached)
Well, I do not understand why this is so long and do not know how to solve it. I’m thinking about set location constraint for this buffer, then I found out this is the closest buffer already.
The tx_clk is assigned by the following sentences:
tx_clk <= enet_tx_125 when eth_mode = '1' else -- 1G
enet_tx_2p5 when ena_10 = '1' else -- 10 Mb
enet_tx_25; -- 100Mb Mode = 25MHz clock
Therein enet_tx_125, enet_tx_2p5 and enet_tx_25 are pll outputs.
I also tried tx_clk <= enet_tx_125 to get rid of the combinational control of clock, but I did not get any progress.
Then I tried center-aligned strategy for tx-path by using PLL to phase shift tx clock output, the timing is even worse.
I'm stuck here, I need help now. My project is compiled in Quartus 18.1, and the qar file is attached here.
Any reply or response is appreciate.
I change the constraint for tx_clk*and enet_gtx_clk_* according to your suggestions, though I need to adjust it slightly to make it apply my case because the input clock for my pll is 50 MHz instead of 125 Hz.
I had a look at AN647 and the example design for Cyclone V GX.
It looks like the constraint set in the design is center-aligned for tx channel, but the tx clock does not have phase shift at all. In the design, it's actually edge-aligned for tx channel. So I'm very confused here.
Other than that, the setting for rx channels is different from AN477 also.
Until now, the example I mentioned (Niosii_ethernet_standard_3c120_rgmii.zip), the example described in AN647 and AN477 (and AN433) have conflictions, and I'm very confused now.
What can I do to improve the timing violation? What is the next step I can try?
Hi Jasmine, Yes, the RGMII timing constraint is not straight forward, and it depends whether you have enable the central align from the external PHY. You can follow AN647 or other newer design from Design store to do the constraint, and then the most importantly is it can pass the hardware testing.
As I said, AN647's design (edge_aligned) and timing constraint (center_aligned) are not consistent.
I took the following link as reference. There is still big timing violation in my design. My project is attached.
What else I can try?
For the TX, you can refer to my previous suggestion. For RX, you can try to add following setting in the .qsf file.
set_instance_assignment -name GLOBAL_SIGNAL OFF -to fpga_enet2_rx_clk
My timing violation is caused by the TX path.
I read AN647 and have a close look at the example design for Cyclone V.
I noticed in the example design, TX is edge-aligned, i.e. there is no TX clock delay in FPGA.
However, the timing constraint is not set according to AN433 and AN477.
In AN477, the Tsu and Th is -0.9 and 2.7 respectively when enabling delay for PHY (Marvel 88EE1111) . Also multicycle path should be set for TX path, see page 14 of AN477. If multi cycle path is not set, then extra delay should be added when set output delay (See page 14 of AN433 ). Apparently, AN647 example neither set multi cycle path, nor adds extra delay. In stead, it sets output delay according to Page 10 of AN477, which is for center aligned TX path, but the center aligned TX path needs TX clock has phase shift of 90, which AN647 example does not have.
Since AN647 example does not set multi cycle path, so it passes timing constraint. If I set multi cycle for TX path according to AN477, the timing fails too.
I removed multi cycle path setting for TX path in my design, change Tsu and Th to 1.0 and -0.8. The timing violation is gone. I can understand why the timing is closed after multi cycle setting is removed.
Now my question is:
Was AN647 example tested and worked successfully, does it mean AN477 and AN433 are actually wrong guide?
Thank you very much in advance!