Skip to content

Commit e5713cf

Browse files
committed
projects/adaq23875: Add adaq2387x support
Signed-off-by: Stanca Pop <[email protected]>
1 parent ac471b6 commit e5713cf

File tree

11 files changed

+675
-0
lines changed

11 files changed

+675
-0
lines changed

projects/adaq23875/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
####################################################################################
2+
## Copyright (c) 2018 - 2025 Analog Devices, Inc.
3+
### SPDX short identifier: BSD-1-Clause
4+
## Auto-generated, do not modify!
5+
####################################################################################
6+
7+
include ../scripts/project-toplevel.mk

projects/adaq23875/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# ADAQ2387X HDL Project
2+
3+
- Evaluation board product page:
4+
- [EVAL-ADAQ23878](https://analog.com/eval-adaq23878)
5+
- [EVAL-ADAQ23876](https://analog.com/eval-adaq23876)
6+
- [EVAL-ADAQ23875](https://analog.com/eval-adaq23875)
7+
- System documentation: https://wiki.analog.com/resources/eval/user-guides/circuits-from-the-lab/cn0577
8+
- HDL project documentation: http://analogdevicesinc.github.io/hdl/projects/cn0577/index.html
9+
- Evaluation board VADJ: 2.5V
10+
11+
## Supported parts
12+
13+
| Part name | Description |
14+
|-----------------------------------------------|----------------------------------------------------|
15+
| [ADAQ23878](https://www.analog.com/ADAQ23878) | 18-Bit, 15 MSPS, μModule Data Acquisition Solution |
16+
| [ADAQ23876](https://www.analog.com/ADAQ23876) | 16-Bit, 15 MSPS, μModule Data Acquisition Solution |
17+
| [ADAQ23875](https://www.analog.com/ADAQ23875) | 16-Bit, 15 MSPS, μModule Data Acquisition Solution |
18+
19+
## Building the project
20+
21+
Please enter the folder for the FPGA carrier you want to use and read the README.md.
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
###############################################################################
2+
## Copyright (C) 2022-2023, 2025 Analog Devices, Inc. All rights reserved.
3+
### SPDX short identifier: ADIBSD
4+
###############################################################################
5+
6+
# env params
7+
8+
set TWOLANES $ad_project_params(TWOLANES); # two-lane mode (1) or one-lane mode (0); default two-lane
9+
set ADC_RES $ad_project_params(ADC_RES); # ADC resolution: (18) or (16); default 18 bits
10+
set USE_MMCM $ad_project_params(USE_MMCM); # ref_clk frequency: 120MHz (1) or 100MHz (0); default 0
11+
set OUT_RES [expr {$ADC_RES == 16 ? 16 : 32}]
12+
set CLK_GATE_WIDTH [expr {($TWOLANES == 0 && $ADC_RES == 18) ? 9 : \
13+
($TWOLANES == 0 && $ADC_RES == 16) ? 8 : \
14+
($TWOLANES == 1 && $ADC_RES == 18) ? 5 : \
15+
4}]
16+
17+
# adaq23875 i/o
18+
19+
create_bd_port -dir I ref_clk
20+
create_bd_port -dir O sampling_clk
21+
create_bd_port -dir I dco_p
22+
create_bd_port -dir I dco_n
23+
create_bd_port -dir O cnv
24+
create_bd_port -dir I da_p
25+
create_bd_port -dir I da_n
26+
create_bd_port -dir I db_p
27+
create_bd_port -dir I db_n
28+
create_bd_port -dir O clk_gate
29+
30+
# adc peripheral
31+
32+
ad_ip_instance axi_ltc2387 axi_ltc2387
33+
ad_ip_parameter axi_ltc2387 CONFIG.ADC_RES $ADC_RES
34+
ad_ip_parameter axi_ltc2387 CONFIG.OUT_RES $OUT_RES
35+
ad_ip_parameter axi_ltc2387 CONFIG.TWOLANES $TWOLANES
36+
ad_ip_parameter axi_ltc2387 CONFIG.ADC_INIT_DELAY 27
37+
38+
# axi pwm gen
39+
40+
ad_ip_instance axi_pwm_gen axi_pwm_gen
41+
ad_ip_parameter axi_pwm_gen CONFIG.N_PWMS 2
42+
# pwm0 - cnv
43+
ad_ip_parameter axi_pwm_gen CONFIG.PULSE_0_WIDTH 1
44+
ad_ip_parameter axi_pwm_gen CONFIG.PULSE_0_PERIOD 8
45+
# pwm1 - clk_gate
46+
ad_ip_parameter axi_pwm_gen CONFIG.PULSE_1_WIDTH $CLK_GATE_WIDTH
47+
ad_ip_parameter axi_pwm_gen CONFIG.PULSE_1_PERIOD 8
48+
ad_ip_parameter axi_pwm_gen CONFIG.PULSE_1_OFFSET 0
49+
50+
# dma
51+
52+
ad_ip_instance axi_dmac axi_ltc2387_dma
53+
ad_ip_parameter axi_ltc2387_dma CONFIG.DMA_TYPE_SRC 2
54+
ad_ip_parameter axi_ltc2387_dma CONFIG.DMA_TYPE_DEST 0
55+
ad_ip_parameter axi_ltc2387_dma CONFIG.CYCLIC 0
56+
ad_ip_parameter axi_ltc2387_dma CONFIG.SYNC_TRANSFER_START 0
57+
ad_ip_parameter axi_ltc2387_dma CONFIG.AXI_SLICE_SRC 0
58+
ad_ip_parameter axi_ltc2387_dma CONFIG.AXI_SLICE_DEST 0
59+
ad_ip_parameter axi_ltc2387_dma CONFIG.DMA_2D_TRANSFER 0
60+
ad_ip_parameter axi_ltc2387_dma CONFIG.DMA_DATA_WIDTH_SRC $OUT_RES
61+
ad_ip_parameter axi_ltc2387_dma CONFIG.DMA_DATA_WIDTH_DEST 64
62+
63+
# clk wizard
64+
65+
if {$USE_MMCM == "1"} {
66+
create_bd_cell -type ip -vlnv xilinx.com:ip:clk_wiz:6.0 clk_wiz_0
67+
68+
set_property -dict [list \
69+
CONFIG.PRIM_IN_FREQ {100.000} \
70+
CONFIG.CLKOUT1_REQUESTED_OUT_FREQ {120.000} \
71+
] [get_bd_cells clk_wiz_0]
72+
73+
ad_connect ref_clk clk_wiz_0/clk_in1
74+
ad_connect sys_rstgen/peripheral_reset clk_wiz_0/reset
75+
ad_connect clk_wiz_0/clk_out1 sampling_clk
76+
ad_connect clk_wiz_0/clk_out1 axi_ltc2387/ref_clk
77+
ad_connect clk_wiz_0/clk_out1 axi_ltc2387_dma/fifo_wr_clk
78+
ad_connect clk_wiz_0/clk_out1 axi_pwm_gen/ext_clk
79+
} else {
80+
ad_connect ref_clk sampling_clk
81+
ad_connect ref_clk axi_ltc2387/ref_clk
82+
ad_connect ref_clk axi_ltc2387_dma/fifo_wr_clk
83+
ad_connect ref_clk axi_pwm_gen/ext_clk
84+
}
85+
86+
# connections
87+
88+
ad_connect sys_200m_clk axi_ltc2387/delay_clk
89+
90+
ad_connect clk_gate axi_ltc2387/clk_gate
91+
ad_connect dco_p axi_ltc2387/dco_p
92+
ad_connect dco_n axi_ltc2387/dco_n
93+
ad_connect da_p axi_ltc2387/da_p
94+
ad_connect da_n axi_ltc2387/da_n
95+
96+
if {$TWOLANES == "1"} {
97+
ad_connect db_p axi_ltc2387/db_p
98+
ad_connect db_n axi_ltc2387/db_n
99+
}
100+
101+
ad_connect axi_ltc2387/adc_valid axi_ltc2387_dma/fifo_wr_en
102+
ad_connect axi_ltc2387/adc_data axi_ltc2387_dma/fifo_wr_din
103+
ad_connect axi_ltc2387/adc_dovf axi_ltc2387_dma/fifo_wr_overflow
104+
105+
ad_connect cnv axi_pwm_gen/pwm_0
106+
ad_connect clk_gate axi_pwm_gen/pwm_1
107+
ad_connect sys_cpu_resetn axi_pwm_gen/s_axi_aresetn
108+
ad_connect sys_cpu_clk axi_pwm_gen/s_axi_aclk
109+
110+
# address mapping
111+
112+
ad_cpu_interconnect 0x44A00000 axi_ltc2387
113+
ad_cpu_interconnect 0x44A30000 axi_ltc2387_dma
114+
ad_cpu_interconnect 0x44A60000 axi_pwm_gen
115+
116+
# interconnect (adc)
117+
118+
ad_mem_hp2_interconnect $sys_cpu_clk sys_ps7/S_AXI_HP2
119+
ad_mem_hp2_interconnect $sys_cpu_clk axi_ltc2387_dma/m_dest_axi
120+
ad_connect $sys_cpu_resetn axi_ltc2387_dma/m_dest_axi_aresetn
121+
122+
# interrupts
123+
124+
ad_cpu_interrupt ps-13 mb-13 axi_ltc2387_dma/irq

projects/adaq23875/zed/Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
####################################################################################
2+
## Copyright (c) 2018 - 2025 Analog Devices, Inc.
3+
### SPDX short identifier: BSD-1-Clause
4+
## Auto-generated, do not modify!
5+
####################################################################################
6+
7+
PROJECT_NAME := adaq23875_zed
8+
9+
M_DEPS += ../../scripts/adi_pd.tcl
10+
M_DEPS += ../../common/zed/zed_system_constr.xdc
11+
M_DEPS += ../../common/zed/zed_system_bd.tcl
12+
M_DEPS += ../../adaq23875/common/adaq23875_bd.tcl
13+
M_DEPS += ../../../library/xilinx/common/ad_data_clk.v
14+
M_DEPS += ../../../library/common/ad_iobuf.v
15+
16+
LIB_DEPS += axi_clkgen
17+
LIB_DEPS += axi_dmac
18+
LIB_DEPS += axi_hdmi_tx
19+
LIB_DEPS += axi_i2s_adi
20+
LIB_DEPS += axi_ltc2387
21+
LIB_DEPS += axi_pwm_gen
22+
LIB_DEPS += axi_spdif_tx
23+
LIB_DEPS += axi_sysid
24+
LIB_DEPS += sysid_rom
25+
LIB_DEPS += util_i2c_mixer
26+
27+
include ../../scripts/project-xilinx.mk

projects/adaq23875/zed/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<!-- no_no_os -->
2+
3+
# ADAQ23875/ZED HDL Project
4+
5+
- VADJ with which it was tested in hardware: 2.5V
6+
7+
## Building the project
8+
9+
The parameters configurable through the ``make`` command, can be found below, as well as in the **system_project.tcl** file; it contains the default configuration.
10+
11+
```
12+
cd projects/adaq23875/zed
13+
make
14+
```
15+
16+
The overwritable parameters from the environment are:
17+
18+
- TWOLANES: whether to use two lanes or one lane mode;
19+
- 1 - two-lane mode used (default)
20+
- 0 - one-lane mode used
21+
- ADC_RES: the resolution of the ADC input data;
22+
- 18 - the resolution is 18 bits (default)
23+
- 16 - the resolution is 16 bits
24+
- USE_MMCM: choose between default 100MHz ref_clk or 120MHz
25+
- 1 - 120Mhz
26+
- 0 - 100MHz (default)
27+
28+
### Example configurations
29+
30+
#### Two lanes, 18-bit resolution, 100MHz ref_clk (default)
31+
32+
This specific command is equivalent to running `make` only:
33+
34+
```
35+
make TWOLANES=1 \
36+
ADC_RES=18 \
37+
USE_MMCM=0
38+
```
39+
40+
Corresponding device tree: [zynq-zed-adv7511-adaq23878.dts](https://github.com/analogdevicesinc/linux/blob/main/arch/arm/boot/dts/xilinx/zynq-zed-adv7511-adaq23878.dts)
41+
42+
#### One lane, 18-bit resolution
43+
44+
```
45+
make TWOLANES=0 \
46+
ADC_RES=18
47+
```
48+
49+
#### Two lanes, 16-bit resolution
50+
51+
```
52+
make TWOLANES=1 \
53+
ADC_RES=16
54+
```
55+
56+
Corresponding device tree: [zynq-zed-adv7511-adaq23875.dts](https://github.com/analogdevicesinc/linux/blob/main/arch/arm/boot/dts/xilinx/zynq-zed-adv7511-adaq23875.dts)
57+
58+
#### One lane, 16-bit resolution
59+
60+
```
61+
make TWOLANES=0 \
62+
ADC_RES=16
63+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
###############################################################################
2+
## Copyright (C) 2022-2023, 2025 Analog Devices, Inc. All rights reserved.
3+
### SPDX short identifier: ADIBSD
4+
###############################################################################
5+
6+
source $ad_hdl_dir/projects/common/zed/zed_system_bd.tcl
7+
source $ad_hdl_dir/projects/scripts/adi_pd.tcl
8+
# sourcing the common design
9+
source $ad_hdl_dir/projects/adaq23875/common/adaq23875_bd.tcl
10+
11+
# system ID
12+
ad_ip_parameter axi_sysid_0 CONFIG.ROM_ADDR_BITS 9
13+
ad_ip_parameter rom_sys_0 CONFIG.PATH_TO_FILE "$mem_init_sys_file_path/mem_init_sys.txt"
14+
ad_ip_parameter rom_sys_0 CONFIG.ROM_ADDR_BITS 9
15+
16+
set sys_cstring "TWOLANES=$ad_project_params(TWOLANES) \
17+
ADC_RES=$ad_project_params(ADC_RES) \
18+
USE_MMCM=$ad_project_params(USE_MMCM)"
19+
20+
sysid_gen_sys_init_file $sys_cstring
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
###############################################################################
2+
## Copyright (C) 2022-2023, 2025 Analog Devices, Inc. All rights reserved.
3+
### SPDX short identifier: ADIBSD
4+
###############################################################################
5+
6+
# adaq23875/adaq23876/adaq23878
7+
# clocks
8+
9+
set_property -dict {PACKAGE_PIN D18 IOSTANDARD LVDS_25 DIFF_TERM TRUE} [get_ports ref_clk_p] ; ## G2 FMC_CLK1_M2C_P IO_L12P_T1_MRCC_35
10+
set_property -dict {PACKAGE_PIN C19 IOSTANDARD LVDS_25 DIFF_TERM TRUE} [get_ports ref_clk_n] ; ## G3 FMC_CLK1_M2C_N IO_L12N_T1_MRCC_35
11+
set_property -dict {PACKAGE_PIN M19 IOSTANDARD LVDS_25} [get_ports clk_p] ; ## G6 FMC_LA00_CC_P IO_L13P_T2_MRCC_34
12+
set_property -dict {PACKAGE_PIN M20 IOSTANDARD LVDS_25} [get_ports clk_n] ; ## G7 FMC_LA00_CC_N IO_L13N_T2_MRCC_34
13+
14+
# fpga_cnv
15+
16+
set_property -dict {PACKAGE_PIN N19 IOSTANDARD LVDS_25} [get_ports cnv_p] ; ## D8 FMC_LA01_CC_P IO_L14P_T2_SRCC_34
17+
set_property -dict {PACKAGE_PIN N20 IOSTANDARD LVDS_25} [get_ports cnv_n] ; ## D9 FMC_LA01_CC_N IO_L14N_T2_SRCC_34
18+
set_property -dict {PACKAGE_PIN P22 IOSTANDARD LVCMOS25} [get_ports cnv_en] ; ## G10 FMC_LA03_N IO_L16N_T2_34
19+
20+
# dco, da, db
21+
22+
set_property -dict {PACKAGE_PIN L18 IOSTANDARD LVDS_25 DIFF_TERM TRUE} [get_ports dco_p] ; ## H4 FMC_CLK0_M2C_P IO_L12P_T1_MRCC_34
23+
set_property -dict {PACKAGE_PIN L19 IOSTANDARD LVDS_25 DIFF_TERM TRUE} [get_ports dco_n] ; ## H5 FMC_CLK0_M2C_N IO_L12N_T1_MRCC_34
24+
set_property -dict {PACKAGE_PIN P17 IOSTANDARD LVDS_25 DIFF_TERM TRUE} [get_ports da_p] ; ## H7 FMC_LA02_P IO_L20P_T3_34
25+
set_property -dict {PACKAGE_PIN P18 IOSTANDARD LVDS_25 DIFF_TERM TRUE} [get_ports da_n] ; ## H8 FMC_LA02_N IO_L20N_T3_34
26+
set_property -dict {PACKAGE_PIN M21 IOSTANDARD LVDS_25 DIFF_TERM TRUE} [get_ports db_p] ; ## H10 FMC_LA04_P IO_L15P_T2_DQS_34
27+
set_property -dict {PACKAGE_PIN M22 IOSTANDARD LVDS_25 DIFF_TERM TRUE} [get_ports db_n] ; ## H11 FMC_LA04_N IO_L15N_T2_DQS_34
28+
29+
# 100MHz clock
30+
set clk_period 10
31+
# differential propagation delay for ref_clk
32+
set tref_early 0.3
33+
set tref_late 1.5
34+
35+
# clocks
36+
37+
create_clock -period $clk_period -name ref_clk [get_ports ref_clk_p]
38+
39+
# clock latencies
40+
41+
# minimum source latency values
42+
set_clock_latency -source -early $tref_early [get_clocks ref_clk]
43+
# maximum source latency values
44+
set_clock_latency -source -late $tref_late [get_clocks ref_clk]
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
###############################################################################
2+
## Copyright (C) 2022-2023, 2025 Analog Devices, Inc. All rights reserved.
3+
### SPDX short identifier: ADIBSD
4+
###############################################################################
5+
6+
# load scripts
7+
source ../../../scripts/adi_env.tcl
8+
source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl
9+
source $ad_hdl_dir/projects/scripts/adi_board.tcl
10+
11+
# TWOLANES: parameter describing the number of lanes
12+
# - 1: in two-lane mode (default)
13+
# - 0: in one-lane mode
14+
#
15+
# ADC_RES: parameter describing the ADC input resolution, thus selecting
16+
# between ADAQ23878 (18-bit, default) and ADAQ23875/ADAQ23876 (16-bit)
17+
# - 18: 18 bits, ADAQ23878 (default)
18+
# - 16: 16 bits, ADAQ23875 & ADAQ23876
19+
#
20+
# USE_MMCM: parameter used to select between the 100MHz ref_clk or passing it
21+
# through a clk_wizard and increase it to 120MHz
22+
# - 1: use the default clocking scheme
23+
# - 0: use the clk_wizard to increase the clk frequency
24+
#
25+
# The valid configurations for each supported evaluation board, depending on
26+
# the above parameters, are:
27+
#
28+
# Eval board | ADC_RES | TWOLANES | USE_MMCM |
29+
# ============================================
30+
# ADAQ23875 | 16 | 0 or 1 | 0 or 1 |
31+
# ADAQ23876 | 16 | 0 or 1 | 0 or 1 |
32+
# ADAQ23878 | 18 | 0 or 1 | 0 or 1 |
33+
34+
adi_project adaq23875_zed 0 [list \
35+
TWOLANES [get_env_param TWOLANES 1 ] \
36+
ADC_RES [get_env_param ADC_RES 18 ] \
37+
USE_MMCM [get_env_param USE_MMCM 0 ]]
38+
39+
# Base files
40+
set base_files [list \
41+
"system_top.v" \
42+
"system_constr.xdc" \
43+
"$ad_hdl_dir/library/xilinx/common/ad_data_clk.v" \
44+
"$ad_hdl_dir/library/common/ad_iobuf.v" \
45+
"$ad_hdl_dir/projects/common/zed/zed_system_constr.xdc"]
46+
47+
# Append timing constraint file based on USE_MMCM
48+
if { [get_env_param USE_MMCM 0] == 1 } {
49+
lappend base_files "timing_mmcm.xdc"
50+
} else {
51+
lappend base_files "timing_default.xdc"
52+
}
53+
54+
# Register final list
55+
adi_project_files adaq23875_zed $base_files
56+
57+
adi_project_run adaq23875_zed

0 commit comments

Comments
 (0)