微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 嵌入式设计讨论 > FPGA,CPLD和ASIC > 一个关于gtp对齐的问题

一个关于gtp对齐的问题

时间:10-02 整理:3721RD 点击:
我用gtp通过光纤去传送32位(8b/10b使能)数据.代码如下.当state在2'b10时,我使用如下三种可能的代码(                                            ​                                                  ​                                                  ​                      2'b10:begin  tile0_txdata0_i<=32'h0abc0908;TXCHARISK0_IN<=4'h4; state<=2'b11;end                                                                                         2'b10:begin  tile0_txdata0_i<=32'h0a0908bc;TXCHARISK0_IN<=4'h1​; state<=2'b11;end
                                                      2'b10:begin tile0_txdata0_i<=32'h09bc08bc;TXCHARISK0_IN<=4'h5; state<=2'b11;end ),
但我都不能保证光纤另一端的接收端( ALIGN_COMMA_WORD 属性=2 )得到的数据为32'h0abc0908, 32'h0a0908bc 或 32'h09bc08bc,得到的数据可能是 ****0abc,08bc****,****09bc.所以我不能保证接下来的数据会被对齐.怎样才能确保comma(8'hBC)对齐到接收端的第一个字节?

always@(posedge tile0_txusrclk20_i or negedge tile0_resetdone0_i )
begin
if(tile0_resetdone0_i==1'b0)
begin
state<=2'b00;
tile0_txdata0_i<=32'h00000000;
TXCHARISK0_IN<=4'h0;
end
else
begin
case(state)
2'b00:begin tile0_txdata0_i<=32'h03020100;TXCHARISK0_IN<=4'h0;​state<=2'b01; end
2'b01:begin tile0_txdata0_i<=32'h07060504;TXCHARISK0_IN<=4'h0;​state<=2'b10; end
2'b10:begin tile0_txdata0_i<=32'h0abc0908;TXCHARISK0_IN<=4'h4;​state<=2'b11;end
2'b11:begin tile0_txdata0_i<=32'h0000ffff;TXCHARISK0_IN<=4'h0;​end
endcase
end
end

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top