|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
我用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 |
|