Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Etherbone testing #106

Open
wants to merge 33 commits into
base: master
Choose a base branch
from

Conversation

michael-betz
Copy link
Contributor

@michael-betz michael-betz commented Apr 26, 2022

Various tweaks to improve icmp and etherbone testing and troubleshooting.

  • icmp header: split quench field into ident and sequence fields
  • arp.py: make the cached mac address writable from a testbench (to speed it up)
  • model/etherbone.py: add timeout to receive(), fix length field in header
  • model/icmp.py: make send() calculate the checksum of the icmp-packet
  • model/ip.py: fix checksum calculation for odd number of bytes
  • model/phy.py: add optional check for stalling (valid de-asserted mid-stream) because some PHYs don't tolerate that.
  • dump sent / received packets to a .pcap file for analysis with wireshark
  • model/udp.py: fix total_length field in header
  • test_etherbone.py: check probe, write and read response for 8, 32 and 64 bit datapaths
  • test_icmp.py: check ping response for 8, 32 and 64 bit datapaths

This needs some changes to litex, in particular to PacketLogger, PacketStreamer and StrideConverter, which is why CI is failing. See the corresponding pull request to litex

michael-betz and others added 30 commits December 27, 2021 01:24
  * only send a ping reply to type 8 (ping request) packets
  * otherwise liteeth would send a ping reply to
    `destination unreachable` packets too, which is not wanted
there is a liteeth problem with the ping replies
also, add checks to ICMP testbench
also: it should be able to digest bytes and convert them to
dw sized words on its own
test_icmp.py passes for DW=8 but fails for DW=32
  * removed the state machine and replaced it by a sequential
    code
  * this fixes the mac_core testbench
  * in some cases, the delayed sink data was updated even though
    sink was not valid, leading to corrupted source data
  * this broke etherbone reads with DW=64
  * push IP address directly into ARP table
  * re-organize unit-test structure
  * remove some debug prints
  * because some phy's don't have buffers and don't like to be stalled
  * add stall checks to test_icmp.py
  * 64 bit datapath needs to stall the PHY by design
  * need some buffer somewhere to avoid that with real hardware
  * to prevent stalling the PHY when using etherbone with DW=64
  * due to StrideConverter bug
This reverts commit 09d59c0.

To my surprise, stalling the XGMII PHY seems to work fine on hardware.
The anti-underflow FIFO does not seem to be required.
I haven't yet investigated why.
@michael-betz michael-betz marked this pull request as ready for review April 26, 2022 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant