-
Notifications
You must be signed in to change notification settings - Fork 1.6k
ada4355: Add idelay calibration functionality #1690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
TITLE | ||
AXI_ADA4355 (axi_ada4355_adc) | ||
AXI_ADA4355 | ||
ENDTITLE | ||
|
||
############################################################################################ | ||
############################################################################################ | ||
|
||
REG | ||
0x0032 | ||
ENABLE_ERROR | ||
ENABLE ERROR MASK | ||
ENDREG | ||
|
||
FIELD | ||
[2] 0x00000000 | ||
ENABLE_FRAME_ERROR | ||
RW | ||
If set, enable frame error | ||
ENDFIELD | ||
|
||
FIELD | ||
[1] 0x00000000 | ||
ENABLE_LANE_1_ERROR | ||
RW | ||
If set, enable lane 1 error | ||
ENDFIELD | ||
|
||
FIELD | ||
[0] 0x00000000 | ||
ENABLE_LANE_0_ERROR | ||
RW | ||
If set, enable lane 0 error | ||
ENDFIELD | ||
|
||
############################################################################################ | ||
############################################################################################ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
############################################################################### | ||
## Copyright (C) 2025 Analog Devices, Inc. All rights reserved. | ||
# SPDX short identifier: ADIBSD | ||
############################################################################### | ||
|
||
<: set ComponentName [getComponentNameString] :> | ||
<: setOutputDirectory "./" :> | ||
<: setFileName [ttcl_add $ComponentName "_constr"] :> | ||
<: setFileExtension ".xdc" :> | ||
<: setFileProcessingOrder late :> | ||
|
||
set_property ASYNC_REG TRUE \ | ||
[get_cells -quiet -hierarchical *cdc_sync_stage1_reg*] \ | ||
[get_cells -quiet -hierarchical *cdc_sync_stage2_reg*] | ||
|
||
set_false_path -quiet \ | ||
-to [get_cells -quiet -hierarchical -filter {NAME =~ *i_enable_sync/cdc_sync_stage1_reg* && IS_SEQUENTIAL}] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,9 @@ module axi_ada4355_if #( | |
|
||
// Output data | ||
output [15:0] adc_data, | ||
output adc_valid | ||
output adc_valid, | ||
output adc_pn_err, | ||
input [ 2:0] enable_error | ||
); | ||
|
||
// Use always DDR mode for SERDES, useful for SDR mode to adjust capture | ||
|
@@ -86,6 +88,8 @@ module axi_ada4355_if #( | |
FRAME_SHIFTED = 3'h2, | ||
RESET = 3'h3; | ||
localparam [ 7:0] pattern_value = 8'hF0; | ||
localparam [15:0] expected_pattern_lane_0 = 16'h5554; | ||
localparam [15:0] expected_pattern_lane_1 = 16'hAAA8; | ||
|
||
wire clk_in_s; | ||
wire out_ibufmrce_clock; | ||
|
@@ -120,6 +124,7 @@ module axi_ada4355_if #( | |
reg [ 1:0] serdes_valid = 2'b00; | ||
reg [ 1:0] serdes_valid_d = 2'b00; | ||
reg [ 2:0] shift_cnt = 3'd0; | ||
reg [ 4:0] delay = 5'd0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you have a mix of "d", 'h" and "b" types. please use only one (preferably "h") There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
reg [15:0] serdes_data; | ||
reg [15:0] serdes_data_d; | ||
reg [ 7:0] serdes_frame; | ||
|
@@ -130,6 +135,12 @@ module axi_ada4355_if #( | |
reg bufr_alignment; | ||
reg bufr_alignment_bufr; | ||
reg [ 2:0] state = 3'h0; | ||
reg frame_err_r; | ||
reg data_err_lane_0_r; | ||
reg data_err_lane_1_r; | ||
reg [15:0] lane_0_mask = 16'h5555; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these should be localparam, not reg There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
reg [15:0] lane_1_mask = 16'hAAAA; | ||
reg [15:0] test_pattern; | ||
|
||
IBUFGDS i_clk_in_ibuf( | ||
.I(dco_p), | ||
|
@@ -275,38 +286,40 @@ module axi_ada4355_if #( | |
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fix indentation (284) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
|
||
assign adc_clk = adc_clk_div; | ||
assign adc_pn_err = ((data_err_lane_0_r & enable_error[0]) | (data_err_lane_1_r & enable_error[1]) | | ||
(frame_err_r & enable_error[2])); | ||
|
||
assign data_in_p = {d1a_p, d0a_p}; | ||
assign data_in_n = {d1a_n, d0a_n}; | ||
|
||
assign {data_0[0],data_1[0]} = data_s0; // f-e latest bit received | ||
assign {data_0[1],data_1[1]} = data_s1; // r-e | ||
assign {data_0[2],data_1[2]} = data_s2; // f-e | ||
assign {data_0[3],data_1[3]} = data_s3; // r-e | ||
assign {data_0[4],data_1[4]} = data_s4; // f-e | ||
assign {data_0[5],data_1[5]} = data_s5; // r-e | ||
assign {data_0[6],data_1[6]} = data_s6; // f-e | ||
assign {data_0[7],data_1[7]} = data_s7; // r-e oldest bit received | ||
assign {data_1[0],data_0[0]} = data_s0; // f-e latest bit received | ||
assign {data_1[1],data_0[1]} = data_s1; // r-e | ||
assign {data_1[2],data_0[2]} = data_s2; // f-e | ||
assign {data_1[3],data_0[3]} = data_s3; // r-e | ||
assign {data_1[4],data_0[4]} = data_s4; // f-e | ||
assign {data_1[5],data_0[5]} = data_s5; // r-e | ||
assign {data_1[6],data_0[6]} = data_s6; // f-e | ||
assign {data_1[7],data_0[7]} = data_s7; // r-e oldest bit received | ||
|
||
// For DDR dual lane interleave the two sedres outputs; | ||
|
||
always @(posedge adc_clk_div) begin | ||
serdes_data = {data_0[7], | ||
data_1[7], | ||
data_0[6], | ||
serdes_data = {data_1[7], | ||
data_0[7], | ||
data_1[6], | ||
data_0[5], | ||
data_0[6], | ||
data_1[5], | ||
data_0[4], | ||
data_0[5], | ||
data_1[4], | ||
data_0[3], | ||
data_0[4], | ||
data_1[3], | ||
data_0[2], | ||
data_0[3], | ||
data_1[2], | ||
data_0[1], | ||
data_0[2], | ||
data_1[1], | ||
data_0[0], | ||
data_1[0]}; | ||
data_0[1], | ||
data_1[0], | ||
data_0[0]}; | ||
|
||
serdes_frame = {frame_s7, | ||
frame_s6, | ||
|
@@ -325,6 +338,10 @@ module axi_ada4355_if #( | |
end | ||
end | ||
|
||
always @(posedge adc_clk_div) begin | ||
test_pattern <= adc_data_shifted; | ||
end | ||
|
||
always @(posedge adc_clk_div) begin | ||
if (serdes_reset_d) begin | ||
state <= INIT; | ||
|
@@ -337,10 +354,27 @@ module axi_ada4355_if #( | |
state <= CNT_UPDATE; | ||
end else begin | ||
frame_shifted <= {serdes_frame, serdes_frame_d} >> shift_cnt; | ||
if (expected_pattern_lane_0 == (test_pattern & lane_0_mask)) begin | ||
data_err_lane_0_r <= 1'b0; | ||
end else begin | ||
data_err_lane_0_r <= 1'b1; | ||
end | ||
if (expected_pattern_lane_1 == (test_pattern & lane_1_mask)) begin | ||
data_err_lane_1_r <= 1'b0; | ||
end else begin | ||
data_err_lane_1_r <= 1'b1; | ||
end | ||
state <= INIT; | ||
end | ||
end | ||
CNT_UPDATE : begin | ||
if (shift_cnt == 3'b111) begin | ||
frame_err_r <= 1'b1; | ||
state <= RESET; | ||
end | ||
else begin | ||
frame_err_r <= 1'b0; | ||
end | ||
shift_cnt <= shift_cnt + 1; | ||
state <= FRAME_SHIFTED; | ||
end | ||
|
@@ -351,6 +385,9 @@ module axi_ada4355_if #( | |
RESET : begin | ||
shift_cnt <= 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indentation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
state <= INIT; | ||
frame_err_r <= 1'b0; | ||
data_err_lane_0_r <= 1'b0; | ||
data_err_lane_1_r <= 1'b0; | ||
end | ||
default : | ||
state <= INIT; | ||
|
Uh oh!
There was an error while loading. Please reload this page.