verilog这个程序的错误什么意思啊?
verilog这个程序的错误什么意思啊?module tryfunct(clk,n,result,reset);
input clk,reset;
input n;
output result;
reg result;
always @(posedge clk)
begin
if(!reset)
result<=0;
else
result<=n*factorial(n)/((n*2)+1);
end
function factorial;
input operand;
reg index;
begin
factorial=1;
for(index=2;index<=operand;index=index+1) //说这行有错
factorial=index*factorial;
end
endfunction
endmodule
Error: Verilog HDL For Statement error at tryfunct.v(18): must use only constant expressions in terminating conditions
Error: Can't elaborate top-level user hierarchy 各位大哥帮下忙吧,我检查不出了 我在自己的机子上编译了一下,通过了啊!<br>
不过看你的那上面的错误提示,好像是说for(index=2;index<=operand;index=index+1)里的operand应该换成常量,不能用变量!<br>
我也是初学者,说的不对,大家别见笑!^_^ 呵呵,我也是初级学者,我编译的提示错误是<br>
@E: CS162 :"F:\tryfunct.v":20:12:20:26|loop iteration limit 2000 exceeded - add '// synthesis loop_limit 4000' before the loop construct 呵呵 我用modelsim编译也过了 好像没什么问题啊! 用modelsim编译的话没有错误的提示,<br>
但是用Syplify综合的话会提示有错误的~<br>
<br>
[ 本帖最后由 jerryer 于 2006-7-18 09:28 编辑 ] 我是quartus ii编译的,郁闷中。 原帖由 jerryer 于 2006-7-18 09:26 发表<br>
用modelsim编译的话没有错误的提示,<br>
但是用Syplify综合的话会提示有错误的~ 废话,你写的本来就是不可综合的代码<br>
for循环不能综合 for可以综合的,while才不行的!