From 8464816c8283f90af23aff578d11fed610205f57 Mon Sep 17 00:00:00 2001 From: Rejeesh Kutty Date: Tue, 16 Aug 2016 12:05:56 -0400 Subject: [PATCH] dmafifo-split to adc/dac --- projects/common/xilinx/sys_adcfifo.tcl | 50 +++++++++++++++++++ .../{sys_dmafifo.tcl => sys_dacfifo.tcl} | 47 +---------------- 2 files changed, 51 insertions(+), 46 deletions(-) create mode 100644 projects/common/xilinx/sys_adcfifo.tcl rename projects/common/xilinx/{sys_dmafifo.tcl => sys_dacfifo.tcl} (51%) diff --git a/projects/common/xilinx/sys_adcfifo.tcl b/projects/common/xilinx/sys_adcfifo.tcl new file mode 100644 index 000000000..2c07f900f --- /dev/null +++ b/projects/common/xilinx/sys_adcfifo.tcl @@ -0,0 +1,50 @@ + +# sys bram (use only when dma is not capable of keeping up). +# generic fifo interface - existence is oblivious to software. + +proc p_sys_adcfifo {p_name m_name adc_data_width dma_addr_width} { + + global ad_hdl_dir + + set p_instance [get_bd_cells $p_name] + set c_instance [current_bd_instance .] + + current_bd_instance $p_instance + + set m_instance [create_bd_cell -type hier $m_name] + current_bd_instance $m_instance + + create_bd_pin -dir I adc_rst + create_bd_pin -dir I -type clk adc_clk + create_bd_pin -dir I adc_wr + create_bd_pin -dir I -from [expr ($adc_data_width-1)] -to 0 adc_wdata + create_bd_pin -dir O adc_wovf + + create_bd_pin -dir I -type clk dma_clk + create_bd_pin -dir O dma_wr + create_bd_pin -dir O -from 63 -to 0 dma_wdata + create_bd_pin -dir I dma_wready + create_bd_pin -dir I dma_xfer_req + create_bd_pin -dir O -from 3 -to 0 dma_xfer_status + + set util_adcfifo [create_bd_cell -type ip -vlnv analog.com:user:util_adcfifo:1.0 util_adcfifo] + set_property -dict [list CONFIG.ADC_DATA_WIDTH $adc_data_width] $util_adcfifo + set_property -dict [list CONFIG.DMA_DATA_WIDTH {64}] $util_adcfifo + set_property -dict [list CONFIG.DMA_READY_ENABLE {1}] $util_adcfifo + set_property -dict [list CONFIG.DMA_ADDRESS_WIDTH $dma_addr_width] $util_adcfifo + + ad_connect adc_rst util_adcfifo/adc_rst + ad_connect adc_clk util_adcfifo/adc_clk + ad_connect adc_wr util_adcfifo/adc_wr + ad_connect adc_wdata util_adcfifo/adc_wdata + ad_connect adc_wovf util_adcfifo/adc_wovf + ad_connect dma_clk util_adcfifo/dma_clk + ad_connect dma_wr util_adcfifo/dma_wr + ad_connect dma_wdata util_adcfifo/dma_wdata + ad_connect dma_wready util_adcfifo/dma_wready + ad_connect dma_xfer_req util_adcfifo/dma_xfer_req + ad_connect dma_xfer_status util_adcfifo/dma_xfer_status + + current_bd_instance $c_instance +} + diff --git a/projects/common/xilinx/sys_dmafifo.tcl b/projects/common/xilinx/sys_dacfifo.tcl similarity index 51% rename from projects/common/xilinx/sys_dmafifo.tcl rename to projects/common/xilinx/sys_dacfifo.tcl index f6876fd9b..e4ae5132b 100644 --- a/projects/common/xilinx/sys_dmafifo.tcl +++ b/projects/common/xilinx/sys_dacfifo.tcl @@ -2,52 +2,6 @@ # sys bram (use only when dma is not capable of keeping up). # generic fifo interface - existence is oblivious to software. -proc p_sys_dmafifo {p_name m_name adc_data_width dma_addr_width} { - - global ad_hdl_dir - - set p_instance [get_bd_cells $p_name] - set c_instance [current_bd_instance .] - - current_bd_instance $p_instance - - set m_instance [create_bd_cell -type hier $m_name] - current_bd_instance $m_instance - - create_bd_pin -dir I adc_rst - create_bd_pin -dir I -type clk adc_clk - create_bd_pin -dir I adc_wr - create_bd_pin -dir I -from [expr ($adc_data_width-1)] -to 0 adc_wdata - create_bd_pin -dir O adc_wovf - - create_bd_pin -dir I -type clk dma_clk - create_bd_pin -dir O dma_wr - create_bd_pin -dir O -from 63 -to 0 dma_wdata - create_bd_pin -dir I dma_wready - create_bd_pin -dir I dma_xfer_req - create_bd_pin -dir O -from 3 -to 0 dma_xfer_status - - set util_adcfifo [create_bd_cell -type ip -vlnv analog.com:user:util_adcfifo:1.0 util_adcfifo] - set_property -dict [list CONFIG.ADC_DATA_WIDTH $adc_data_width] $util_adcfifo - set_property -dict [list CONFIG.DMA_DATA_WIDTH {64}] $util_adcfifo - set_property -dict [list CONFIG.DMA_READY_ENABLE {1}] $util_adcfifo - set_property -dict [list CONFIG.DMA_ADDRESS_WIDTH $dma_addr_width] $util_adcfifo - - ad_connect adc_rst util_adcfifo/adc_rst - ad_connect adc_clk util_adcfifo/adc_clk - ad_connect adc_wr util_adcfifo/adc_wr - ad_connect adc_wdata util_adcfifo/adc_wdata - ad_connect adc_wovf util_adcfifo/adc_wovf - ad_connect dma_clk util_adcfifo/dma_clk - ad_connect dma_wr util_adcfifo/dma_wr - ad_connect dma_wdata util_adcfifo/dma_wdata - ad_connect dma_wready util_adcfifo/dma_wready - ad_connect dma_xfer_req util_adcfifo/dma_xfer_req - ad_connect dma_xfer_status util_adcfifo/dma_xfer_status - - current_bd_instance $c_instance -} - proc p_sys_dacfifo {p_name m_name data_width addr_width} { global ad_hdl_dir @@ -93,3 +47,4 @@ proc p_sys_dacfifo {p_name m_name data_width addr_width} { current_bd_instance $c_instance } +