An autodetect circuit for a router system includes an interface to two
bidirectional serial links, an input multiplexer circuit coupled to one
side of the link interface for receiving input data signals and clock
signals, a receiver coupled to the input multiplexer circuit and to a
receive FIFO, a state machine coupled to the receiver, a transmitter
coupled to the state machine, a transmit FIFO, and to the other side of
the link interface for transmitting output data, and a counter coupled to
the state machine for controlling the input multiplexer circuit. The
autodetect circuit determines which of the two links "A" or "B" is active
and available for transmission. The counter is incremented whenever a
link reset occurs. When the count reaches a predetermined maximum count
value, a port enable signal is toggled from the default "A" link to the
"B" link. When one port is enabled, any activity on the other port is
ignored.