集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 1944|回复: 0

verilog调用函数出现问题,求高手帮忙

[复制链接]
polozpt 发表于 2011-3-27 12:19:01 | 显示全部楼层 |阅读模式
module yunsuan1(clk,n,result,reset);
input clk,reset;
input [3:0] n;
output [31:0] result;
reg [31:0] result;
always@(posedge clk) begin
if(!reset)
begin
result<=0;
end
else
begin
   result<=myfouc(n);
   end
  end
function [31:0] myfouc;
input [3:0] ina;
reg [3:0] temp;
begin
  myfouc=ina?1:0;//if ina!=0,myfouc=1;
  //for(temp=2;temp<=ina;temp=temp+1)
  //myfouc=temp*myfouc;
  temp=2;
  while(temp<=ina)
  begin
  myfouc=temp*myfouc;
  temp=temp+1;
  end
end
endfunction
endmodule
编译时会出现 Error (10119): Verilog HDL Loop Statement error at yunsuan1.v(24): loop with non-constant loop condition must terminate within 250 iterations
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|fpga论坛|fpga设计论坛 ( 京ICP备20003123号-1 )

GMT+8, 2025-6-22 15:01 , Processed in 0.078819 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表