common: adc/dac fifo board designs

main
Rejeesh Kutty 2017-02-27 15:53:42 -05:00
parent 1d6ddacfd6
commit c1aac4a9fb
4 changed files with 68 additions and 233 deletions

View File

@ -2,49 +2,10 @@
# 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} {
create_bd_cell -type ip -vlnv analog.com:user:util_adcfifo:1.0 $adc_fifo_name
set_property CONFIG.ADC_DATA_WIDTH $adc_data_width [get_bd_cells $adc_fifo_name]
set_property CONFIG.DMA_DATA_WIDTH $adc_dma_data_width [get_bd_cells $adc_fifo_name]
set_property CONFIG.DMA_READY_ENABLE {1} [get_bd_cells $adc_fifo_name]
set_property CONFIG.DMA_ADDRESS_WIDTH $adc_fifo_address_width [get_bd_cells $adc_fifo_name]
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
}

View File

@ -2,49 +2,11 @@
# sys bram (use only when dma is not capable of keeping up).
# generic fifo interface - existence is oblivious to software.
proc p_sys_dacfifo {p_name m_name data_width 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 dma_clk
create_bd_pin -dir I dma_rst
create_bd_pin -dir O dma_ready
create_bd_pin -dir I dma_valid
create_bd_pin -dir I -from [expr ($data_width-1)] -to 0 dma_data
create_bd_pin -dir I dma_xfer_req
create_bd_pin -dir I dma_xfer_last
create_bd_pin -dir I dac_fifo_bypass
create_bd_pin -dir I dac_clk
create_bd_pin -dir I dac_valid
create_bd_pin -dir O -from [expr ($data_width - 1)] -to 0 dac_data
create_bd_pin -dir O dac_xfer_out
set util_dacfifo [create_bd_cell -type ip -vlnv analog.com:user:util_dacfifo:1.0 util_dacfifo]
set_property -dict [list CONFIG.DATA_WIDTH $data_width] $util_dacfifo
set_property -dict [list CONFIG.ADDRESS_WIDTH $addr_width] $util_dacfifo
ad_connect dma_clk util_dacfifo/dma_clk
ad_connect dac_clk util_dacfifo/dac_clk
ad_connect dma_rst util_dacfifo/dma_rst
ad_connect dma_ready util_dacfifo/dma_ready
ad_connect dma_valid util_dacfifo/dma_valid
ad_connect dma_data util_dacfifo/dma_data
ad_connect dma_xfer_req util_dacfifo/dma_xfer_req
ad_connect dma_xfer_last util_dacfifo/dma_xfer_last
ad_connect dac_valid util_dacfifo/dac_valid
ad_connect dac_data util_dacfifo/dac_data
ad_connect dac_xfer_out util_dacfifo/dac_xfer_out
ad_connect dac_fifo_bypass util_dacfifo/dac_fifo_bypass
current_bd_instance $c_instance
if {$dac_data_width != $dac_dma_data_width} {
return -code error [format "ERROR: util_dacfifo dac/dma widths must be the same!"]
}
create_bd_cell -type ip -vlnv analog.com:user:util_dacfifo:1.0 $dac_fifo_name
set_property CONFIG.DATA_WIDTH $dac_data_width [get_bd_cells $dac_fifo_name]
set_property CONFIG.ADDRESS_WIDTH $dac_fifo_address_width [get_bd_cells $dac_fifo_name]

View File

@ -2,77 +2,40 @@
# pl ddr3 (use only when dma is not capable of keeping up).
# generic fifo interface - existence is oblivious to software.
proc p_plddr3_adcfifo {p_name m_name adc_data_width} {
create_bd_cell -type ip -vlnv xilinx.com:ip:proc_sys_reset:5.0 axi_rstgen
create_bd_cell -type ip -vlnv xilinx.com:ip:mig_7series:4.0 axi_ddr_cntrl
global ad_hdl_dir
file copy -force $ad_hdl_dir/projects/common/zc706/zc706_plddr3_mig.prj [get_property IP_DIR \
[get_ips [get_property CONFIG.Component_Name [get_bd_cells axi_ddr_cntrl]]]]
set_property CONFIG.XML_INPUT_FILE {zc706_plddr3_mig.prj} [get_bd_cells axi_ddr_cntrl]
set p_instance [get_bd_cells $p_name]
set c_instance [current_bd_instance .]
create_bd_port -dir I -type rst sys_rst
set_property CONFIG.POLARITY ACTIVE_HIGH [get_bd_ports sys_rst]
current_bd_instance $p_instance
create_bd_intf_port -mode Master -vlnv xilinx.com:interface:ddrx_rtl:1.0 ddr3
create_bd_intf_port -mode Slave -vlnv xilinx.com:interface:diff_clock_rtl:1.0 sys_clk
set m_instance [create_bd_cell -type hier $m_name]
current_bd_instance $m_instance
ad_connect sys_rst axi_ddr_cntrl/sys_rst
ad_connect sys_clk axi_ddr_cntrl/SYS_CLK
ad_connect ddr3 axi_ddr_cntrl/DDR3
create_bd_pin -dir I -type rst sys_rst
create_bd_intf_pin -mode Master -vlnv xilinx.com:interface:ddrx_rtl:1.0 ddr3
create_bd_intf_pin -mode Slave -vlnv xilinx.com:interface:diff_clock_rtl:1.0 sys_clk
create_bd_cell -type ip -vlnv analog.com:user:axi_adcfifo:1.0 $adc_fifo_name
set_property CONFIG.ADC_DATA_WIDTH $adc_data_width [get_bd_cells $adc_fifo_name]
set_property CONFIG.DMA_DATA_WIDTH $adc_dma_data_width [get_bd_cells $adc_fifo_name]
set_property CONFIG.AXI_DATA_WIDTH {512} [get_bd_cells $adc_fifo_name]
set_property CONFIG.DMA_READY_ENABLE {1} [get_bd_cells $adc_fifo_name]
set_property CONFIG.AXI_SIZE {6} [get_bd_cells $adc_fifo_name]
set_property CONFIG.AXI_LENGTH {4} [get_bd_cells $adc_fifo_name]
set_property CONFIG.AXI_ADDRESS {0x80000000} [get_bd_cells $adc_fifo_name]
set_property CONFIG.AXI_ADDRESS_LIMIT {0xa0000000} [get_bd_cells $adc_fifo_name]
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
ad_connect axi_ddr_cntrl/S_AXI $adc_fifo_name/axi
ad_connect axi_ddr_cntrl/ui_clk $adc_fifo_name/axi_clk
ad_connect axi_ddr_cntrl/ui_clk axi_rstgen/slowest_sync_clk
ad_connect sys_cpu_resetn axi_rstgen/ext_reset_in
ad_connect axi_rstgen/peripheral_aresetn $adc_fifo_name/axi_resetn
ad_connect axi_rstgen/peripheral_aresetn axi_ddr_cntrl/aresetn
ad_connect axi_ddr_cntrl/device_temp_i GND
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 axi_ddr_cntrl [create_bd_cell -type ip -vlnv xilinx.com:ip:mig_7series:4.0 axi_ddr_cntrl]
set axi_ddr_cntrl_dir [get_property IP_DIR [get_ips [get_property CONFIG.Component_Name $axi_ddr_cntrl]]]
file copy -force $ad_hdl_dir/projects/common/zc706/zc706_plddr3_mig.prj "$axi_ddr_cntrl_dir/"
set_property -dict [list CONFIG.XML_INPUT_FILE {zc706_plddr3_mig.prj}] $axi_ddr_cntrl
set axi_rstgen [create_bd_cell -type ip -vlnv xilinx.com:ip:proc_sys_reset:5.0 axi_rstgen]
set axi_adcfifo [create_bd_cell -type ip -vlnv analog.com:user:axi_adcfifo:1.0 axi_adcfifo]
set_property -dict [list CONFIG.ADC_DATA_WIDTH $adc_data_width] $axi_adcfifo
set_property -dict [list CONFIG.DMA_DATA_WIDTH {64}] $axi_adcfifo
set_property -dict [list CONFIG.AXI_DATA_WIDTH {512}] $axi_adcfifo
set_property -dict [list CONFIG.DMA_READY_ENABLE {1}] $axi_adcfifo
set_property -dict [list CONFIG.AXI_SIZE {6}] $axi_adcfifo
set_property -dict [list CONFIG.AXI_LENGTH {4}] $axi_adcfifo
set_property -dict [list CONFIG.AXI_ADDRESS {0x80000000}] $axi_adcfifo
set_property -dict [list CONFIG.AXI_ADDRESS_LIMIT {0xa0000000}] $axi_adcfifo
ad_connect sys_rst axi_ddr_cntrl/sys_rst
ad_connect sys_clk axi_ddr_cntrl/SYS_CLK
ad_connect ddr3 axi_ddr_cntrl/DDR3
ad_connect axi_ddr_cntrl/S_AXI axi_adcfifo/axi
ad_connect adc_rst axi_adcfifo/adc_rst
ad_connect adc_rst axi_rstgen/ext_reset_in
ad_connect adc_clk axi_adcfifo/adc_clk
ad_connect adc_wr axi_adcfifo/adc_wr
ad_connect adc_wdata axi_adcfifo/adc_wdata
ad_connect adc_wovf axi_adcfifo/adc_wovf
ad_connect dma_clk axi_adcfifo/dma_clk
ad_connect dma_wr axi_adcfifo/dma_wr
ad_connect dma_wdata axi_adcfifo/dma_wdata
ad_connect dma_wready axi_adcfifo/dma_wready
ad_connect dma_xfer_req axi_adcfifo/dma_xfer_req
ad_connect dma_xfer_status axi_adcfifo/dma_xfer_status
ad_connect axi_clk axi_ddr_cntrl/ui_clk
ad_connect axi_clk axi_adcfifo/axi_clk
ad_connect axi_clk axi_rstgen/slowest_sync_clk
ad_connect axi_resetn axi_rstgen/peripheral_aresetn
ad_connect axi_resetn axi_adcfifo/axi_resetn
ad_connect axi_resetn axi_ddr_cntrl/aresetn
ad_connect axi_ddr_cntrl/device_temp_i GND
current_bd_instance $c_instance
}
assign_bd_address [get_bd_addr_segs -of_objects [get_bd_cells axi_ddr_cntrl]]

View File

@ -2,90 +2,39 @@
# pl ddr3 (use only when dma is not capable of keeping up).
# generic fifo interface - existence is oblivious to software.
proc p_plddr3_dacfifo {p_name m_name dma_data_width dac_data_width} {
create_bd_cell -type ip -vlnv xilinx.com:ip:proc_sys_reset:5.0 axi_rstgen
create_bd_cell -type ip -vlnv xilinx.com:ip:mig_7series:4.0 axi_ddr_cntrl
global ad_hdl_dir
file copy -force $ad_hdl_dir/projects/common/zc706/zc706_plddr3_mig.prj [get_property IP_DIR \
[get_ips [get_property CONFIG.Component_Name [get_bd_cells axi_ddr_cntrl]]]]
set_property CONFIG.XML_INPUT_FILE {zc706_plddr3_mig.prj} [get_bd_cells axi_ddr_cntrl]
set p_instance [get_bd_cells $p_name]
set c_instance [current_bd_instance .]
create_bd_port -dir I -type rst sys_rst
set_property CONFIG.POLARITY ACTIVE_HIGH [get_bd_ports sys_rst]
current_bd_instance $p_instance
create_bd_intf_port -mode Master -vlnv xilinx.com:interface:ddrx_rtl:1.0 ddr3
create_bd_intf_port -mode Slave -vlnv xilinx.com:interface:diff_clock_rtl:1.0 sys_clk
set m_instance [create_bd_cell -type hier $m_name]
current_bd_instance $m_instance
ad_connect sys_rst axi_ddr_cntrl/sys_rst
ad_connect sys_clk axi_ddr_cntrl/SYS_CLK
ad_connect ddr3 axi_ddr_cntrl/DDR3
create_bd_pin -dir I -type rst sys_rst
create_bd_intf_pin -mode Master -vlnv xilinx.com:interface:ddrx_rtl:1.0 ddr3
create_bd_intf_pin -mode Slave -vlnv xilinx.com:interface:diff_clock_rtl:1.0 sys_clk
create_bd_cell -type ip -vlnv analog.com:user:axi_dacfifo:1.0 $dac_fifo_name
set_property CONFIG.DAC_DATA_WIDTH $dac_data_width [get_bd_cells $dac_fifo_name]
set_property CONFIG.DMA_DATA_WIDTH $dac_dma_data_width [get_bd_cells $dac_fifo_name]
set_property CONFIG.AXI_DATA_WIDTH {512} [get_bd_cells $dac_fifo_name]
set_property CONFIG.AXI_SIZE {6} [get_bd_cells $dac_fifo_name]
set_property CONFIG.AXI_LENGTH {15} [get_bd_cells $dac_fifo_name]
set_property CONFIG.AXI_ADDRESS {0x80000000} [get_bd_cells $dac_fifo_name]
set_property CONFIG.AXI_ADDRESS_LIMIT {0xa0000000} [get_bd_cells $dac_fifo_name]
create_bd_pin -dir I dac_rst
create_bd_pin -dir I -type clk dac_clk
create_bd_pin -dir I dac_valid
create_bd_pin -dir O -from [expr ($dac_data_width-1)] -to 0 dac_data
create_bd_pin -dir O dac_dunf
create_bd_pin -dir O dac_xfer_out
create_bd_pin -dir I dac_fifo_bypass
ad_connect axi_ddr_cntrl/S_AXI $dac_fifo_name/axi
ad_connect axi_ddr_cntrl/ui_clk $dac_fifo_name/axi_clk
ad_connect axi_ddr_cntrl/ui_clk axi_rstgen/slowest_sync_clk
ad_connect sys_cpu_resetn axi_rstgen/ext_reset_in
ad_connect axi_rstgen/peripheral_aresetn $dac_fifo_name/axi_resetn
ad_connect axi_rstgen/peripheral_aresetn axi_ddr_cntrl/aresetn
ad_connect axi_ddr_cntrl/device_temp_i GND
create_bd_pin -dir I -type clk dma_clk
create_bd_pin -dir I dma_rvalid
create_bd_pin -dir I -from [expr ($dma_data_width-1)] -to 0 dma_rdata
create_bd_pin -dir O dma_rready
create_bd_pin -dir I dma_xfer_req
create_bd_pin -dir I dma_xfer_last
assign_bd_address [get_bd_addr_segs -of_objects [get_bd_cells axi_ddr_cntrl]]
create_bd_pin -dir O ddr_clk
set axi_ddr_cntrl [create_bd_cell -type ip -vlnv xilinx.com:ip:mig_7series:4.0 axi_ddr_cntrl]
set axi_ddr_cntrl_dir [get_property IP_DIR [get_ips [get_property CONFIG.Component_Name $axi_ddr_cntrl]]]
file copy -force $ad_hdl_dir/projects/common/zc706/zc706_plddr3_mig.prj "$axi_ddr_cntrl_dir/"
set_property -dict [list CONFIG.XML_INPUT_FILE {zc706_plddr3_mig.prj}] $axi_ddr_cntrl
set axi_rstgen [create_bd_cell -type ip -vlnv xilinx.com:ip:proc_sys_reset:5.0 axi_rstgen]
set axi_dacfifo [create_bd_cell -type ip -vlnv analog.com:user:axi_dacfifo:1.0 axi_dacfifo]
set_property -dict [list CONFIG.DAC_DATA_WIDTH $dac_data_width] $axi_dacfifo
set_property -dict [list CONFIG.DMA_DATA_WIDTH $dma_data_width] $axi_dacfifo
set_property -dict [list CONFIG.AXI_DATA_WIDTH {512}] $axi_dacfifo
set_property -dict [list CONFIG.AXI_SIZE {6}] $axi_dacfifo
set_property -dict [list CONFIG.AXI_LENGTH {15}] $axi_dacfifo
set_property -dict [list CONFIG.AXI_ADDRESS {0x80000000}] $axi_dacfifo
set_property -dict [list CONFIG.AXI_ADDRESS_LIMIT {0xa0000000}] $axi_dacfifo
## clock and reset
ad_connect sys_clk axi_ddr_cntrl/SYS_CLK
ad_connect sys_rst axi_ddr_cntrl/sys_rst
ad_connect axi_clk axi_ddr_cntrl/ui_clk
ad_connect axi_clk axi_dacfifo/axi_clk
ad_connect axi_clk axi_rstgen/slowest_sync_clk
ad_connect dma_clk axi_dacfifo/dma_clk
ad_connect ddr_clk axi_ddr_cntrl/ui_clk
ad_connect dac_clk axi_dacfifo/dac_clk
ad_connect axi_resetn axi_rstgen/peripheral_aresetn
ad_connect axi_resetn axi_dacfifo/axi_resetn
ad_connect axi_resetn axi_ddr_cntrl/aresetn
ad_connect dac_rst axi_dacfifo/dac_rst
ad_connect dac_rst axi_rstgen/ext_reset_in
## interfaces
ad_connect ddr3 axi_ddr_cntrl/DDR3
ad_connect axi_ddr_cntrl/S_AXI axi_dacfifo/axi
ad_connect dma_rvalid axi_dacfifo/dma_valid
ad_connect dma_rready axi_dacfifo/dma_ready
ad_connect dma_rdata axi_dacfifo/dma_data
ad_connect dma_xfer_req axi_dacfifo/dma_xfer_req
ad_connect dma_xfer_last axi_dacfifo/dma_xfer_last
ad_connect dac_fifo_bypass axi_dacfifo/bypass
ad_connect dac_valid axi_dacfifo/dac_valid
ad_connect dac_data axi_dacfifo/dac_data
ad_connect dac_dunf axi_dacfifo/dac_dunf
ad_connect dac_xfer_out axi_dacfifo/dac_xfer_out
ad_connect axi_ddr_cntrl/device_temp_i GND
current_bd_instance $c_instance
}