Skip to content

Commit 02f70ad

Browse files
committed
ad9081: vck190: Added support for JESD204B
ad9209: vck190: system_top: Changed serial connections Signed-off-by: Bogdan Luncan <[email protected]>
1 parent a806a6f commit 02f70ad

File tree

12 files changed

+1335
-306
lines changed

12 files changed

+1335
-306
lines changed

library/jesd204/jesd204_versal_gt_adapter_rx/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
LIBRARY_NAME := jesd204_versal_gt_adapter_rx
88

99
GENERIC_DEPS += jesd204_versal_gt_adapter_rx.v
10+
GENERIC_DEPS += lane_align.v
1011

1112
XILINX_DEPS += ../jesd204_common/sync_header_align.v
1213
XILINX_DEPS += jesd204_versal_gt_adapter_rx_ip.tcl

library/jesd204/jesd204_versal_gt_adapter_rx/jesd204_versal_gt_adapter_rx.v

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,34 @@
77

88
`timescale 1ns/100ps
99

10-
module jesd204_versal_gt_adapter_rx (
10+
module jesd204_versal_gt_adapter_rx #(
11+
parameter LINK_MODE = 2 // 1 - 8B10B, 2 - 64B66B
12+
)(
13+
// Interface to Physical Layer
1114
input [127 : 0] rxdata,
12-
input [5 : 0] rxheader,
15+
input [ 5 : 0] rxheader,
16+
input [ 15 : 0] rxctrl0,
17+
input [ 15 : 0] rxctrl1,
18+
input [ 7 : 0] rxctrl2,
19+
input [ 7 : 0] rxctrl3,
1320
output rxgearboxslip,
14-
input [1 : 0] rxheadervalid,
21+
input [ 1 : 0] rxheadervalid,
22+
output rxslide,
1523

1624
// Interface to Link layer core
17-
output [63:0] rx_data,
18-
output [1:0] rx_header,
19-
output rx_block_sync,
25+
output [ 63 : 0] rx_data,
26+
output [ 3 : 0] rx_charisk,
27+
output [ 3 : 0] rx_disperr,
28+
output [ 3 : 0] rx_notintable,
29+
output [ 1 : 0] rx_header,
30+
output rx_block_sync,
31+
input en_char_align,
2032

21-
input usr_clk
33+
input resetn,
34+
input usr_clk
2235
);
2336

37+
generate if (LINK_MODE == 2) begin
2438
// Sync header alignment
2539
wire rx_bitslip_req_s;
2640
reg [4:0] rx_bitslip_done_cnt = 'h0;
@@ -56,4 +70,29 @@ module jesd204_versal_gt_adapter_rx (
5670
.o_header(rx_header),
5771
.o_block_sync(rx_block_sync));
5872

73+
assign rx_disperr = 4'b0;
74+
assign rx_charisk = 4'b0;
75+
assign rx_notintable = 4'b0;
76+
assign rxslide = 1'b0;
77+
end else begin
78+
assign rx_data = {32'b0, rxdata[31:0]};
79+
assign rx_header = rxheader[1:0];
80+
81+
assign rx_charisk = rxctrl0[3:0];
82+
assign rx_disperr = rxctrl1[3:0];
83+
assign rx_notintable = rxctrl3[3:0];
84+
assign rx_block_sync = 1'b0;
85+
assign rxgearboxslip = 1'b0;
86+
87+
lane_align i_lane_align (
88+
.usr_clk (usr_clk),
89+
.resetn (resetn),
90+
.rxdata (rxdata[31:0]),
91+
.rx_slide (rxslide),
92+
.en_char_align (en_char_align)
93+
);
94+
95+
end
96+
endgenerate
97+
5998
endmodule

library/jesd204/jesd204_versal_gt_adapter_rx/jesd204_versal_gt_adapter_rx_ip.tcl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ source $ad_hdl_dir/library/scripts/adi_ip_xilinx.tcl
99
adi_ip_create jesd204_versal_gt_adapter_rx
1010
adi_ip_files jesd204_versal_gt_adapter_rx [list \
1111
jesd204_versal_gt_adapter_rx.v \
12+
lane_align.v \
1213
../jesd204_common/sync_header_align.v \
1314
]
1415

@@ -23,6 +24,9 @@ adi_add_bus "RX" "master" \
2324
{ \
2425
{ "rx_data" "rxdata" } \
2526
{ "rx_header" "rxheader" } \
27+
{ "rx_charisk" "rxcharisk"} \
28+
{ "rx_disperr" "rxdisperr"} \
29+
{ "rx_notintable" "rxnotintable"} \
2630
{ "rx_block_sync" "rxblock_sync" } \
2731
}
2832

@@ -32,6 +36,11 @@ adi_add_bus "RX_GT_IP_Interface" "master" \
3236
{ \
3337
{ "rxdata" "ch_rxdata" } \
3438
{ "rxheader" "ch_rxheader" } \
39+
{ "rxctrl0" "ch_rxctrl0" } \
40+
{ "rxctrl1" "ch_rxctrl1" } \
41+
{ "rxctrl2" "ch_rxctrl2" } \
42+
{ "rxctrl3" "ch_rxctrl3" } \
43+
{ "rxslide" "ch_rxslide" } \
3544
{ "rxheadervalid" "ch_rxheadervalid" } \
3645
{ "rxgearboxslip" "ch_rxgearboxslip" } \
3746
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
module lane_align (
2+
input usr_clk,
3+
input resetn,
4+
input [31:0] rxdata,
5+
input en_char_align,
6+
output rx_slide
7+
);
8+
9+
localparam K_CHARACTER = 32'hBCBCBCBC;
10+
11+
localparam WAIT_FOR_CHAR_ALIGN = 0;
12+
localparam CHECK_ALIGNMENT = 1;
13+
localparam PULSE_SLIDE = 2;
14+
localparam WAIT_DELAY = 3;
15+
16+
reg [2:0] state;
17+
reg [2:0] next_state;
18+
reg [5:0] counter;
19+
reg [5:0] next_counter;
20+
wire rx_slide_s;
21+
22+
always @(negedge resetn or posedge usr_clk) begin
23+
if (!resetn) begin
24+
state <= WAIT_FOR_CHAR_ALIGN;
25+
counter <= 'd0;
26+
end else begin
27+
state <= next_state;
28+
counter <= next_counter;
29+
end
30+
end
31+
32+
always @(*) begin
33+
next_counter <= counter;
34+
case (state)
35+
WAIT_FOR_CHAR_ALIGN: begin
36+
if (en_char_align) begin
37+
next_state <= CHECK_ALIGNMENT;
38+
end else begin
39+
next_state <= WAIT_FOR_CHAR_ALIGN;
40+
end
41+
end
42+
CHECK_ALIGNMENT: begin
43+
if (rxdata == K_CHARACTER) begin
44+
next_state <= WAIT_FOR_CHAR_ALIGN;
45+
end else begin
46+
next_counter <= 'd0;
47+
next_state <= PULSE_SLIDE;
48+
end
49+
end
50+
PULSE_SLIDE: begin // a pulse is valid only if it takes 2 usr_clk cycles
51+
if (counter == 'd1) begin
52+
next_state <= WAIT_DELAY;
53+
next_counter <= 'd0;
54+
end else begin
55+
next_state <= PULSE_SLIDE;
56+
next_counter <= counter + 1'b1;
57+
end
58+
end
59+
WAIT_DELAY: begin // wait 32 usr_clk cycles between each pulse
60+
if (counter == 'd32) begin
61+
next_state <= CHECK_ALIGNMENT;
62+
end else begin
63+
next_state <= WAIT_DELAY;
64+
next_counter <= counter + 1'b1;
65+
end
66+
end
67+
endcase
68+
end
69+
70+
assign rx_slide_s = (state == PULSE_SLIDE)? 1'b1 : 1'b0;
71+
72+
assign rx_slide = rx_slide_s;
73+
74+
endmodule

library/jesd204/jesd204_versal_gt_adapter_tx/jesd204_versal_gt_adapter_tx.v

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,41 @@
77

88
`timescale 1ns/100ps
99

