Skip to content

Commit a05e7da

Browse files
committed
ad4062: coraz7s: Add project
Signed-off-by: Jorge Marques <jorge.marques@analog.com>
1 parent fec5e3e commit a05e7da

File tree

9 files changed

+382
-0
lines changed

9 files changed

+382
-0
lines changed

projects/ad4062_ardz/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/ad4062_ardz/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# AD4062-ARDZ HDL Project
2+
3+
- Evaluation board product page: [EVAL-AD4060/EVAL-AD4062](https://www.analog.com/eval-ad4060-eval-ad4062)
4+
- System documentation:TO BE ADDED
5+
- HDL project documentation: https://analogdevicesinc.github.io/hdl/projects/ad4062_ardz/index.html
6+
7+
## Supported parts
8+
9+
| Part name | Description |
10+
|--------------------------------------------|------------------------------------------------------------|
11+
| [AD4060](https://www.analog.com/ad4060) | Compact, Low Power, 12-Bit, 2 MSPS kSPS Easy Drive SAR ADC |
12+
| [AD4062](https://www.analog.com/ad4062) | Compact, Low Power, 16-Bit, 2 MSPS kSPS Easy Drive SAR ADC |
13+
14+
## Building the project
15+
16+
Please enter the folder for the FPGA carrier you want to use and read the README.md.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
###############################################################################
2+
## Copyright (C) 2025 Analog Devices, Inc. All rights reserved.
3+
### SPDX short identifier: ADIBSD
4+
###############################################################################
5+
6+
create_bd_intf_port -mode Master -vlnv analog.com:interface:i3c_controller_rtl:1.0 i3c
7+
8+
source $ad_hdl_dir/library/i3c_controller/scripts/i3c_controller_bd.tcl
9+
10+
set async_clk 0
11+
set i2c_mod 4
12+
set offload $ad_project_params(OFFLOAD)
13+
set max_devs 16
14+
15+
i3c_controller_create i3c $async_clk $i2c_mod $offload $max_devs
16+
17+
if {$offload == 1} {
18+
# pwm to trigger on offload data burst
19+
ad_ip_instance axi_pwm_gen i3c_offload_pwm
20+
ad_ip_parameter i3c_offload_pwm CONFIG.PULSE_0_PERIOD 120
21+
ad_ip_parameter i3c_offload_pwm CONFIG.PULSE_0_WIDTH 1
22+
23+
# dma to receive offload data stream
24+
ad_ip_instance axi_dmac i3c_offload_dma
25+
ad_ip_parameter i3c_offload_dma CONFIG.DMA_TYPE_SRC 1
26+
ad_ip_parameter i3c_offload_dma CONFIG.DMA_TYPE_DEST 0
27+
ad_ip_parameter i3c_offload_dma CONFIG.CYCLIC 0
28+
ad_ip_parameter i3c_offload_dma CONFIG.SYNC_TRANSFER_START 0
29+
ad_ip_parameter i3c_offload_dma CONFIG.AXI_SLICE_SRC 0
30+
ad_ip_parameter i3c_offload_dma CONFIG.AXI_SLICE_DEST 1
31+
ad_ip_parameter i3c_offload_dma CONFIG.DMA_2D_TRANSFER 0
32+
ad_ip_parameter i3c_offload_dma CONFIG.DMA_DATA_WIDTH_SRC 32
33+
ad_ip_parameter i3c_offload_dma CONFIG.DMA_DATA_WIDTH_DEST 64
34+
35+
ad_connect sys_cpu_clk i3c_offload_pwm/ext_clk
36+
ad_connect sys_cpu_clk i3c_offload_pwm/s_axi_aclk
37+
ad_connect sys_cpu_resetn i3c_offload_pwm/s_axi_aresetn
38+
ad_connect i3c_offload_pwm/pwm_0 i3c/trigger
39+
40+
ad_connect i3c_offload_dma/s_axis i3c/offload_sdi
41+
}
42+
ad_connect i3c/m_i3c i3c
43+
44+
ad_connect sys_cpu_clk i3c/clk
45+
ad_connect sys_cpu_resetn i3c/reset_n
46+
if {$offload == 1} {
47+
ad_connect sys_cpu_clk i3c_offload_dma/s_axis_aclk
48+
ad_connect sys_cpu_resetn i3c_offload_dma/m_dest_axi_aresetn
49+
}
50+
51+
ad_cpu_interconnect 0x44a00000 i3c/host_interface
52+
if {$offload == 1} {
53+
ad_cpu_interconnect 0x44a30000 i3c_offload_dma
54+
ad_cpu_interconnect 0x44b00000 i3c_offload_pwm
55+
}
56+
57+
if {$offload == 1} {
58+
ad_cpu_interrupt "ps-13" "mb-13" i3c_offload_dma/irq
59+
}
60+
ad_cpu_interrupt "ps-12" "mb-12" i3c/irq
61+
62+
if {$offload == 1} {
63+
ad_mem_hp1_interconnect sys_cpu_clk sys_ps7/S_AXI_HP1
64+
ad_mem_hp1_interconnect sys_cpu_clk i3c_offload_dma/m_dest_axi
65+
}

projects/ad4062_ardz/coraz7s/Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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 := ad4062_ardz_coraz7s
8+
9+
M_DEPS += ../common/ad4062_bd.tcl
10+
M_DEPS += ../../scripts/adi_pd.tcl
11+
M_DEPS += ../../common/coraz7s/coraz7s_system_ps7.tcl
12+
M_DEPS += ../../common/coraz7s/coraz7s_system_constr.xdc
13+
M_DEPS += ../../common/coraz7s/coraz7s_system_bd.tcl
14+
M_DEPS += ../../../library/i3c_controller/scripts/i3c_controller_bd.tcl
15+
M_DEPS += ../../../library/common/ad_iobuf.v
16+
17+
LIB_DEPS += axi_dmac
18+
LIB_DEPS += axi_pwm_gen
19+
LIB_DEPS += axi_sysid
20+
LIB_DEPS += i3c_controller/i3c_controller_core
21+
LIB_DEPS += i3c_controller/i3c_controller_host_interface
22+
LIB_DEPS += sysid_rom
23+
24+
include ../../scripts/project-xilinx.mk
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# AD4062-ARDZ/CORAZ7S HDL Project
2+
3+
## Building the project
4+
5+
```
6+
cd projects/ad4062_ardz/coraz7s
7+
make
8+
```
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
###############################################################################
2+
## Copyright (C) 2025 Analog Devices, Inc. All rights reserved.
3+
### SPDX short identifier: ADIBSD
4+
###############################################################################
5+
6+
source $ad_hdl_dir/projects/common/coraz7s/coraz7s_system_bd.tcl
7+
source $ad_hdl_dir/projects/scripts/adi_pd.tcl
8+
9+
# Remove common IIC interface to add I3C controller
10+
delete_bd_objs [get_bd_intf_nets axi_iic_ard_IIC] [get_bd_intf_ports iic_ard]
11+
delete_bd_objs [get_bd_nets axi_iic_ard_iic2intc_irpt] [get_bd_intf_nets axi_gp0_interconnect_M00_AXI] [get_bd_cells axi_iic_ard]
12+
13+
source ../common/ad4062_bd.tcl
14+
15+
set mem_init_sys_path [get_env_param ADI_PROJECT_DIR ""]mem_init_sys.txt;
16+
17+
#system ID
18+
ad_ip_parameter axi_sysid_0 CONFIG.ROM_ADDR_BITS 9
19+
ad_ip_parameter rom_sys_0 CONFIG.PATH_TO_FILE "[pwd]/$mem_init_sys_path";
20+
ad_ip_parameter rom_sys_0 CONFIG.ROM_ADDR_BITS 9
21+
22+
sysid_gen_sys_init_file
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
###############################################################################
2+
## Copyright (C) 2025 Analog Devices, Inc. All rights reserved.
3+
### SPDX short identifier: ADIBSD
4+
###############################################################################
5+
6+
set_property -dict {PACKAGE_PIN M18 IOSTANDARD LVCMOS33} [get_ports adc_gp0]
7+
set_property -dict {PACKAGE_PIN N18 IOSTANDARD LVCMOS33} [get_ports adc_gp1]
8+
9+
# clk_fpga_0 is the first PL fabric clock, also called $sys_cpu_clk
10+
set i3c_clk clk_fpga_0
11+
12+
# Input data driven the peripherals toggles every 4 cycles max (PP) of the capture clock
13+
# gets registered by rx_reg
14+
set_multicycle_path -from [get_ports i3c_sda] -to [get_clocks $i3c_clk] -setup 4
15+
set_multicycle_path -from [get_ports i3c_sda] -to [get_clocks $i3c_clk] -hold 3
16+
17+
# Output data toggles every 2 cycles max of the capture clock (PP)
18+
set_multicycle_path -from [get_clocks $i3c_clk] -to [get_ports i3c_sda] -setup 2
19+
set_multicycle_path -from [get_clocks $i3c_clk] -to [get_ports i3c_sda] -hold 1
20+
set_multicycle_path -from [get_clocks $i3c_clk] -to [get_ports i3c_scl] -setup 2
21+
set_multicycle_path -from [get_clocks $i3c_clk] -to [get_ports i3c_scl] -hold 1
22+
23+
# Notes
24+
# tcr/tcf rising/fall time for SCL is 150e06 * 1 / fSCL, at fSCL = 12.5 MHz => 12ns, at fSCL = 6.25 MHz, 24ns.
25+
# and t_SCO has a minimum/default value of 8ns and max of 12 ns
26+
# The input_delay and output_delay are selected for the worst case scenario.
27+
# One i3c_clk clock cycle is included in the sdo signal to ensure thd_pp(min) is met.
28+
set tsco_max 12;
29+
set tsco_min 8;
30+
set trc_dly_max 1;
31+
set trc_dly_min 0;
32+
set_input_delay -clock $i3c_clk -max [expr $tsco_max + $trc_dly_max] [get_ports i3c_sda]
33+
set_input_delay -clock $i3c_clk -min [expr $tsco_min + $trc_dly_min] [get_ports i3c_sda]
34+
set tsu 2;
35+
set thd 0;
36+
set_output_delay -clock $i3c_clk -max [expr $trc_dly_max + $tsu] [get_ports i3c_sda]
37+
set_output_delay -clock $i3c_clk -min [expr $trc_dly_min - $thd] [get_ports i3c_sda]
38+
set_output_delay -clock $i3c_clk -max [expr $trc_dly_max + $tsu] [get_ports i3c_scl]
39+
set_output_delay -clock $i3c_clk -min [expr $trc_dly_min - $thd] [get_ports i3c_scl]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
###############################################################################
2+
## Copyright (C) 2025 Analog Devices, Inc. All rights reserved.
3+
### SPDX short identifier: ADIBSD
4+
###############################################################################
5+
6+
source ../../../scripts/adi_env.tcl
7+
source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl
8+
source $ad_hdl_dir/projects/scripts/adi_board.tcl
9+
10+
# get_env_param retrieves parameter value from the environment if exists,
11+
# other case use the default value.
12+
#
13+
# How to use over-writable parameters from the environment:
14+
#
15+
# e.g.
16+
# make OFFLOAD=1
17+
#
18+
# Parameter description:
19+
#
20+
# OFFLOAD : Enable offload mode, includes AXI_DMAC and AXI_PWM to the design
21+
# 1 - enabled
22+
# 0 - disabled (default)
23+
24+
adi_project ad4062_ardz_coraz7s 0 [list \
25+
OFFLOAD [get_env_param OFFLOAD 0]]
26+
27+
adi_project_files ad4062_ardz_coraz7s [list \
28+
"$ad_hdl_dir/library/common/ad_iobuf.v" \
29+
"system_top.v" \
30+
"system_constr.xdc" \
31+
"$ad_hdl_dir/projects/common/coraz7s/coraz7s_system_constr.xdc"]
32+
33+
adi_project_run ad4062_ardz_coraz7s
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
// ***************************************************************************
2+
// ***************************************************************************
3+
// Copyright (C) 2025 Analog Devices, Inc. All rights reserved.
4+
//
5+
// In this HDL repository, there are many different and unique modules, consisting
6+
// of various HDL (Verilog or VHDL) components. The individual modules are
7+
// developed independently, and may be accompanied by separate and unique license
8+
// terms.
9+
//
10+
// The user should read each of these license terms, and understand the
11+
// freedoms and responsibilities that he or she has by using this source/core.
12+
//
13+
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
14+
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15+
// A PARTICULAR PURPOSE.
16+
//
17+
// Redistribution and use of source or resulting binaries, with or without modification
18+
// of this file, are permitted under one of the following two license terms:
19+
//
20+
// 1. The GNU General Public License version 2 as published by the
21+
// Free Software Foundation, which can be found in the top level directory
22+
// of this repository (LICENSE_GPL2), and also online at:
23+
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
24+
//
25+
// OR
26+
//
27+
// 2. An ADI specific BSD license, which can be found in the top level directory
28+
// of this repository (LICENSE_ADIBSD), and also on-line at:
29+
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
30+
// This will allow to generate bit files and not release the source code,
31+
// as long as it attaches to an ADI device.
32+
//
33+
// ***************************************************************************
34+
// ***************************************************************************
35+
36+
`timescale 1ns/100ps
37+
38+
module system_top (
39+
40+
inout [14:0] ddr_addr,
41+
inout [ 2:0] ddr_ba,
42+
inout ddr_cas_n,
43+
inout ddr_ck_n,
44+
inout ddr_ck_p,
45+
inout ddr_cke,
46+
inout ddr_cs_n,
47+
inout [ 3:0] ddr_dm,
48+
inout [31:0] ddr_dq,
49+
inout [ 3:0] ddr_dqs_n,
50+
inout [ 3:0] ddr_dqs_p,
51+
inout ddr_odt,
52+
inout ddr_ras_n,
53+
inout ddr_reset_n,
54+
inout ddr_we_n,
55+
56+
inout fixed_io_ddr_vrn,
57+
inout fixed_io_ddr_vrp,
58+
inout [53:0] fixed_io_mio,
59+
inout fixed_io_ps_clk,
60+
inout fixed_io_ps_porb,
61+
inout fixed_io_ps_srstb,
62+
63+
inout [ 1:0] btn,
64+
inout [ 5:0] led,
65+
66+
output iic_ard_scl,
67+
inout iic_ard_sda,
68+
69+
inout adc_gp1,
70+
inout adc_gp0
71+
);
72+
73+
// internal signals
74+
75+
wire [63:0] gpio_i;
76+
wire [63:0] gpio_o;
77+
wire [63:0] gpio_t;
78+
wire i3c_sdo;
79+
wire i3c_sdi;
80+
wire i3c_t;
81+
82+
// instantiations
83+
84+
assign gpio_i[31:8] = gpio_o[31:8];
85+
assign gpio_i[63:34] = gpio_o[63:34];
86+
87+
ad_iobuf #(
88+
.DATA_WIDTH(2)
89+
) i_iobuf_gp (
90+
.dio_t(gpio_t[33:32]),
91+
.dio_i(gpio_o[33:32]),
92+
.dio_o(gpio_i[33:32]),
93+
.dio_p({adc_gp1, // device ready then ~data ready
94+
adc_gp0})); // threshold event
95+
96+
ad_iobuf #(
97+
.DATA_WIDTH(1)
98+
) i_iobuf_sda (
99+
.dio_t(i3c_t),
100+
.dio_i(i3c_sdo),
101+
.dio_o(i3c_sdi),
102+
.dio_p(iic_ard_sda));
103+
104+
ad_iobuf #(
105+
.DATA_WIDTH(2)
106+
) i_iobuf_buttons (
107+
.dio_t(gpio_t[1:0]),
108+
.dio_i(gpio_o[1:0]),
109+
.dio_o(gpio_i[1:0]),
110+
.dio_p(btn));
111+
112+
ad_iobuf #(
113+
.DATA_WIDTH(6)
114+
) i_iobuf_leds (
115+
.dio_t(gpio_t[7:2]),
116+
.dio_i(gpio_o[7:2]),
117+
.dio_o(gpio_i[7:2]),
118+
.dio_p(led));
119+
120+
system_wrapper i_system_wrapper (
121+
.ddr_addr (ddr_addr),
122+
.ddr_ba (ddr_ba),
123+
.ddr_cas_n (ddr_cas_n),
124+
.ddr_ck_n (ddr_ck_n),
125+
.ddr_ck_p (ddr_ck_p),
126+
.ddr_cke (ddr_cke),
127+
.ddr_cs_n (ddr_cs_n),
128+
.ddr_dm (ddr_dm),
129+
.ddr_dq (ddr_dq),
130+
.ddr_dqs_n (ddr_dqs_n),
131+
.ddr_dqs_p (ddr_dqs_p),
132+
.ddr_odt (ddr_odt),
133+
.ddr_ras_n (ddr_ras_n),
134+
.ddr_reset_n (ddr_reset_n),
135+
.ddr_we_n (ddr_we_n),
136+
.fixed_io_ddr_vrn (fixed_io_ddr_vrn),
137+
.fixed_io_ddr_vrp (fixed_io_ddr_vrp),
138+
.fixed_io_mio (fixed_io_mio),
139+
.fixed_io_ps_clk (fixed_io_ps_clk),
140+
.fixed_io_ps_porb (fixed_io_ps_porb),
141+
.fixed_io_ps_srstb (fixed_io_ps_srstb),
142+
.gpio_i (gpio_i),
143+
.gpio_o (gpio_o),
144+
.gpio_t (gpio_t),
145+
.spi0_clk_i (1'b0),
146+
.spi0_clk_o (),
147+
.spi0_csn_0_o (),
148+
.spi0_csn_1_o (),
149+
.spi0_csn_2_o (),
150+
.spi0_csn_i (1'b1),
151+
.spi0_sdi_i (1'b0),
152+
.spi0_sdo_i (1'b0),
153+
.spi0_sdo_o (),
154+
.spi1_clk_i (1'b0),
155+
.spi1_clk_o (),
156+
.spi1_csn_0_o (),
157+
.spi1_csn_1_o (),
158+
.spi1_csn_2_o (),
159+
.spi1_csn_i (1'b1),
160+
.spi1_sdi_i (1'b0),
161+
.spi1_sdo_i (1'b0),
162+
.spi1_sdo_o (),
163+
.i3c_scl (iic_ard_scl),
164+
.i3c_sdi (i3c_sdi),
165+
.i3c_sdo (i3c_sdo),
166+
.i3c_t (i3c_t));
167+
168+
endmodule

0 commit comments

Comments
 (0)