Skip to content

Commit 7adcaa3

Browse files
committed
library: adxcvr: Sync inputs for Agilex 7
Signed-off-by: Bogdan Luncan <bogdan.luncan@analog.com>
1 parent fed9847 commit 7adcaa3

File tree

2 files changed

+65
-33
lines changed

2 files changed

+65
-33
lines changed

library/intel/axi_adxcvr/axi_adxcvr_hw.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ set_module_property VALIDATION_CALLBACK info_param_validate
2020
# files
2121

2222
ad_ip_files axi_adxcvr [list \
23+
$ad_hdl_dir/library/util_cdc/sync_bits.v \
2324
$ad_hdl_dir/library/common/up_axi.v \
2425
axi_adxcvr_up.v \
2526
axi_adxcvr.v \

library/intel/axi_adxcvr/axi_adxcvr_up.v

Lines changed: 64 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,20 @@ module axi_adxcvr_up #(
8181
reg up_wreq_d = 'd0;
8282
reg [31:0] up_scratch = 'd0;
8383
reg up_resetn = 'd0;
84-
reg [ 3:0] up_rst_cnt = 'd8;
8584
reg up_status_int = 'd0;
8685
reg up_rreq_d = 'd0;
8786
reg [31:0] up_rdata_d = 'd0;
8887

8988
// internal signals
9089

91-
wire up_ready_s;
90+
wire up_all_ready_s;
9291
wire [31:0] up_status_32_s;
9392
wire [31:0] up_rparam_s;
9493

94+
wire up_pll_locked_s;
95+
wire up_rx_lockedtodata_s;
96+
wire up_ready_s;
97+
9598
// defaults
9699

97100
assign up_wack = up_wreq_d;
@@ -120,53 +123,81 @@ module axi_adxcvr_up #(
120123
end
121124
end
122125

123-
assign up_ready_s = & up_status_32_s[(NUM_OF_LANES-1):0];
126+
generate if (FPGA_TECHNOLOGY == 105) begin
127+
sync_bits #(
128+
.NUM_OF_BITS (3),
129+
.ASYNC_CLK (1)
130+
) i_sync_input_ctrl (
131+
.in_bits ({up_ready, up_pll_locked, up_rx_lockedtodata}),
132+
.out_resetn (1'b1),
133+
.out_clk (up_clk),
134+
.out_bits({up_ready_s, up_pll_locked_s, up_rx_lockedtodata_s}));
135+
end else begin
136+
assign up_ready_s = up_ready;
137+
assign up_pll_locked_s = up_pll_locked;
138+
assign up_rx_lockedtodata_s = up_rx_lockedtodata;
139+
end
140+
endgenerate
141+
142+
assign up_all_ready_s = & up_status_32_s[(NUM_OF_LANES-1):0];
124143
assign up_status_32_s[31:(NUM_OF_LANES+1)] = 'd0;
125-
assign up_status_32_s[NUM_OF_LANES] = FPGA_TECHNOLOGY == 105 ? TX_OR_RX_N ? up_pll_locked : up_rx_lockedtodata :
126-
up_pll_locked;
127-
assign up_status_32_s[(NUM_OF_LANES-1):0] = FPGA_TECHNOLOGY == 105 ? {NUM_OF_LANES{up_ready}} : up_ready;
144+
assign up_status_32_s[NUM_OF_LANES] = FPGA_TECHNOLOGY == 105 ? TX_OR_RX_N ? up_pll_locked_s : up_rx_lockedtodata_s :
145+
up_pll_locked_s;
146+
assign up_status_32_s[(NUM_OF_LANES-1):0] = FPGA_TECHNOLOGY == 105 ? {NUM_OF_LANES{up_ready_s}} : up_ready_s;
128147

129-
always @(negedge up_rstn or posedge up_clk) begin
130-
if (up_rstn == 0) begin
131-
up_rst_cnt <= 4'h8;
132-
up_status_int <= 1'b0;
133-
end else begin
134-
if (up_resetn == 1'b0) begin
135-
up_rst_cnt <= 4'h8;
136-
end else if (up_rst_cnt[3] == 1'b1) begin
137-
up_rst_cnt <= up_rst_cnt + 1'b1;
138-
end
139-
if (up_resetn == 1'b0) begin
140-
up_status_int <= 1'b0;
141-
end else if (up_ready_s == 1'b1) begin
142-
up_status_int <= 1'b1;
148+
generate if (FPGA_TECHNOLOGY == 105) begin
149+
wire up_reset_ack_s;
150+
reg up_rst_d;
151+
152+
sync_bits #(
153+
.NUM_OF_BITS (1),
154+
.ASYNC_CLK (1)
155+
) i_sync_reset_ack (
156+
.in_bits (up_reset_ack),
157+
.out_resetn (1'b1),
158+
.out_clk (up_clk),
159+
.out_bits(up_reset_ack_s));
160+
161+
always @(negedge up_rstn or posedge up_clk) begin
162+
if (up_rstn == 0) begin
163+
up_rst_d <= 1'b1;
164+
end else if (up_resetn == 1'b0) begin
165+
up_rst_d <= 1'b1;
166+
end else if (up_reset_ack_s) begin
167+
up_rst_d <= 1'b0;
143168
end
144169
end
145-
end
146-
147-
generate if (FPGA_TECHNOLOGY == 105) begin
148-
reg up_reset_ack_d = 'd0;
170+
assign up_rst = up_rst_d;
171+
end else begin
172+
reg [3:0] up_rst_cnt = 'd8;
149173

150174
always @(negedge up_rstn or posedge up_clk) begin
151175
if (up_rstn == 0) begin
152-
up_reset_ack_d <= 1'b0;
176+
up_rst_cnt <= 4'h8;
153177
end else begin
154178
if (up_resetn == 1'b0) begin
155-
up_reset_ack_d <= 1'b0;
156-
end else begin
157-
if (up_reset_ack_d == 1'b0) begin
158-
up_reset_ack_d <= up_reset_ack;
159-
end
179+
up_rst_cnt <= 4'h8;
180+
end else if (up_rst_cnt[3] == 1'b1) begin
181+
up_rst_cnt <= up_rst_cnt + 1'b1;
160182
end
161183
end
162184
end
163-
164-
assign up_rst = ~up_reset_ack_d;
165-
end else begin
166185
assign up_rst = up_rst_cnt[3];
167186
end
168187
endgenerate
169188

189+
always @(negedge up_rstn or posedge up_clk) begin
190+
if (up_rstn == 0) begin
191+
up_status_int <= 1'b0;
192+
end else begin
193+
if (up_resetn == 1'b0) begin
194+
up_status_int <= 1'b0;
195+
end else if (up_all_ready_s) begin
196+
up_status_int <= 1'b1;
197+
end
198+
end
199+
end
200+
170201
// Specific to Intel
171202

172203
assign up_rparam_s[31:28] = 8'd0;

0 commit comments

Comments
 (0)