Range must be bounded by constant expressions.
报错原因:for循环中axi_wdata[31:0] <= data[32*(i+1) : 32*i];
解决办法:axi_wdata[31:0] <= data[31: 0];
data <= data>>32;
逻辑右移>>
算术右移>>
另外在Verilog-2001中,可以用变量作为index,进行部分数据选择。具体操作为:
[base_expr +: width_expr] //positive offset
[base_expr -: width_expr] //negative offset
其中base_expr可以是变量,而width_expr必须是常量。+:表示由base_expr向上增长width_expr位,-:表示由base_expr向下递减width_expr位。
而在Verilog-1995中,选择部分位进行输出时,前后index位必须是常量。
参考:
https://blog.csdn.net/u013701860/article/details/52317614