The frequency of stats_ref_clk
is flexible but depends upon
both the number of counters and the maximum frequency supported by
the MAC. The low-frequency increment vectors can update at a
maximum rate of one per minimum sized Ethernet frame. This
translates to 584 ns when running at 1 Gbps (64 bytes of minimum
Ethernet frame size, plus 1-byte of minimum received preamble, plus
eight bytes of minimum received interframe gap, at a byte rate of
1-byte per 8 ns).
With stats_ref_clk
set to 125 MHz, 36 statistical
counters can be safely updated between successive Ethernet frames
(584 ns divided by the 8 ns clock period of stats_ref_clk
, divided by two because a
counter update requires two accesses). As this is less than the
provided 44 counters, extra decode logic is included to take
advantage of the frame size counters’ one-hot status (that
is, only one of the seven RX and one of the seven TX frame size
counters can update on a per packet basis).
The round-robin function that
controls which counter is being accessed, only accesses the
required frame size counter and skips the other five. This means
the 44 counters supported only require 32 counter accesses.
However, this does mean that the stats_ref_clk
should be at least as fast as
the clock used for the maximum rate supported by the MAC (125 MHz
at 1 Gbps or 12.5 MHz at 10/100 Mbps).