Skip to content

Improve TX Interframe Gap computation #167

@shuchitak

Description

@shuchitak

In the current MAC implementation, required wait for the interframe gap is computed by taking a reference timer snapshot after the CRC word is written out on the TXD and adding the required delay to it.

tx_4b_word(p_mii_txd, crc, tx_port_4b_pins);
ifg_tmr :> ifg_time;
ifg_time += RMII_ETHERNET_IFG_AS_REF_CLOCK_COUNT_4b;

This gives us the time instance till which we wait before sending the next packet.

ifg_tmr :> ifg_time;

RMII_ETHERNET_IFG_AS_REF_CLOCK_COUNT_4b, which should ideally be 96 timer ticks (960 ns), however has some added corrections due to

  • where the timer snapshot is taken wrt when the last bit of the crc word actually makes is out on the wire (TXEN goes down)
  • in the next frame, where we do the ifg_tmr :> ifg_time, wrt the first bit of preamble making it out on the wire (TXEN goes high).
    This is described in a comment in rmii_master.xc.

As is obvious from the comment, the RMII_ETHERNET_IFG_AS_REF_CLOCK_COUNT computation is based on observing the signals in a VCD trace and reasoning the delay from it which is not ideal, esp. if it changes based on the instruction speed (BW availbale to the mac threads).

This issue requires investigating a better way to compute the TX IFG.

Additional details about how the tests measure IFG are in https://xmosjira.atlassian.net/wiki/spaces/Ethernet/pages/4608327685/TX+Interframe+Gap

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions