这个功能虽然一直在用,但是具体没有研究过具体编码过程:
参考Intel的文档:
agx_52004.pdf
数据输入 datain
表示它的具体bit位出来:
datain[7:0]
+---+---+---+---+---+---+---+---+
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+---+---+---+---+---+---+---+---+按8B10B的过程改下名字
+---+---+---+---+---+---+---+---+
| H | G | F | E | D | C | B | A |
+---+---+---+---+---+---+---+---+拆分后交换位置
前面部分即为Dx.y或Kx.y中的x,范围0-31
后面部分即为Dx.y或Kx.y中的x,范围0-7
+---+---+---+---+---+ +---+---+---+
| E | D | C | B | A | | H | G | F |
+---+---+---+---+---+ +---+---+---+对其编码后为
+---+---+---+---+---+---+ +---+---+---+---+
| i | e | d | c | b | a | | j | h | g | f |
+---+---+---+---+---+---+ +---+---+---+---+再将其交换位置拼接后作为10bit编码结果
+---+---+---+---+---+---+---+---+---+---+
| j | h | g | f | i | e | d | c | b | a |
+---+---+---+---+---+---+---+---+---+---+
具体码是怎么编的,无从得知了。只留下来对照表:
取其中最简单的部分进行分析:
| datain | RD- _ "1"cnt | RD+ _ "1"cnt |
| D0.0 | 1001110100 | 5 | 0110001011 | 5 |
| D1.0 | 0111010100 | 5 | 1000101011 | 5 |
| D2.0 | 1011010100 | 5 | 0100101011 | 5 |
| D3.0 | 1100011011 | 6 | 1100010100 | 4 |
| D4.0 | 1101010100 | 5 | 0010101011 | 5 |
| D5.0 | 1010011011 | 6 | 1010010100 | 4 |
| D6.0 | 0110011011 | 6 | 0110010100 | 4 |
| D7.0 | 1110001011 | 6 | 0001110100 | 4 |
| D8.0 | 1110010100 | 5 | 0001101011 | 5 |
| D9.0 | 1001011011 | 6 | 1001010100 | 4 |
| D10.0 | 0101011011 | 6 | 0101010100 | 4 |
| D11.0 | 1101001011 | 6 | 1101000100 | 4 |
| D12.0 | 0011011011 | 6 | 0011010100 | 4 |
| D13.0 | 1011001011 | 6 | 1011000100 | 4 |
| D14.0 | 0111001011 | 6 | 0111000100 | 4 |
| D15.0 | 0101110100 | 5 | 1010001011 | 5 |
| D16.0 | 0110110100 | 5 | 1001001011 | 5 |
| D17.0 | 1000111011 | 6 | 1000110100 | 4 |
| D18.0 | 0100111011 | 6 | 0100110100 | 4 |
| D19.0 | 1100101011 | 6 | 1100100100 | 4 |
| D20.0 | 0010111011 | 6 | 0010110100 | 4 |
| D21.0 | 1010101011 | 6 | 1010100100 | 4 |
| D22.0 | 0110101011 | 6 | 0110100100 | 4 |
| D23.0 | 1110100100 | 5 | 0001011011 | 5 |
| D24.0 | 1100110100 | 5 | 0011001011 | 5 |
| D25.0 | 1001101011 | 6 | 1001100100 | 4 |
| D26.0 | 0101101011 | 6 | 0101100100 | 4 |
| D27.0 | 1101100100 | 5 | 0010011011 | 5 |
| D28.0 | 0011101011 | 6 | 0011100100 | 4 |
| D29.0 | 1011100100 | 5 | 0100011011 | 5 |
| D30.0 | 0111100100 | 5 | 1000011011 | 5 |
| D31.0 | 1010110100 | 5 | 0101001011 | 5 |
可以发现,RD-中只有5-6,而RD+中只有4-5;
8b10bRD机制是为了保持数据中0和1的个数尽可能一样多;
比方说,现在要输出一组码型:
D0.0, D3.0, D3.0, D3.0, D3.0
那么,默认起始状态为RD-
,并累计1和0的个数。
D0.0 RD- 1001110100 5 5 累计均衡
D3.0 RD- 1100011011 11 9 累计失衡
D3.0 RD+ 1100010100 15 15 累计均衡
D3.0 RD+ 1100010100 19 21 累计失衡
D3.0 RD- 1100011011 25 25 累计均衡
通过切换RD+和RD-,使其达到动态平衡
通过组合逻辑实现时会在gw1nr芯片上产生5级LUT,严重影响时序;直接上个查表就完事了。