ad400xx_fmc: Parametrize board select, sampling rate and adc resolution
fix commentsmain
parent
b7f34f7bd9
commit
fec4137046
|
@ -19,10 +19,10 @@ current_bd_instance /spi_ad40xx
|
||||||
create_bd_intf_pin -mode Master -vlnv analog.com:interface:spi_master_rtl:1.0 m_spi
|
create_bd_intf_pin -mode Master -vlnv analog.com:interface:spi_master_rtl:1.0 m_spi
|
||||||
create_bd_intf_pin -mode Master -vlnv xilinx.com:interface:axis_rtl:1.0 M_AXIS_SAMPLE
|
create_bd_intf_pin -mode Master -vlnv xilinx.com:interface:axis_rtl:1.0 M_AXIS_SAMPLE
|
||||||
|
|
||||||
if {$adc_resolution <= 32} {
|
if {$ADC_RESOLUTION <= 16} {
|
||||||
set data_width 32
|
set data_width 16
|
||||||
} else {
|
} else {
|
||||||
set data_width 64
|
set data_width 32
|
||||||
};
|
};
|
||||||
|
|
||||||
ad_ip_instance spi_engine_execution execution
|
ad_ip_instance spi_engine_execution execution
|
||||||
|
@ -48,7 +48,7 @@ current_bd_instance /spi_ad40xx
|
||||||
|
|
||||||
## to setup the sample rate of the system change the PULSE_PERIOD value
|
## to setup the sample rate of the system change the PULSE_PERIOD value
|
||||||
## the acutal sample rate will be PULSE_PERIOD * (1/sys_cpu_clk)
|
## the acutal sample rate will be PULSE_PERIOD * (1/sys_cpu_clk)
|
||||||
set sampling_cycle [expr int(ceil(double($spi_clk_ref_frequency * 1000000) / $adc_sampling_rate))]
|
set sampling_cycle [expr int(ceil(double($spi_clk_ref_frequency * 1000000) / $ADC_SAMPLING_RATE))]
|
||||||
ad_ip_parameter trigger_gen CONFIG.PULSE_PERIOD $sampling_cycle
|
ad_ip_parameter trigger_gen CONFIG.PULSE_PERIOD $sampling_cycle
|
||||||
ad_ip_parameter trigger_gen CONFIG.PULSE_WIDTH 1
|
ad_ip_parameter trigger_gen CONFIG.PULSE_WIDTH 1
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,14 @@ source $ad_hdl_dir/projects/scripts/adi_pd.tcl
|
||||||
set spi_clk_ref_frequency 166
|
set spi_clk_ref_frequency 166
|
||||||
|
|
||||||
# specify ADC resolution -- supported resolutions 16/18/20 bits
|
# specify ADC resolution -- supported resolutions 16/18/20 bits
|
||||||
set adc_resolution 20
|
set ADC_RESOLUTION [get_env_param ADC_RESOLUTION 20]
|
||||||
|
|
||||||
# specify ADC sampling rate in samples/seconds
|
# specify ADC sampling rate in samples/seconds
|
||||||
|
|
||||||
# NOTE: This rate can be set just in turbo mode -- if turbo mode is not used
|
# NOTE: This rate can be set just in turbo mode -- if turbo mode is not used
|
||||||
# the max rate should be 1.6 MSPS
|
# the max rate should be 1.6 MSPS
|
||||||
set adc_sampling_rate 1800000
|
# supported sampling rates: 2/1.8/1/0.5 MSPS depending on the board
|
||||||
|
set ADC_SAMPLING_RATE [get_env_param ADC_SAMPLING_RATE 1800000]
|
||||||
|
|
||||||
source ../common/ad40xx_bd.tcl
|
source ../common/ad40xx_bd.tcl
|
||||||
|
|
||||||
|
@ -21,5 +22,7 @@ ad_ip_parameter axi_sysid_0 CONFIG.ROM_ADDR_BITS 9
|
||||||
ad_ip_parameter rom_sys_0 CONFIG.PATH_TO_FILE "[pwd]/mem_init_sys.txt"
|
ad_ip_parameter rom_sys_0 CONFIG.PATH_TO_FILE "[pwd]/mem_init_sys.txt"
|
||||||
ad_ip_parameter rom_sys_0 CONFIG.ROM_ADDR_BITS 9
|
ad_ip_parameter rom_sys_0 CONFIG.ROM_ADDR_BITS 9
|
||||||
|
|
||||||
sysid_gen_sys_init_file
|
set AD40XX_ADAQ400X_N [get_env_param AD40XX_ADAQ400X_N 1]
|
||||||
|
set sys_cstring "ad40xx: $AD40XX_ADAQ400X_N - adc_sampling_rate: $ADC_SAMPLING_RATE - adc_resolution: $ADC_RESOLUTION"
|
||||||
|
sysid_gen_sys_init_file $sys_cstring
|
||||||
|
|
||||||
|
|
|
@ -19,17 +19,17 @@ source $ad_hdl_dir/projects/scripts/adi_board.tcl
|
||||||
## 1 - EVAL-AD40XX-FMCZ
|
## 1 - EVAL-AD40XX-FMCZ
|
||||||
## 0 - EVAL-ADAQ400x
|
## 0 - EVAL-ADAQ400x
|
||||||
##
|
##
|
||||||
set ad40xx_adaq400x_n 1
|
set AD40XX_ADAQ400X_N [get_env_param AD40XX_ADAQ400X_N 1]
|
||||||
|
|
||||||
adi_project ad40xx_fmc_zed
|
adi_project ad40xx_fmc_zed
|
||||||
|
|
||||||
if {$ad40xx_adaq400x_n == 1} {
|
if {$AD40XX_ADAQ400X_N == 1} {
|
||||||
adi_project_files ad40xx_fmc_zed [list \
|
adi_project_files ad40xx_fmc_zed [list \
|
||||||
"$ad_hdl_dir/library/common/ad_iobuf.v" \
|
"$ad_hdl_dir/library/common/ad_iobuf.v" \
|
||||||
"system_top_ad40xx.v" \
|
"system_top_ad40xx.v" \
|
||||||
"system_constr_ad40xx.xdc" \
|
"system_constr_ad40xx.xdc" \
|
||||||
"$ad_hdl_dir/projects/common/zed/zed_system_constr.xdc"]
|
"$ad_hdl_dir/projects/common/zed/zed_system_constr.xdc"]
|
||||||
} elseif {$ad40xx_adaq400x_n == 0} {
|
} elseif {$AD40XX_ADAQ400X_N == 0} {
|
||||||
adi_project_files ad40xx_fmc_zed [list \
|
adi_project_files ad40xx_fmc_zed [list \
|
||||||
"$ad_hdl_dir/library/common/ad_iobuf.v" \
|
"$ad_hdl_dir/library/common/ad_iobuf.v" \
|
||||||
"system_top_adaq400x.v" \
|
"system_top_adaq400x.v" \
|
||||||
|
|
Loading…
Reference in New Issue