MGT Transciever

Dec 18, 2007 2 Replies

Hi alll,



I am trying to setup simple TX and RX communication using the MGT Transceiver without any 8b/10b encoding. I see the exact output TXP and TXP pins. But the RX data decoded seemed to be misaligned by one bit. Recovered Clk is buffered to connect to RXUSRCLK_IN and RXUSRCLK2_IN.



Sample module is given below.. is there anything iam missing here?



Thanks, Shakith



module rr(BREFCLK_IN, BREFCLK2_IN, LOOPBACK_IN, POWERDOWN_IN, REFCLKSEL_IN, RXN_IN, RXPOLARITY_IN, RXP_IN, RXRESET_IN, RXUSRCLK_IN, RXUSRCLK2_IN, TXDATA_IN, TXINHIBIT_IN, TXPOLARITY_IN, TXRESET_IN, TXUSRCLK_IN, TXUSRCLK2_IN, RXBUFSTATUS_OUT, RXDATA_OUT, RXRECCLK_OUT, TXBUFERR_OUT, TXN_OUT, TXP_OUT, rx_status);



input BREFCLK_IN; input BREFCLK2_IN; input [1:0] LOOPBACK_IN; input POWERDOWN_IN; input REFCLKSEL_IN; input RXN_IN; input RXPOLARITY_IN; input RXP_IN; input RXRESET_IN; input RXUSRCLK_IN; input RXUSRCLK2_IN; input [19:0] TXDATA_IN; input TXINHIBIT_IN; input TXPOLARITY_IN; input TXRESET_IN; input TXUSRCLK_IN; input TXUSRCLK2_IN; output [1:0] RXBUFSTATUS_OUT; output [19:0] RXDATA_OUT; output RXRECCLK_OUT; output TXBUFERR_OUT; output TXN_OUT; output TXP_OUT; output [2:0] rx_status;



wire GND_BIT; wire [3:0] GND_BUS_4; wire [1:0] RXCHARISK_float; wire [15:0] RXDATA_float; wire [1:0] RXRUNDISP_float; wire [1:0] TXCHARDISPMODE_GND; wire [1:0] TXCHARDISPVAL_GND; wire [15:0] TXDATA_GND; wire [3:0] VCC_BUS_4;



