diff --git a/library/axi_dmac/bd/bd.tcl b/library/axi_dmac/bd/bd.tcl index dd5eb2bfb..d32d55afa 100644 --- a/library/axi_dmac/bd/bd.tcl +++ b/library/axi_dmac/bd/bd.tcl @@ -18,6 +18,36 @@ proc init {cellpath otherInfo} { set_property "CONFIG.DMA_AXI_PROTOCOL_DEST" $axi_protocol $ip } +proc post_config_ip {cellpath otherinfo} { + set ip [get_bd_cells $cellpath] + + # Update AXI interface properties according to configuration + set max_bytes_per_burst [get_property "CONFIG.MAX_BYTES_PER_BURST" $ip] + set fifo_size [get_property "CONFIG.FIFO_SIZE" $ip] + + foreach dir {"SRC" "DEST"} { + set type [get_property "CONFIG.DMA_TYPE_$dir" $ip] + if {$type != 0} { + continue + } + + set data_width [get_property "CONFIG.DMA_DATA_WIDTH_$dir" $ip] + set max_beats_per_burst [expr {int(ceil($max_bytes_per_burst * 8.0 / $data_width))}] + + set intf [get_bd_intf_pins [format "%s/m_%s_axi" $cellpath [string tolower $dir]]] + set_property CONFIG.MAX_BURST_LENGTH $max_beats_per_burst $intf + + # The core issues as many requests as the amount of data the FIFO can hold + if {$dir == "SRC"} { + set_property CONFIG.NUM_WRITE_OUTSTANDING 0 $intf + set_property CONFIG.NUM_READ_OUTSTANDING $fifo_size $intf + } else { + set_property CONFIG.NUM_WRITE_OUTSTANDING $fifo_size $intf + set_property CONFIG.NUM_READ_OUTSTANDING 0 $intf + } + } +} + proc axi_dmac_detect_async_clk { cellpath ip param_name clk_a clk_b } { set param_src [get_property "CONFIG.$param_name.VALUE_SRC" $ip] if {[string equal $param_src "USER"]} {