10-
module jesd204_versal_gt_adapter_tx (
10+
module jesd204_versal_gt_adapter_tx #(
11+
parameter LINK_MODE = 2 // 1 - 8B10B, 2 - 64B66B
12+
)(
1113
output [127 : 0] txdata,
12-
output [5 : 0] txheader,
13-
14+
output [ 5 : 0] txheader,
15+
output [ 15 : 0] txctrl0,
16+
output [ 15 : 0] txctrl1,
17+
output [ 7 : 0] txctrl2,
1418
// Interface to Link layer core
15-
input [63:0] tx_data,
16-
input [1:0] tx_header,
19+
input [ 63 : 0] tx_data,
20+
input [ 1 : 0] tx_header,
21+
input [ 3 : 0] tx_charisk,
1722

1823
input usr_clk
1924
);
2025

21-
wire [63:0] tx_data_flip;
22-
genvar i;
23-
for (i = 0; i < 64; i=i+1) begin
24-
assign tx_data_flip[63-i] = tx_data[i];
25-
end
26+
generate if (LINK_MODE == 2) begin
27+
wire [63:0] tx_data_flip;
28+
genvar i;
29+
for (i = 0; i < 64; i=i+1) begin
30+
assign tx_data_flip[63-i] = tx_data[i];
31+
end
2632

27-
assign txdata = {64'b0,tx_data_flip};
28-
// Flip header bits and data
29-
assign txheader = {4'b0,tx_header[0],tx_header[1]};
33+
assign txdata = {64'b0, tx_data_flip};
34+
assign txheader = {4'b0, tx_header[0], tx_header[1]};
35+
assign txctrl0 = 16'b0;
36+
assign txctrl1 = 16'b0;
37+
assign txctrl2 = 16'b0;
38+
end else begin
39+
assign txdata = {96'b0, tx_data[31:0]};
40+
assign txheader = {4'b0, tx_header};
41+
assign txctrl0 = 16'b0;
42+
assign txctrl1 = 16'b0;
43+
assign txctrl2 = {4'b0, tx_charisk};
44+
end
45+
endgenerate
3046

3147
endmodule

library/jesd204/jesd204_versal_gt_adapter_tx/jesd204_versal_gt_adapter_tx_ip.tcl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ adi_add_bus "TX_GT_IP_Interface" "master" \
2222
{ \
2323
{ "txdata" "ch_txdata" } \
2424
{ "txheader" "ch_txheader" } \
25+
{ "txctrl0" "ch_txctrl0" } \
26+
{ "txctrl1" "ch_txctrl1" } \
27+
{ "txctrl2" "ch_txctrl2" } \
2528
}
2629

2730
adi_add_bus "TX" "slave" \
@@ -30,6 +33,7 @@ adi_add_bus "TX" "slave" \
3033
{ \
3134
{ "tx_data" "txdata" } \
3235
{ "tx_header" "txheader" } \
36+
{ "tx_charisk" "txcharisk" } \
3337
}
3438

3539
ipx::save_core [ipx::current_core]

0 commit comments

Comments
 (0)