From e782ed06cb1972f0cb505a7057b28a3be6fd0e87 Mon Sep 17 00:00:00 2001 From: Istvan Csomortani Date: Thu, 22 Mar 2018 14:06:46 +0200 Subject: [PATCH] adaq7980: Expouse the ADC sampling rate in system_bd.tcl This way the user do not need to modify the block design, just set the required rate in system_bd.tcl. This commit does not contain any functional changes. --- projects/adaq7980_sdz/common/adaq7980_bd.tcl | 4 +++- projects/adaq7980_sdz/zed/system_bd.tcl | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/projects/adaq7980_sdz/common/adaq7980_bd.tcl b/projects/adaq7980_sdz/common/adaq7980_bd.tcl index 508b87f22..e4d1d6c56 100644 --- a/projects/adaq7980_sdz/common/adaq7980_bd.tcl +++ b/projects/adaq7980_sdz/common/adaq7980_bd.tcl @@ -25,7 +25,9 @@ current_bd_instance /spi ## 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) - ad_ip_parameter trigger_gen CONFIG.PULSE_PERIOD 100 + set cycle_per_sec_100mhz 100000000 + set sampling_cycle [expr int(ceil(double($cycle_per_sec_100mhz) / $adc_sampling_rate))] + ad_ip_parameter trigger_gen CONFIG.PULSE_PERIOD $sampling_cycle ad_ip_parameter trigger_gen CONFIG.PULSE_WIDTH 1 ad_ip_parameter execution CONFIG.NUM_OF_CS 1 diff --git a/projects/adaq7980_sdz/zed/system_bd.tcl b/projects/adaq7980_sdz/zed/system_bd.tcl index 5ccf29c95..ceaa440ca 100644 --- a/projects/adaq7980_sdz/zed/system_bd.tcl +++ b/projects/adaq7980_sdz/zed/system_bd.tcl @@ -1,4 +1,8 @@ source $ad_hdl_dir/projects/common/zed/zed_system_bd.tcl + +# specify ADC sampling rate in samples/seconds -- default is 1 MSPS +set adc_sampling_rate 1000000 + source ../common/adaq7980_bd.tcl