Xilinx ISE 综合 for循环 integer 数组 初始化 问题(求大神指点)
时间:10-02
整理:3721RD
点击:
代码:
parameter linesize = 450;
integer i[0:63];
reg signed [15:0] SRAM [ramsize-1:0];
always @(posedge(clka) or posedge(rst))
begin
if (rst) begin
for(i[0]=linesize*2;i[0]<linesize*3;i[0]=i[0]+1)
SRAM[i[0]] = 16'd0;
end
end
问题如下:
ERROR:Xst:885 : For statement is only supported with a signal assignment to a constant in the initialization part.
ERROR:Xst:888 : For statement is only supported when the new step evaluation is an assignment to the signal used in the initialization part.
ERROR:Xst:850 : Unsupported construct.
ERROR:Xst:891 : For Statement is only supported when the new step evaluation is constant increment or decrement of the loop variable.
ERROR:Xst:872 : Unsupported target.
ERROR:Xst:850 : Unsupported construct.
求大神指点!
你把i[0]改成i再试试看,我写过类似的RAM例化语法,用synplify综合是没问题的,
先谢谢大神!
改成 i 之后是可以通过的,但是我不明白为什么不可以。
为什么呢?
可能是verilog对三维数组支持得不好,对二维数组尚可。
VHDL我以前试过三维数组,代码可写得相当简洁。
谢大神!
语法不对的, 在for是循环语句,就是要让他循环起来,这里面肯定就一个变量的,而你给的一个固定的的值是循环不起来的
