The wizard example design instantiates an independent PRBS data checker module for each enabled transceiver channel. The combined and synchronized match signal is used by the link status logic, which produces a link status indicator using a simple state machine within the wizard example design. To best represent the link health of the example design system, the link status indicator follows the combined PRBS match value but is resilient to occasional mismatches such as infrequent bit errors.
The link status state machine uses a leaky bucket algorithm to accumulate multiple consecutive clock cycles of combined PRBS matches, incrementing a link counter to its prescribed maximum before reporting that the link is up (indicated by link_status_out = 1). After the link is up, any PRBS mismatches cause a more rapid decrease in the link counter, such that bursts of mismatches or independent mismatches in close proximity quickly reduce the link counter to its prescribed minimum where the link is reported as down (indicated by link_status_out = 0). The logic operates continually, and therefore automatically attempts to recover from transient mismatches or regain link upon its loss. This Figure illustrates the behavior of the link counter and resulting link status in response to various PRBS checker conditions.
Whenever the link is down, including at the start of operation, the sticky link down indicator
link_down_latched_out
is set to 1. It can only be reset by assertion of the
link_down_latched_reset_in
input.
A simple use of the link status interface in hardware is to map
link_status_out
and
link_down_latched_out
to active-High LEDs, and
link_down_latched_reset_in
to an active-High pushbutton. The
link_status_out
LED gives a rough estimation of link behavior, while even momentary loss of link is visible due to the sticky behavior of
link_down_latched_out
lighting the LED. The
link_down_latched_reset_in
pushbutton clears
link_down_latched_out
, turning off its LED as long as the link remains up. These link status interface signals are also connected to the VIO core instance by default.