assign GND_BIT = 0; assign GND_BUS_4 = 4'b0000; assign TXCHARDISPMODE_GND = 2'b00; assign TXCHARDISPVAL_GND = 2'b00; assign TXDATA_GND = 16'b0000000000000000; assign VCC_BUS_4 = 4'b1111; GT_CUSTOM GT_CUSTOM_INST (.BREFCLK(BREFCLK_IN), .BREFCLK2(BREFCLK2_IN), .CHBONDI(GND_BUS_4[3:0]), .CONFIGENABLE(GND_BIT), .CONFIGIN(GND_BIT), .ENCHANSYNC(GND_BIT), .ENMCOMMAALIGN(GND_BIT), .ENPCOMMAALIGN(GND_BIT), .LOOPBACK(LOOPBACK_IN[1:0]), .POWERDOWN(POWERDOWN_IN), .REFCLK(GND_BIT), .REFCLKSEL(REFCLKSEL_IN), .REFCLK2(GND_BIT), .RXN(RXN_IN), .RXP(RXP_IN), .RXPOLARITY(RXPOLARITY_IN), .RXRESET(RXRESET_IN), .RXUSRCLK(RXUSRCLK_IN), .RXUSRCLK2(RXUSRCLK2_IN), .TXBYPASS8B10B(VCC_BUS_4[3:0]), .TXCHARDISPMODE({TXCHARDISPMODE_GND[1:0], TXDATA_IN[19:19], TXDATA_IN[9:9]}), .TXCHARDISPVAL({TXCHARDISPVAL_GND[1:0], TXDATA_IN[18:18], TXDATA_IN[8:8]}), .TXCHARISK(GND_BUS_4[3:0]), .TXDATA({TXDATA_GND[15:0], TXDATA_IN[17:10], TXDATA_IN[7:0]}), .TXFORCECRCERR(GND_BIT), .TXINHIBIT(TXINHIBIT_IN), .TXPOLARITY(TXPOLARITY_IN), .TXRESET(TXRESET_IN), .TXUSRCLK(TXUSRCLK_IN), .TXUSRCLK2(TXUSRCLK2_IN), .CHBONDDONE(), .CHBONDO(), .CONFIGOUT(), .RXBUFSTATUS(RXBUFSTATUS_OUT[1:0]), .RXCHARISCOMMA(), .RXCHARISK({RXCHARISK_float[1:0], RXDATA_OUT[19:19], RXDATA_OUT[9:9]}), .RXCHECKINGCRC(), .RXCLKCORCNT(rx_status), .RXCOMMADET(), .RXCRCERR(), .RXDATA({RXDATA_float[15:0], RXDATA_OUT[17:10], RXDATA_OUT[7:0]}), .RXDISPERR(), .RXLOSSOFSYNC(), .RXNOTINTABLE(), .RXREALIGN(), .RXRECCLK(RXRECCLK_OUT), .RXRUNDISP({RXRUNDISP_float[1:0], RXDATA_OUT[18:18], RXDATA_OUT[8:8]}), .TXBUFERR(TXBUFERR_OUT), .TXKERR(), .TXN(TXN_OUT), .TXP(TXP_OUT), .TXRUNDISP()); defparam GT_CUSTOM_INST.ALIGN_COMMA_MSB = "FALSE"; defparam GT_CUSTOM_INST.CHAN_BOND_LIMIT = 16; defparam GT_CUSTOM_INST.CHAN_BOND_MODE = "OFF"; defparam GT_CUSTOM_INST.CHAN_BOND_OFFSET = 8; defparam GT_CUSTOM_INST.CHAN_BOND_ONE_SHOT = "FALSE"; defparam GT_CUSTOM_INST.CHAN_BOND_SEQ_1_1 = 11'b00000000000; defparam GT_CUSTOM_INST.CHAN_BOND_SEQ_1_2 = 11'b00000000000; defparam GT_CUSTOM_INST.CHAN_BOND_SEQ_1_3 = 11'b00000000000; defparam GT_CUSTOM_INST.CHAN_BOND_SEQ_1_4 = 11'b00000000000; defparam GT_CUSTOM_INST.CHAN_BOND_SEQ_2_1 = 11'b00000000000; defparam GT_CUSTOM_INST.CHAN_BOND_SEQ_2_2 = 11'b00000000000; defparam GT_CUSTOM_INST.CHAN_BOND_SEQ_2_3 = 11'b00000000000; defparam GT_CUSTOM_INST.CHAN_BOND_SEQ_2_4 = 11'b00000000000; defparam GT_CUSTOM_INST.CHAN_BOND_SEQ_2_USE = "FALSE"; defparam GT_CUSTOM_INST.CHAN_BOND_SEQ_LEN = 1; defparam GT_CUSTOM_INST.CHAN_BOND_WAIT = 8; defparam GT_CUSTOM_INST.CLK_CORRECT_USE = "FALSE"; defparam GT_CUSTOM_INST.CLK_COR_INSERT_IDLE_FLAG = "FALSE"; defparam GT_CUSTOM_INST.CLK_COR_KEEP_IDLE = "FALSE"; defparam GT_CUSTOM_INST.CLK_COR_REPEAT_WAIT = 1; defparam GT_CUSTOM_INST.CLK_COR_SEQ_1_1 = 11'b00000000000; defparam GT_CUSTOM_INST.CLK_COR_SEQ_1_2 = 11'b00000000000; defparam GT_CUSTOM_INST.CLK_COR_SEQ_1_3 = 11'b00000000000; defparam GT_CUSTOM_INST.CLK_COR_SEQ_1_4 = 11'b00000000000; defparam GT_CUSTOM_INST.CLK_COR_SEQ_2_1 = 11'b00000000000; defparam GT_CUSTOM_INST.CLK_COR_SEQ_2_2 = 11'b00000000000; defparam GT_CUSTOM_INST.CLK_COR_SEQ_2_3 = 11'b00000000000; defparam GT_CUSTOM_INST.CLK_COR_SEQ_2_4 = 11'b00000000000; defparam GT_CUSTOM_INST.CLK_COR_SEQ_2_USE = "FALSE"; defparam GT_CUSTOM_INST.CLK_COR_SEQ_LEN = 1; defparam GT_CUSTOM_INST.COMMA_10B_MASK = 10'b0000000000; defparam GT_CUSTOM_INST.CRC_END_OF_PKT = "K29_7"; defparam GT_CUSTOM_INST.CRC_FORMAT = "USER_MODE"; defparam GT_CUSTOM_INST.CRC_START_OF_PKT = "K27_7"; defparam GT_CUSTOM_INST.DEC_MCOMMA_DETECT = "FALSE"; defparam GT_CUSTOM_INST.DEC_PCOMMA_DETECT = "FALSE"; defparam GT_CUSTOM_INST.DEC_VALID_COMMA_ONLY = "TRUE"; defparam GT_CUSTOM_INST.MCOMMA_10B_VALUE = 10'b1100000000; defparam GT_CUSTOM_INST.MCOMMA_DETECT = "FALSE"; defparam GT_CUSTOM_INST.PCOMMA_10B_VALUE = 10'b0011111000; defparam GT_CUSTOM_INST.PCOMMA_DETECT = "FALSE"; defparam GT_CUSTOM_INST.RX_BUFFER_USE = "TRUE"; defparam GT_CUSTOM_INST.RX_CRC_USE = "FALSE"; defparam GT_CUSTOM_INST.RX_DATA_WIDTH = 2; defparam GT_CUSTOM_INST.RX_DECODE_USE = "FALSE"; defparam GT_CUSTOM_INST.RX_LOSS_OF_SYNC_FSM = "FALSE"; defparam GT_CUSTOM_INST.RX_LOS_INVALID_INCR = 1; defparam GT_CUSTOM_INST.RX_LOS_THRESHOLD = 4; defparam GT_CUSTOM_INST.TERMINATION_IMP = 50; defparam GT_CUSTOM_INST.SERDES_10B = "FALSE"; defparam GT_CUSTOM_INST.TX_BUFFER_USE = "TRUE"; defparam GT_CUSTOM_INST.TX_CRC_FORCE_VALUE = 8'b11010110; defparam GT_CUSTOM_INST.TX_CRC_USE = "FALSE"; defparam GT_CUSTOM_INST.TX_DATA_WIDTH = 2; defparam GT_CUSTOM_INST.TX_DIFF_CTRL = 500; defparam GT_CUSTOM_INST.TX_PREEMPHASIS = 0; defparam GT_CUSTOM_INST.REF_CLK_V_SEL = 1; endmodule


hmm, Played around with it a bit more...Removed the RX and enabled the loop back mode in a single MGT. The parallel mode gives the correct output while the serial mode has misalignment issue. Seems like it's nothing to do with clock correction i guess then...

Thanks,

Shakith

Shakith,

Generally speaking, if you turn off the encoding (8b10b or 64/66b), then you are responsible for aligning bytes, and frames (as the MGT now just sends bits, and gets bits, and has no knowledge of what to do with them).

A major advantage of the encoding is it defines the beginning and end of bytes (allows for byte synchronization), and it also enforces a 1's density such that whatever data you decide to send is unaffected by long strings of 0's or 1's (with no encoding, serial channels will eventually lose sync if there are no transitions from 1 to 0 or - to 1 -- this is known as the "run length" and is something else you have to worry about if you turn off the encoding).

My advice: leave 8b10b on, and do it the easy way.

Austin

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required