|
| 1 | +# *************************************************************************** |
| 2 | +# *************************************************************************** |
| 3 | +# Copyright (C) 2024 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/master/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 | +source ../../scripts/adi_env.tcl |
| 37 | + |
| 38 | +# Device clk |
| 39 | +ad_ip_instance clk_vip device_clk_vip [ list \ |
| 40 | + INTERFACE_MODE {MASTER} \ |
| 41 | + FREQ_HZ 62500000 \ |
| 42 | +] |
| 43 | +adi_sim_add_define "DEVICE_CLK=device_clk_vip" |
| 44 | + |
| 45 | +set device_clk device_clk_vip/clk_out |
| 46 | + |
| 47 | +# ------------------ |
| 48 | +# |
| 49 | +# Blocks under test |
| 50 | +# |
| 51 | +# ------------------ |
| 52 | + |
| 53 | +global rx_dma_cfg |
| 54 | +global tx_dma_cfg |
| 55 | + |
| 56 | +ad_ip_instance axi_dmac dut_rx_dma $rx_dma_cfg |
| 57 | +ad_ip_instance axi_dmac dut_tx_dma $tx_dma_cfg |
| 58 | + |
| 59 | +ad_connect $device_clk dut_rx_dma/s_axis_aclk |
| 60 | +ad_connect $device_clk dut_tx_dma/m_axis_aclk |
| 61 | + |
| 62 | +# connect resets |
| 63 | +ad_connect $sys_cpu_resetn dut_rx_dma/m_dest_axi_aresetn |
| 64 | +ad_connect $sys_cpu_resetn dut_tx_dma/m_src_axi_aresetn |
| 65 | + |
| 66 | +ad_connect $sys_cpu_resetn dut_rx_dma/m_sg_axi_aresetn |
| 67 | +ad_connect $sys_cpu_resetn dut_tx_dma/m_sg_axi_aresetn |
| 68 | + |
| 69 | +# create loopback |
| 70 | +ad_connect dut_tx_dma/m_axis dut_rx_dma/s_axis |
| 71 | + |
| 72 | +ad_cpu_interconnect 0x7c420000 dut_rx_dma |
| 73 | +ad_cpu_interconnect 0x7c430000 dut_tx_dma |
| 74 | + |
| 75 | +ad_mem_hp0_interconnect $sys_cpu_clk dut_rx_dma/m_dest_axi |
| 76 | +ad_mem_hp0_interconnect $sys_cpu_clk dut_tx_dma/m_src_axi |
| 77 | + |
| 78 | +ad_mem_hp0_interconnect $sys_cpu_clk dut_rx_dma/m_sg_axi |
| 79 | +ad_mem_hp0_interconnect $sys_cpu_clk dut_tx_dma/m_sg_axi |
| 80 | + |
| 81 | +ad_cpu_interrupt ps-13 mb-12 dut_rx_dma/irq |
| 82 | +ad_cpu_interrupt ps-12 mb-13 dut_tx_dma/irq |
| 83 | + |
| 84 | +set RX_DMA 0x7C420000 |
| 85 | +set_property offset $RX_DMA [get_bd_addr_segs {mng_axi_vip/Master_AXI/SEG_data_dut_rx_dma}] |
| 86 | +adi_sim_add_define "RX_DMA_BA=[format "%d" ${RX_DMA}]" |
| 87 | + |
| 88 | +set TX_DMA 0x7C430000 |
| 89 | +set_property offset $TX_DMA [get_bd_addr_segs {mng_axi_vip/Master_AXI/SEG_data_dut_tx_dma}] |
| 90 | +adi_sim_add_define "TX_DMA_BA=[format "%d" ${TX_DMA}]" |
0 commit comments