From 6e6c51dd277de705f0828d1091cce5d64543c60d Mon Sep 17 00:00:00 2001 From: Laszlo Nagy Date: Tue, 19 Jan 2021 15:22:41 +0000 Subject: [PATCH] common/a10soc: Bridge support --- projects/common/a10soc/a10soc_system_qsys.tcl | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/projects/common/a10soc/a10soc_system_qsys.tcl b/projects/common/a10soc/a10soc_system_qsys.tcl index ea98172f7..b69da169a 100644 --- a/projects/common/a10soc/a10soc_system_qsys.tcl +++ b/projects/common/a10soc/a10soc_system_qsys.tcl @@ -195,10 +195,25 @@ proc ad_cpu_interrupt {m_irq m_port} { set_connection_parameter_value sys_hps.f2h_irq0/${m_port} irqNumber ${m_irq} } -proc ad_cpu_interconnect {m_base m_port} { +proc ad_cpu_interconnect {m_base m_port {avl_bridge ""} {avl_bridge_base 0x00000000} {avl_address_width 18}} { - add_connection sys_hps.h2f_lw_axi_master ${m_port} - set_connection_parameter_value sys_hps.h2f_lw_axi_master/${m_port} baseAddress ${m_base} + if {[string equal ${avl_bridge} ""]} { + add_connection sys_hps.h2f_lw_axi_master ${m_port} + set_connection_parameter_value sys_hps.h2f_lw_axi_master/${m_port} baseAddress ${m_base} + } else { + if {[lsearch -exact [get_instances] ${avl_bridge}] == -1} { + ## Instantiate the bridge and connect the interfaces + add_instance ${avl_bridge} altera_avalon_mm_bridge + set_instance_parameter_value ${avl_bridge} {ADDRESS_WIDTH} $avl_address_width + set_instance_parameter_value ${avl_bridge} {SYNC_RESET} {1} + add_connection sys_hps.h2f_lw_axi_master ${avl_bridge}.s0 + set_connection_parameter_value sys_hps.h2f_lw_axi_master/${avl_bridge}.s0 baseAddress ${avl_bridge_base} + add_connection sys_clk.clk ${avl_bridge}.clk + add_connection sys_clk.clk_reset ${avl_bridge}.reset + } + add_connection ${avl_bridge}.m0 ${m_port} + set_connection_parameter_value ${avl_bridge}.m0/${m_port} baseAddress ${m_base} + } } proc ad_dma_interconnect {m_port} {