zoukankan      html  css  js  c++  java
  • 编译出错解决方法

    本文转载自网络。

    Error (10228): Verilog HDL error at test.v(1): module "test" cannot be declared more than once
    Error (10228): Verilog HDL error at beep.v(1): module "beep" cannot be declared more than once


    说明你在 setting中已经把这两个文件加进去了,已经加进去就不能再用include声明一次
    实体名和工程名要相同,一个工程可有多个模块构成,在顶层模块中调用其他模块就可
    继续追问:
    按照你说的做了 确实没有问题了 可是烧程序进去的时候 只有combine的程序烧进去了
    test 和 beep的程序还是没有烧进去
    应该怎么弄
    配置管脚的时候都没有出现test 和 beep设置的输出与输入
    想知道到底怎么样可以一起烧进FPGA中去
    补充回答: 关键你在 顶层模块 combine 中有没调用 子模块进行运用,如果只是把子模块加进来时没用的,在顶层模块中要写出子模块的输入输出(配置管脚只会出现顶层模块的管脚),并在接下来语句中进行例化配置,将双方管教匹配上


    2.Error (10170): Verilog HDL syntax error at Verilog2.v(4) near text ","; expecting "="

    哪位大虾帮帮忙
    module mux4 (A,B,C,D,sel,sum);
    input A,B,C,D,sel;
    output sum;
    assign temp1,temp2;

    always@(sel or A or B or C or D)
    begin
    temp1 = sel ? A:C;
    temp2 = sel ? B:D;
    end
    always @(temp1 or temp2)
    sum = temp1 + temp2;
    endmodule
    用quartus时报错


    答:
    什么叫assign temp1,temp2;
    明明应该是wire temp1,temp2;
    追问
    Error (10137): Verilog HDL Procedural Assignment error at Verilog2.v(10): object "temp2" on left-hand side of assignment must have a variable data type
    按你的改完之后还是编译错误啊
    回答
    失误。没仔细看。always的声明,不应该用wire,是Reg类型。你用的assign是用来wire赋值的,比如assign temp1 = temp2+2; 这个时候要把temp1声明称wire。初学时,这些个wire reg assign很容易弄不明白。也就是应该改成reg temp1,temp2;
    追问
    大虾 还是没懂啊 我已经把assign改成wire了 并不想用assign赋值,只是想声明两个中间变量而已,大虾帮忙仔细看看 如何才能编译通过 万分感谢
    回答
    .........你记住,常用的几种变量的类型是这样区分的。
    always @ ()括号里不管是时钟触发还是单个变量触发,下面的等号左边数据,统统用reg。也就是你现在这个情况,应该用reg。
    如果是assign赋值,那么等号左边的应该是wire
    还有一种就是例化的模块,你如果不懂例化迟早要碰到。例化模块的输出数据类型也要设为wire
    这些都是最最常用的

  • 相关阅读:
    pip包安装问题
    spyder中让生成的图像单独在窗口中显示
    错误的英语提示翻译 以及经常犯的无错误
    程序结构
    运算符
    js jq计算器
    jQuery筛选选择器
    jQuery获取标签信息
    javascript的getTime函数
    animate动画
  • 原文地址:https://www.cnblogs.com/qidaiymm/p/4912287.html
Copyright © 2011-2022 走看看