axi_dmac: fix address width detection

The round function from tcl is a rounding to nearest. Using it in address
width calculation produces incorrect values.
e.g.
 round(log(0xAF000000)/log(2)) will produce 31 instead of 32

The fix is to replace the rounding function with ceiling that guarantees
rounding up.
main
Laszlo Nagy 2018-07-20 07:44:04 +01:00 committed by Laszlo Nagy
parent 235636a337
commit 4d8008e64c
1 changed files with 1 additions and 1 deletions

View File

@ -149,7 +149,7 @@ proc post_propagate {cellpath otherinfo} {
foreach addr_seg $addr_segs {
set range [get_property "range" $addr_seg]
set offset [get_property "offset" $addr_seg]
set addr_width [expr max(round(log($range + $offset) / log(2)), $addr_width)]
set addr_width [expr max(int(ceil(log($range - 1 + $offset) / log(2))), $addr_width)]
}
} else {
set addr_width 32