axi_dmac: Add validation values to IPI package

Add validation values for the different configuration parameters. This
enables the tools to check whether the configured value is valid and avoids
accidental misconfiguration.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
main
Lars-Peter Clausen 2015-09-21 15:53:54 +02:00
parent 104e49d515
commit 5b5a4707d2
2 changed files with 71 additions and 4 deletions

View File

@ -183,10 +183,71 @@ foreach port {"s_axis_user" "fifo_wr_sync"} {
set_property DRIVER_VALUE "1" [ipx::get_ports $port] set_property DRIVER_VALUE "1" [ipx::get_ports $port]
} }
set cc [ipx::current_core]
# The core does not issue narrow bursts # The core does not issue narrow bursts
foreach intf [ipx::get_bus_interfaces m_*_axi -of_objects [ipx::current_core]] { foreach intf [ipx::get_bus_interfaces m_*_axi -of_objects $cc] {
set para [ipx::add_bus_parameter SUPPORTS_NARROW_BURST $intf] set para [ipx::add_bus_parameter SUPPORTS_NARROW_BURST $intf]
set_property "VALUE" "0" $para set_property "VALUE" "0" $para
} }
ipx::save_core [ipx::current_core] set_property -dict [list \
"value_validation_type" "range_long" \
"value_validation_range_minimum" "8" \
"value_validation_range_maximum" "32" \
] \
[ipx::get_user_parameters DMA_LENGTH_WIDTH -of_objects $cc]
foreach {k v} { \
"ASYNC_CLK_REQ_SRC" "true" \
"ASYNC_CLK_SRC_DEST" "true" \
"ASYNC_CLK_DEST_REQ" "true" \
"CYCLIC" "false" \
"DMA_2D_TRANSFER" "false" \
"SYNC_TRANSFER_START" "false" \
"AXI_SLICE_SRC" "false" \
"AXI_SLICE_DEST" "false" \
} { \
set_property -dict [list \
"value_format" "bool" \
"value" $v \
] \
[ipx::get_user_parameters $k -of_objects $cc]
set_property -dict [list \
"value_format" "bool" \
"value" $v \
] \
[ipx::get_hdl_parameters $k -of_objects $cc]
}
set_property -dict [list \
"enablement_tcl_expr" "\$DMA_TYPE_SRC != 0" \
] \
[ipx::get_user_parameters SYNC_TRANSFER_START -of_objects $cc]
foreach dir {"SRC" "DEST"} {
set_property -dict [list \
"value_validation_type" "list" \
"value_validation_list" "16 32 64 128 256 512 1024" \
] \
[ipx::get_user_parameters DMA_DATA_WIDTH_${dir} -of_objects $cc]
set_property -dict [list \
"value_validation_type" "pairs" \
"value_validation_pairs" {"AXI3" "1" "AXI4" "0"} \
"enablement_tcl_expr" "\$DMA_TYPE_${dir} == 0" \
] \
[ipx::get_user_parameters DMA_AXI_PROTOCOL_${dir} -of_objects $cc]
set_property -dict [list \
"value_validation_type" "pairs" \
"value_validation_pairs" { \
"Memory-Mapped AXI" "0" \
"Streaming AXI" "1" \
"FIFO Interface" "2" \
} \
] \
[ipx::get_user_parameters DMA_TYPE_${dir} -of_objects $cc]
}
ipx::save_core $cc

View File

@ -14,8 +14,14 @@ proc init {cellpath otherInfo} {
set axi_protocol 0 set axi_protocol 0
} }
set_property "CONFIG.DMA_AXI_PROTOCOL_SRC" $axi_protocol $ip foreach dir {SRC DEST} {
set_property "CONFIG.DMA_AXI_PROTOCOL_DEST" $axi_protocol $ip # This is a bit of a hack, but we can't change the protocol if the type
# is not AXI MM
set old [get_property "CONFIG.DMA_TYPE_${dir}" $ip]
set_property "CONFIG.DMA_TYPE_${dir}" "0" $ip
set_property "CONFIG.DMA_AXI_PROTOCOL_${dir}" $axi_protocol $ip
set_property "CONFIG.DMA_TYPE_${dir}" $old $ip
}
} }
proc post_config_ip {cellpath otherinfo} { proc post_config_ip {cellpath otherinfo} {