axi_dmac: Configure AXI master bus properties according to core configuration

Configure the maximum burst size as well as the maximum number of active
requests on the AXI master interfaces according to the core configuration.
This allows connected slaves to know what kind of requests to expect and
allows them to configure themselves accordingly.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
main
Lars-Peter Clausen 2015-09-18 11:46:44 +02:00
parent 12fc6d1672
commit 4c51224696
1 changed files with 30 additions and 0 deletions

View File

@ -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"]} {