Naples 发表于 2010-11-8 21:03:12

新手求助!不能综合的时候怎么编译文件?

书上例子:
/*********************************************************

          阶乘函数的定义和调用
                  
*********************************************************/
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
出现了错误,意思就是没有输入输入的错误。这种不能被综合的文件请问怎么编译才行?

weibode01 发表于 2010-11-12 07:50:55

这个不懂,看一下书或坐等高手了。。。高手哪去了

njithjw 发表于 2010-11-13 18:22:30

使用modelsim编译一下就可以了。

weibode01 发表于 2010-11-13 18:56:42

楼主试一下

miwueshine 发表于 2011-1-18 13:31:52

使用modelsim可以编译
页: [1]
查看完整版本: 新手求助!不能综合的时候怎么编译文件?