Closed tristanitschner closed 2 months ago
Nvm, I'm wrong with what I said above. Exactly the same timing issues are present in the multicore VexRiscv image, and there ethernet works. In as far as the sdcard is concerned, I found out that it only works for 100 MHz or 50 MHz, but not for 75 Mhz, is this intended? But regarding ethernet, I'm still dumbfounded. Maybe it's a driver issue. I'll investigate further.
Ok, it is definitely related to recent crc changes in liteeth. I could reproduce the issue with latest liteeth on VexRiscv. Liteeth release tag 2023.12 works perfectly fine tough, tested with VexRiscv and NaxRiscv SoCs. Finally I can connect to the internet via Debian on quad core NaxRiscv! :)
Hi @tristantschner,
would you mind sharing your build command? I'll have a look at the timing issue and compare upstream with 2023.12.
The command was:
python3 -m litex_boards.targets.digilent_nexys_video --cpu-type=naxriscv --bus-standard axi-lite \
--with-video-framebuffer --with-coherent-dma --with-spi-sdcard --with-ethernet --xlen=64 \
--scala-args='rvc=true,rvf=true,rvd=true,alu-count=2,decode-count=2' --with-jtag-tap \
--sys-clk-freq 75000000 --cpu-count 4 --soc-json build/digilent_nexys_video/csr.json \
--update-repo no --build
I used Vivado version 2023.2. I also still have the implemented design check point on my disk, if you'd like that.
Hi @tristanitschner,
pretty sure the regression is the same than the one identified and fixed here: https://github.com/enjoy-digital/liteeth/commit/79ccffcfa748cc7d1fb683e43265bf0c6ebb1d3c and that has been fixed a few days after your initial tests.
I'm closing since confident this is solved, if not please comment or re-open.
Hi there,
i stumbled upon a severe timing issue with Liteeth while trying to bring up a quad core Naxriscv SoC on the Nexys Video.
In the generated xdc there is:
This leads to an invalid clock redefinition on a clock tree. Although the first clock tree is only one net, this does not matter.
eth_rx_data is clocked with eth_rx_clk. I checked bus skew, and it looks good.
Propagation for eth_clocks_rx is eth_clocks_rx -- [through IBUF and BUFG] --> eth_rx_clk
Timing for this path is:
And after the redefinition:
So eth_clocks_rx is delayed by ~ 6ns before it becomes eth_rx_clk.
Timing for eth_rx_data looks as configured in IDELAY2 for ~ 2 ns (although I don't understand why it is about 0.1 ns slower):
Though this doesn't matter due to clock redefinition. So total delay for data is ~ 4.7 ns.
According to RTL8211E-VL datasheet RXC is synchronous to RXD if RXDLY = 0, which is the case for Nexys Video. So FPGA must account for skew and setup. Skew is ~1.8 ns and setup is ~ 2ns and hold ~ 2ns. So it is best to sample ~3.5 ns after rising edge of rxc.
So eth_clocks_rx should be delayed by 3 to 4 ns.
Looking at the timing reports above, it is apparent that eth_clock_rx is delayed by ~ 3.8 ns, then it become eth_rx_clk, which is again delay by ~ 2.1 ns. eth_rx_data is delayed by ~4.7 ns.
So sampling happens after ~ 0.2 ns.
So it is really off. The result is that the ethmac_rx_datapath_crc_errors register is continually counting up. Transmission is working though, I just can't receive. (Although ethernet had been working in another VexRiscv design, so it's definitely not the phy.)
I might also add, that this effect is "by chance" due to clock redefinition. Given a smaller design, it is less likely for this issue to occur. Vivado just ignores that one path in timing.
Given the complicated clocking architecture of Litex and my inexperience with the framework, I thought it would be best to open an issue.
I suspect that there is similar issue with Litesdcard. I could only get it working with 100 MHz sys clock frequency, but then I can't use NaxRiscv as CPU due to timing. I will investigate further.