Rob,
Of course the FPGA doesn't have any knowledge of the bit stream; which is
why you have to tell it where the data is in relation to the rising edge
of the clock. In the case of a receiver, the MegaWizard function gives
you the option of choosing 0, 45, 90, 135, 180, 225, 270, & 315 degrees.
This is possible because the Wizard funcion uses a PLL to strip the data
from the serialized stream.
What you're talking about here has to do with what Altera calls 'DPA' .
What the data book has to say about DPA is the following (page 51 of 68)
http://www.altera.com/literature/hb/stx2/stx2_sii5v2_03.pdf:
The DPA block aligns the incoming data to one of eight clock
phases to maximize the receiver's skew margin. The DPA circuit can be
bypassed on a channel-by-channel basis if it is not needed. Set the DPA
bypass statically in the Quartus II MegaWizard Plug-In or dynamically
by using the optional RX_DPLL_ENABLE port.
DPA has to do with skewing the SERDES clock a bit (with one of 8 settings)
relative to a particular bit position in order to improve receiver skew
margin in order to correct for known skew that may exist in your system but
can be accounted for ahead of time (i.e. at design time when you're picking
one of those 8 settings). This is not the same thing that I was talking
about though. What I was talking about was along the lines of what is on
the next page in the section titled "Receiver Data Realignment Circuit"
where they say...
The data realignment circuit aligns the word boundary of the incoming
data by inserting bit latencies into the serial stream. An optional
RX_CHANNEL_DATA_ALIGN port controls the bit insertion of each
receiver independently controlled from the internal logic. The data slips
one bit for every pulse on the RX_CHANNEL_DATA_ALIGN port.
If you scroll a bit further to page 58 under the section titled
"Differential I/O Bit Position" is a nice description showing the bit order
of differential data that basically shows that the nominal rising edge of
the SERDES clock occurs roughly at the transition between when data bits 2
and 1 are being transmitted. What they don't say is that you have to use
the above mentioned "Receiver Data Realignment" feature first in order to
get the bits in the proper position.
I ran across this one first in simulation since the receiver was not
performing per the 'Figure 5-14' diagram where I suspected that it was just
Altera's simulation model that was in error. After opening a service
request and subsequent escalations since the problems wasn't resolved and
actually talking to someone at Altera who is very familiar with the SERDES
circuitry the end result was that the simulation model is correct the
diagrams they agreed are somewhat misleading and that the 'Receiver Data
Realignment' feature really does need to be used in order to guarantee that
your design is working correctly at every power up.
Typically everything seems to power up in the same fashion but I've also
seen the actual hardware have to get 're-aligned' after having already been
aligned.
Most discrete SERDES type chips, like National's 90CR types, align the
data with the rising edge of the PLL clock. In this case
And this was my mistake when I thought this to be true with Stratix SERDES
also...thanks to Figure 5-14
KJ