新手求助!不能综合的时候怎么编译文件?
书上例子:/*********************************************************
阶乘函数的定义和调用
*********************************************************/
module tryfact;
//函数的定义
function factorial;
input operand;
reg index;
begin
factorial = 1; //0的阶乘为1,1的阶乘也为1
for(index = 2; index <= operand; index = index + 1)
factorial = index * factorial;
end
endfunction
//函数的测试
reg result;
reg n;
initial
begin
result = 1;
for(n = 2; n <= 9; n = n + 1)
begin
$display("Partial result n = %d result = %d", n, result);
result = n * factorial(n) / ((n * 2) + 1);
end
$display("Finalresult = %d", result);
end
endmodule
出现了错误,意思就是没有输入输入的错误。这种不能被综合的文件请问怎么编译才行? 这个不懂,看一下书或坐等高手了。。。高手哪去了 使用modelsim编译一下就可以了。 楼主试一下 使用modelsim可以编译
页:
[1]
