txdata_resync_strobe <= ~wrap_txreset_ ? 1'b0 : ((~txdata_resync_nempty) ? txdata_resync_strobe : ~txdata_resync_strobe); // -> 1 once every resynced dword = signal to latch it
end
// nempty_rr & nempty => shall be at least 2 elements in fifo
// no resync is needed => straightforward assignments
...
...
@@ -397,28 +344,33 @@ gtx_10x8dec gtx_10x8dec(
.notintable(rxnotintable_dec_out),
.disperror(rxdisperr_dec_out)
);
// iface resync
wirerxcomwakedet_gtx;
wirerxcominitdet_gtx;
`ifdefOLD_ELASTIC
// elastic buffer: transition from xclk to rxusrclk
wire[15:0]rxdata_els_out;
wire[1:0]rxcharisk_els_out;
wire[1:0]rxnotintable_els_out;
wire[1:0]rxdisperr_els_out;
wirelword_strobe;
wireisaligned;
wireelastic_full;
wireelastic_empty;
// elastic buffer: transition from xclk to rxusrclk
wire[15:0]rxdata_els_out;
wire[1:0]rxcharisk_els_out;
wire[1:0]rxnotintable_els_out;
wire[1:0]rxdisperr_els_out;
wirelword_strobe;
wireisaligned;
wireelastic_full;
wireelastic_empty;
gtx_elastic#(
gtx_elastic#(
.DEPTH_LOG2(3),
.OFFSET(4)
)
gtx_elastic(
// .rst (~rx_clocks_aligned), // ~wrap_rxreset_),
)
gtx_elastic(
// .rst (~rx_clocks_aligned), // ~wrap_rxreset_),
.rst(~wrap_rxreset_),
.wclk(xclk),
.rclk(rxusrclk),
/// .isaligned_in (state_aligned),
/// .isaligned_in (state_aligned),
.isaligned_in(state_aligned&&rxdlysresetdone_r),// rx_clocks_aligned), //Allow to align early, but do not tell it is aligned until xclk is aligned to SIPO par. clock
.charisk_in(rxcharisk_dec_out),
.notintable_in(rxnotintable_dec_out),
...
...
@@ -435,28 +387,16 @@ gtx_elastic(
.full(elastic_full),
.empty(elastic_empty)
);
);
// iface resync
/*
output wire cplllock, - async
output wire rxbyteisaligned,- rxusrclk2
output wire rxcomwakedet, - rxusrclk2
output wire rxcominitdet, - rxusrclk2
output wire rxelecidle, - async
output wire rxresetdone, - rxusrclk2
output wire txresetdone, - txusrclk2
*/
wirerxcomwakedet_gtx;
wirerxcominitdet_gtx;
regrxcomwakedet_gtx_r;
regrxcominitdet_gtx_r;
// iface resync
regrxcomwakedet_gtx_r;
regrxcominitdet_gtx_r;
// insert resync if it's necessary
generate
if(DATA_BYTE_WIDTH==4)begin
// insert resync if it's necessary
generate
if(DATA_BYTE_WIDTH==4)begin
// resync to rxusrclk
// Fin = 2*Fout => 2*WIDTHin = WIDTHout
// first data word arrived = last word of a primitive, second arrived - first one
...
...
@@ -482,9 +422,18 @@ if (DATA_BYTE_WIDTH == 4) begin