Skip to content

Commit 381e1ee

Browse files
library/axi_ltc2387: Update GUI parameters
Signed-off-by: Stanca Pop <[email protected]>
1 parent e7eebca commit 381e1ee

File tree

2 files changed

+46
-17
lines changed

2 files changed

+46
-17
lines changed

library/axi_ltc2387/axi_ltc2387_channel.v

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,13 @@ module axi_ltc2387_channel #(
101101

102102
assign adc_pn_err_s = adc_pn_err;
103103

104-
// expected pattern
104+
// expected patterns:
105+
// 18-bit, one-lane: 10 1000 0001 1111 1100
106+
// 16-bit, one-lane: 10 1000 0001 1111 11
107+
// 18-bit, two-lane: 11 0011 0000 1111 1100
108+
// 16-bit, one-lane: 11 0011 0000 1111 11
109+
// basically, the 16-bit variant doesn't have the LSBs 00
110+
// so we can sum this up as the 16-bit expected pattern + 2 zeroes for the 18-bit one
105111

106112
generate
107113
if (TWOLANES == 1) begin

library/axi_ltc2387/axi_ltc2387_ip.tcl

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,49 +31,72 @@ adi_ip_files axi_ltc2387 [list \
3131

3232
adi_ip_properties axi_ltc2387
3333

34-
set cc [ipx::current_core]
35-
set page0 [ipgui::get_pagespec -name "Page 0" -component $cc]
34+
ipx::infer_bus_interface ref_clk xilinx.com:signal:clock_rtl:1.0 [ipx::current_core]
35+
ipx::infer_bus_interface dco_p xilinx.com:signal:clock_rtl:1.0 [ipx::current_core]
36+
ipx::infer_bus_interface dco_n xilinx.com:signal:clock_rtl:1.0 [ipx::current_core]
3637

37-
ipx::infer_bus_interface ref_clk xilinx.com:signal:clock_rtl:1.0 $cc
38-
ipx::infer_bus_interface dco_p xilinx.com:signal:clock_rtl:1.0 $cc
39-
ipx::infer_bus_interface dco_n xilinx.com:signal:clock_rtl:1.0 $cc
38+
set cc [ipx::current_core]
4039

41-
ipgui::add_static_text -name {Warning} -component $cc -parent $page0 -text {In one-lane mode, only 18-bit resolution is supported!}
40+
set page0 [ipgui::get_pagespec -name "Page 0" -component $cc]
4241

4342
ipx::add_user_parameter ADC_RES $cc
4443
set_property value_resolve_type user [ipx::get_user_parameters ADC_RES -of_objects $cc]
4544
ipgui::add_param -name "ADC_RES" -component $cc -parent $page0
4645
set_property -dict [list \
47-
"display_name" "ADC_RES" \
48-
"layout" "horizontal" \
49-
"tooltip" "ADC resolution" \
46+
"display_name" "ADC resolution" \
47+
"tooltip" "ADC_RES" \
5048
"widget" "radioGroup" \
49+
"layout" "horizontal" \
5150
] [ipgui::get_guiparamspec -name "ADC_RES" -component $cc]
5251

5352
set_property -dict [list \
54-
"value" "18" \
5553
"value_format" "long" \
5654
"value_validation_type" "list" \
57-
"value_validation_list" "18 16" \
55+
"value_validation_list" "16 18" \
5856
] [ipx::get_user_parameters ADC_RES -of_objects $cc]
5957

58+
ipx::add_user_parameter OUT_RES $cc
59+
set_property value_resolve_type user [ipx::get_user_parameters OUT_RES -of_objects $cc]
60+
ipgui::add_param -name "OUT_RES" -component $cc -parent $page0
61+
set_property -dict [list \
62+
"display_name" "Output data width" \
63+
"tooltip" "OUT_RES" \
64+
"widget" "radioGroup" \
65+
"layout" "horizontal" \
66+
] [ipgui::get_guiparamspec -name "OUT_RES" -component $cc]
67+
68+
set_property -dict [list \
69+
"value_format" "long" \
70+
"value_validation_type" "list" \
71+
"value_validation_list" "16 32" \
72+
] [ipx::get_user_parameters OUT_RES -of_objects $cc]
73+
6074
ipx::add_user_parameter TWOLANES $cc
6175
set_property value_resolve_type user [ipx::get_user_parameters TWOLANES -of_objects $cc]
6276
ipgui::add_param -name "TWOLANES" -component $cc -parent $page0
6377
set_property -dict [list \
64-
"display_name" "TWOLANES" \
65-
"layout" "horizontal" \
66-
"tooltip" "Two-lane mode (1) or one-lane mode (0)" \
78+
"display_name" "Lane mode" \
79+
"tooltip" "TWOLANES" \
6780
"widget" "radioGroup" \
81+
"layout" "horizontal" \
6882
] [ipgui::get_guiparamspec -name "TWOLANES" -component $cc]
6983

7084
set_property -dict [list \
71-
"value" "1" \
7285
"value_format" "long" \
7386
"value_validation_type" "list" \
74-
"value_validation_list" "1 0" \
87+
"value_validation_list" "0 1" \
7588
] [ipx::get_user_parameters TWOLANES -of_objects $cc]
7689

90+
# if TWOLANES=0, disable and tie to GND, ports db_p, db_n
91+
adi_set_ports_dependency "db_p" \
92+
"(spirit:decode(id('MODELPARAM_VALUE.TWOLANES')) == 1)"
93+
adi_set_ports_dependency "db_n" \
94+
"(spirit:decode(id('MODELPARAM_VALUE.TWOLANES')) == 1)"
95+
96+
set_property driver_value 0 [ipx::get_ports -filter "direction==in" -of_objects $cc]
97+
98+
#adi_add_auto_fpga_spec_params
99+
77100
ipx::create_xgui_files $cc
78101
ipx::update_checksums $cc
79102
ipx::save_core $cc

0 commit comments

Comments
 (0)