Skip to content

Commit 25363b5

Browse files
committed
ad4062: de10nano: Add project
Signed-off-by: Jorge Marques <jorge.marques@analog.com>
1 parent f20c412 commit 25363b5

File tree

6 files changed

+536
-0
lines changed

6 files changed

+536
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
###############################################################################
2+
## Copyright (C) 2025 Analog Devices, Inc. All rights reserved.
3+
### SPDX short identifier: ADIBSD
4+
###############################################################################
5+
6+
source $ad_hdl_dir/library/i3c_controller/scripts/i3c_controller_qsys.tcl
7+
8+
# disable I2C1
9+
10+
set_instance_parameter_value sys_hps {I2C1_Mode} {N/A}
11+
set_instance_parameter_value sys_hps {I2C1_PinMuxing} {Unused}
12+
13+
set async_clk 0
14+
set i2c_mod 4
15+
set offload $ad_project_params(OFFLOAD)
16+
set max_devs 16
17+
18+
i3c_controller_create i3c $async_clk $i2c_mod $offload $max_devs
19+
20+
if {$offload} {
21+
# axi pwm gen
22+
23+
add_instance i3c_offload_pwm axi_pwm_gen
24+
set_instance_parameter_value i3c_offload_pwm {N_PWMS} {1}
25+
set_instance_parameter_value i3c_offload_pwm {PULSE_0_PERIOD} {120}
26+
set_instance_parameter_value i3c_offload_pwm {PULSE_0_WIDTH} {1}
27+
28+
# receive dma
29+
30+
add_instance i3c_offload_dma axi_dmac
31+
set_instance_parameter_value i3c_offload_dma {DMA_TYPE_SRC} {1}
32+
set_instance_parameter_value i3c_offload_dma {DMA_TYPE_DEST} {0}
33+
set_instance_parameter_value i3c_offload_dma {AXI_SLICE_SRC} {0}
34+
set_instance_parameter_value i3c_offload_dma {AXI_SLICE_DEST} {1}
35+
set_instance_parameter_value i3c_offload_dma {DMA_DATA_WIDTH_SRC} {32}
36+
set_instance_parameter_value i3c_offload_dma {DMA_DATA_WIDTH_DEST} {64}
37+
}
38+
39+
# clocks
40+
41+
add_connection sys_clk.clk i3c_host_interface.s_axi_clock
42+
add_connection sys_clk.clk i3c_core.if_clk
43+
if {$offload} {
44+
add_connection sys_clk.clk i3c_offload_dma.s_axi_clock
45+
add_connection sys_clk.clk i3c_offload_dma.if_s_axis_aclk
46+
add_connection sys_clk.clk i3c_offload_dma.m_dest_axi_clock
47+
add_connection sys_clk.clk i3c_offload_pwm.s_axi_clock
48+
add_connection sys_clk.clk i3c_offload_pwm.if_ext_clk
49+
}
50+
51+
# resets
52+
53+
add_connection sys_clk.clk_reset i3c_host_interface.s_axi_reset
54+
if {$offload} {
55+
add_connection sys_clk.clk_reset i3c_offload_dma.s_axi_reset
56+
add_connection sys_clk.clk_reset i3c_offload_dma.m_dest_axi_reset
57+
add_connection sys_clk.clk_reset i3c_offload_pwm.s_axi_reset
58+
}
59+
60+
# interfaces
61+
62+
if {$offload} {
63+
add_connection i3c_host_interface.offload_sdi i3c_offload_dma.s_axis
64+
add_connection i3c_offload_pwm.if_pwm_0 i3c_host_interface.if_offload_trigger
65+
}
66+
67+
# exported interface
68+
69+
set_interface_property i3c EXPORT_OF i3c_core.i3c
70+
71+
# cpu interconnects
72+
73+
ad_cpu_interconnect 0x00030000 i3c_host_interface.s_axi
74+
if {$offload} {
75+
ad_cpu_interconnect 0x00020000 i3c_offload_dma.s_axi
76+
ad_cpu_interconnect 0x00040000 i3c_offload_pwm.s_axi
77+
}
78+
79+
# dma interconnect
80+
81+
if {$offload} {
82+
ad_dma_interconnect i3c_offload_dma.m_dest_axi
83+
}
84+
85+
# interrupts
86+
87+
if {$offload} {
88+
ad_cpu_interrupt 4 i3c_offload_dma.interrupt_sender
89+
}
90+
ad_cpu_interrupt 5 i3c_host_interface.interrupt_sender
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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_de10nano
8+
9+
M_DEPS += ../common/ad4062_qsys.tcl
10+
M_DEPS += ../../scripts/adi_pd.tcl
11+
M_DEPS += ../../common/de10nano/de10nano_system_qsys.tcl
12+
M_DEPS += ../../common/de10nano/de10nano_system_assign.tcl
13+
M_DEPS += ../../../library/i3c_controller/scripts/i3c_controller_qsys.tcl
14+
15+
LIB_DEPS += axi_dmac
16+
LIB_DEPS += axi_hdmi_tx
17+
LIB_DEPS += axi_sysid
18+
LIB_DEPS += i3c_controller/i3c_controller_core
19+
LIB_DEPS += i3c_controller/i3c_controller_host_interface
20+
LIB_DEPS += sysid_rom
21+
22+
include ../../scripts/project-intel.mk
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
###############################################################################
2+
## Copyright (C) 2025 Analog Devices, Inc. All rights reserved.
3+
### SPDX short identifier: ADIBSD
4+
###############################################################################
5+
6+
create_clock -period "20.000 ns" -name sys_clk [get_ports {sys_clk}]
7+
create_clock -period "16.666 ns" -name usb1_clk [get_ports {usb1_clk}]
8+
9+
derive_pll_clocks
10+
derive_clock_uncertainty
11+
12+
set i3c_clk sys_clk
13+
14+
# Input data driven the peripherals toggles every 4 cycles max (PP) of the capture clock
15+
# gets registered by rx_reg
16+
set_multicycle_path -from [get_ports i3c_sda] -to [get_clocks $i3c_clk] -setup 4
17+
set_multicycle_path -from [get_ports i3c_sda] -to [get_clocks $i3c_clk] -hold 3
18+
19+
# Output data toggles every 2 cycles max of the capture clock (PP)
20+
set_multicycle_path -from [get_clocks $i3c_clk] -to [get_ports i3c_sda] -setup 2
21+
set_multicycle_path -from [get_clocks $i3c_clk] -to [get_ports i3c_sda] -hold 1
22+
set_multicycle_path -from [get_clocks $i3c_clk] -to [get_ports i3c_scl] -setup 2
23+
set_multicycle_path -from [get_clocks $i3c_clk] -to [get_ports i3c_scl] -hold 1
24+
25+
26+
# Notes
27+
# tcr/tcf rising/fall time for SCL is 150e06 * 1 / fSCL, at fSCL = 12.5 MHz => 12ns, at fSCL = 6.25 MHz, 24ns.
28+
# and t_SCO has a minimum/default value of 8ns and max of 12 ns
29+
# The input_delay and output_delay are selected for the worst case scenario.
30+
# One i3c_clk clock cycle is included in the sdo signal to ensure thd_pp(min) is met.
31+
set tsco_max 12;
32+
set tsco_min 8;
33+
set trc_dly_max 1;
34+
set trc_dly_min 0;
35+
set_input_delay -clock $i3c_clk -max [expr $tsco_max + $trc_dly_max] [get_ports i3c_sda]
36+
set_input_delay -clock $i3c_clk -min [expr $tsco_min + $trc_dly_min] [get_ports i3c_sda]
37+
set tsu 2;
38+
set thd 0;
39+
set_output_delay -clock $i3c_clk -max [expr $trc_dly_max + $tsu] [get_ports i3c_sda]
40+
set_output_delay -clock $i3c_clk -min [expr $trc_dly_min - $thd] [get_ports i3c_sda]
41+
set_output_delay -clock $i3c_clk -max [expr $trc_dly_max + $tsu] [get_ports i3c_scl]
42+
set_output_delay -clock $i3c_clk -min [expr $trc_dly_min - $thd] [get_ports i3c_scl]
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+
set REQUIRED_QUARTUS_VERSION 22.1std.0
7+
set QUARTUS_PRO_ISUSED 0
8+
source ../../../scripts/adi_env.tcl
9+
source ../../scripts/adi_project_intel.tcl
10+
11+
# get_env_param retrieves parameter value from the environment if exists,
12+
# other case use the default value.
13+
#
14+
# How to use over-writable parameters from the environment:
15+
#
16+
# e.g.
17+
# make OFFLOAD=1
18+
#
19+
# Parameter description:
20+
#
21+
# OFFLOAD : Enable offload mode, includes AXI_DMAC and AXI_PWM to the design
22+
# 1 - enabled
23+
# 0 - disabled (default)
24+
25+
adi_project ad4062_ardz_de10nano [list \
26+
OFFLOAD [get_env_param OFFLOAD 0]]
27+
28+
source $ad_hdl_dir/projects/common/de10nano/de10nano_system_assign.tcl
29+
30+
# I3C interface bus
31+
32+
set_location_assignment PIN_AG11 -to i3c_scl ; ## Arduino_IO15
33+
set_location_assignment PIN_AH9 -to i3c_sda ; ## Arduino_IO14
34+
35+
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to i3c_scl
36+
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to i3c_sda
37+
38+
# Enable if not using an external 2.2k ohm passive pull-up
39+
#set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i3c_sda
40+
41+
# reset and GPIO signals
42+
43+
set_location_assignment PIN_AE15 -to common_shutdown ; ## Arduino_IO9
44+
set_location_assignment PIN_AH8 -to common_reset_adc ; ## Arduino_IO7
45+
set_location_assignment PIN_U13 -to common_csb_aux ; ## Arduino_IO5
46+
set_location_assignment PIN_U14 -to common_sw_ff ; ## Arduino_IO4
47+
set_location_assignment PIN_AG9 -to common_drdy_aux ; ## Arduino_IO3
48+
set_location_assignment PIN_AF13 -to common_blue_led ; ## Arduino_IO1
49+
set_location_assignment PIN_AG13 -to common_yellow_led ; ## Arduino_IO0
50+
51+
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to common_shutdown
52+
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to common_reset_adc
53+
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to common_csb_aux
54+
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to common_sw_ff
55+
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to common_drdy_aux
56+
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to common_blue_led
57+
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to common_yellow_led
58+
59+
# synchronization and timing
60+
61+
set_location_assignment PIN_AG8 -to common_sync_in ; ## arduino_IO6
62+
63+
set_instance_assignment -name io_standard "3.3-v lvttl" -to common_sync_in
64+
65+
execute_flow -compile
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
###############################################################################
2+
## Copyright (C) 2025 Analog Devices, Inc. All rights reserved.
3+
### SPDX short identifier: ADIBSD
4+
###############################################################################
5+
6+
source $ad_hdl_dir/projects/scripts/adi_pd.tcl
7+
source $ad_hdl_dir/projects/common/de10nano/de10nano_system_qsys.tcl
8+
9+
# disable I2C1
10+
11+
set_instance_parameter_value sys_hps {I2C1_Mode} {N/A}
12+
set_instance_parameter_value sys_hps {I2C1_PinMuxing} {Unused}
13+
14+
# set clk to 100MHz
15+
16+
set_instance_parameter_value sys_hps {S2FCLK_USER0CLK_FREQ} {100.0}
17+
18+
if [info exists ad_project_dir] {
19+
source ../../common/ad4062_qsys.tcl
20+
} else {
21+
source ../common/ad4062_qsys.tcl
22+
}
23+
24+
# system ID
25+
26+
set_instance_parameter_value axi_sysid_0 {ROM_ADDR_BITS} {9}
27+
set_instance_parameter_value rom_sys_0 {ROM_ADDR_BITS} {9}
28+
29+
set_instance_parameter_value rom_sys_0 {PATH_TO_FILE} "[pwd]/mem_init_sys.txt"
30+
31+
sysid_gen_sys_init_file;

0 commit comments

Comments
 (0)