
Contains 8b10 encoder and decoder, 9-bit symbols can be pushed in and results pop out a bunch of clocks later
To be added
Set up the board to use a manual clock. The manual clock is divided by 10 to generate the internal clocks
input data is 9 bit {uio_in[0], ui_in} enable strobe is uio_in[4]., it is clocked by the clock that is driven onto uioi_out[6]
output data is 9 bit {uio_out[1], uo_out} enable strobe is uio_in[3]., it is clocked by the clock that is driven onto uioi_out[5]
during reset uio_in[0] is samp0led and if high the scrambler is enabled (on both units)
To test:
only bits 0 and 4 on the bidirectional pins are used as inputs, set the reset of the pins to outputs
assert reset and set uio_in[0] to 1 and uio_in[4] to 0, generate 5 clocks
deassert reset
generate 20-30 clocks - note that uio_out[5] and uio_out[6] should generate square waves 5 clocks up and 5 clocks down (not necessarily in sync with each other)
uio_out[7] should be 0 (not synced)
So send {b[8], b[7:0]}
send clocks until uio_out[6] is low
set uio_in[4] to 1, set uio_in[0] to b[8] and set ui_in to b[7:0]
send clocks until uio_out[6] is high
set uio_in[4] to 0
to start up the link send a COM character {1'b1, 8'hbc}
run clocks until uio_out[7] is asserted (indicating thge link is locked) as that happens the output clock may misbehave as it syncs up
run another 10 clocks
now send some characters with b[8] set to 0
after each character wait until uio_in[3] is asserted and check that the outputs are the same as what you sent in
repeat the last 2 steps
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | in0 | out0 | ink |
| 1 | in1 | out1 | outk |
| 2 | in2 | out2 | data |
| 3 | in3 | out3 | rcv_ready |
| 4 | in4 | out4 | xmt_ready |
| 5 | in5 | out5 | rcvclk10 |
| 6 | in6 | out6 | xmtclk10 |
| 7 | in7 | out7 | outlocked |