Skip to content

Commit 7a9f710

Browse files
sarpadiSRaus
authored andcommitted
axi_ad7606x: Clean up parameters; fix clocking
There is no real need for different clocking options for this core and because CDC is not implemented in the core, there is no way to use the EXT_CLK parameter. Fix syntax, fix IP tcl Signed-off-by: sarpadi <[email protected]> (cherry picked from commit 8ce6d32)
1 parent d4dcc40 commit 7a9f710

File tree

2 files changed

+8
-77
lines changed

2 files changed

+8
-77
lines changed

library/axi_ad7606x/axi_ad7606x.v

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@
3838
module axi_ad7606x #(
3939

4040
parameter ID = 0,
41-
parameter DEV_CONFIG = 0,
4241
parameter ADC_TO_DMA_N_BITS = 16,
43-
parameter ADC_N_BITS = 16,
44-
parameter EXTERNAL_CLK = 0
42+
parameter ADC_N_BITS = 16
4543
) (
4644

4745
// physical data interface
@@ -52,7 +50,6 @@ module axi_ad7606x #(
5250
output rx_db_t,
5351
output rx_rd_n,
5452
output rx_wr_n,
55-
input external_clk,
5653

5754
// physical control interface
5855

@@ -142,7 +139,6 @@ module axi_ad7606x #(
142139
wire adc_dfmt_type_s[0:7];
143140
wire adc_dfmt_se_s[0:7];
144141

145-
wire adc_clk_s;
146142
wire [ 7:0] adc_enable;
147143
wire adc_reset_s;
148144

@@ -175,7 +171,7 @@ module axi_ad7606x #(
175171
wire m_axis_xfer_req_s;
176172

177173
// defaults
178-
174+
assign adc_clk = s_axi_aclk;
179175
assign up_clk = s_axi_aclk;
180176
assign up_rstn = s_axi_aresetn;
181177
assign adc_reset = adc_reset_s;
@@ -216,23 +212,13 @@ module axi_ad7606x #(
216212
end
217213
end
218214

219-
generate
220-
if (EXTERNAL_CLK == 1'b1) begin
221-
assign adc_clk_s = external_clk;
222-
end else begin
223-
assign adc_clk_s = up_clk;
224-
end
225-
endgenerate
226-
227-
assign adc_clk = adc_clk_s;
228-
229215
generate
230216
genvar i;
231217
for (i = 0; i < 8; i = i + 1) begin
232218
up_adc_channel #(
233219
.CHANNEL_ID(i)
234220
) i_up_adc_channel (
235-
.adc_clk (adc_clk_s),
221+
.adc_clk (up_clk),
236222
.adc_rst (adc_reset_s),
237223
.adc_enable (adc_enable[i]),
238224
.adc_iqcor_enb (),
@@ -289,7 +275,7 @@ module axi_ad7606x #(
289275
.DATA_WIDTH (ADC_N_BITS),
290276
.BITS_PER_SAMPLE (ADC_TO_DMA_N_BITS)
291277
) i_datafmt (
292-
.clk (adc_clk),
278+
.clk (up_clk),
293279
.valid (1'b1),
294280
.data (adc_data_s[k*ADC_N_BITS+(ADC_N_BITS-1):k*ADC_N_BITS]),
295281
.valid_out (dma_dvalid),
@@ -301,7 +287,7 @@ module axi_ad7606x #(
301287
endgenerate
302288

303289
generate
304-
if (DEV_CONFIG == AD7606B || DEV_CONFIG == AD7606C_16) begin
290+
if (ADC_N_BITS == 16) begin
305291
axi_ad7606x_16b_pif i_ad7606_parallel_interface (
306292
.cs_n (rx_cs_n),
307293
.db_o (rx_db_o),
@@ -332,7 +318,7 @@ module axi_ad7606x #(
332318
.adc_crc_res (adc_crc_res),
333319
.adc_crc_err (adc_crc_err),
334320
.adc_valid (adc_valid),
335-
.clk (adc_clk_s),
321+
.clk (up_clk),
336322
.rstn (up_rstn),
337323
.adc_config_ctrl (adc_config_ctrl_s),
338324
.adc_ctrl_status (adc_ctrl_status_s),
@@ -372,7 +358,7 @@ module axi_ad7606x #(
372358
.adc_crc_res (adc_crc_res),
373359
.adc_crc_err (adc_crc_err),
374360
.adc_valid (adc_valid),
375-
.clk (adc_clk_s),
361+
.clk (up_clk),
376362
.rstn (up_rstn),
377363
.adc_config_ctrl (adc_config_ctrl_s),
378364
.adc_ctrl_status (adc_ctrl_status_s),
@@ -399,7 +385,7 @@ module axi_ad7606x #(
399385
.CONFIG (RD_RAW_CAP)
400386
) i_up_adc_common (
401387
.mmcm_rst (),
402-
.adc_clk (adc_clk_s),
388+
.adc_clk (up_clk),
403389
.adc_rst (adc_reset_s),
404390
.adc_r1_mode (),
405391
.adc_ddr_edgesel (),

library/axi_ad7606x/axi_ad7606x_ip.tcl

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -46,60 +46,5 @@ set cc [ipx::current_core]
4646
set_property display_name "AXI AD7606X" $cc
4747
set_property description "AXI AD7606X HDL interface" $cc
4848

49-
## define external_clk port as clock interface
50-
adi_add_bus external_clk slave \
51-
"xilinx.com:signal:clock_rtl:1.0" \
52-
"xilinx.com:signal:clock:1.0" \
53-
[list {"external_clk" "CLK"} ]
54-
55-
adi_set_ports_dependency "external_clk" \
56-
"(spirit:decode(id('MODELPARAM_VALUE.EXTERNAL_CLK')) = 1)" 0
57-
58-
## parameter validation
59-
60-
set_property -dict [list \
61-
"value_format" "bool" \
62-
"value" "true" \
63-
] \
64-
[ipx::get_hdl_parameters EXTERNAL_CLK -of_objects $cc]
65-
66-
## customize XGUI layout
67-
68-
## remove the automatically generated GUI page
69-
70-
ipgui::remove_page -component $cc [ipgui::get_pagespec -name "Page 0" -component $cc]
71-
ipx::save_core $cc
72-
73-
## create a new GUI page
74-
75-
ipgui::add_page -name {AXI AD7606X} -component $cc -display_name {AXI AD7606X}
76-
set page0 [ipgui::get_pagespec -name "AXI AD7606X" -component $cc]
77-
78-
ipgui::add_param -name "EXTERNAL_CLK" -component $cc -parent $page0
79-
set_property -dict [list \
80-
"display_name" "EXTERNAL_CLK" \
81-
"tooltip" "External clock for the ADC" \
82-
"widget" "checkBox" \
83-
] [ipgui::get_guiparamspec -name "EXTERNAL_CLK" -component $cc]
84-
85-
ipgui::add_param -name "DEV_CONFIG" -component $cc -parent $page0
86-
set_property -dict [list \
87-
"widget" "comboBox" \
88-
"display_name" "Device Type Selection" \
89-
] [ipgui::get_guiparamspec -name "DEV_CONFIG" -component $cc]
90-
91-
set_property -dict [list \
92-
"value_validation_type" "pairs" \
93-
"value_validation_pairs" { \
94-
"AD7606B" "0" \
95-
"AD7606C-16" "1" \
96-
"AD7606C-18" "2" \
97-
} \
98-
] [ipx::get_user_parameters DEV_CONFIG -of_objects $cc]
99-
100-
adi_add_auto_fpga_spec_params
101-
102-
## save the modifications
103-
10449
ipx::create_xgui_files $cc
10550
ipx::save_core $cc

0 commit comments

Comments
 (0)