admin管理员组文章数量:1130349
只记载疑难杂症!!!奇奇怪怪的问题太多了,那就记个错题集吧!
1.Error (10170): Verilog HDL syntax error at mcp4822.v(18) near text: “output”; expecting “)”. Check for and fix any syntax errors that appear immediately before or at the specified keyword. The Intel FPGA Knowledge Database contains many articles with specific details on how to resolve this error. Visit the Knowledge Database at https://www.altera/support/support-resources/knowledge-base/search.html and search for this specific error message number.
这种问题要么检查上一行或者下一行的标点符号是不是中文的,要么就是另外一种了,如图:
之前我写的时候在module模块里面也可以写 clk,然后去外面写 input clk;之类的。当然也可以直接在模块中写 input clk; 但是这两种是不能混着用的,要么全在模块外定义,要么全在模块内定义!
改成这样之后,编译通过。。。
2. Error (10663): Verilog HDL Port Connection error at top.v(298): output or inout port “xxx” must be connected to a structural net expression
子模块调用到主模块要用WIRE型,不能两边都用REG,可以用wire转一下,比如子模块 output reg A ,主模块也是output reg A ,不能直接在模块调用里面写 . A (A),这样, 要先转一个中间变量,比如在主模块加一个 wire A1 ,然后 A <= A1; 模块调用里写 . A (A1), 就可以了。
3.Warning (10240): Verilog HDL Always Construct warning at J02ad5165.v(57): inferring latch(es) for variable “XXX”, which holds its previous value in one or more paths through the always construct
这个问题找了好久,去网上也查了,都没有解决,最后找了个大佬才知道是产生了latch,写代码的时候规范一点。if 。。。 else if 。。。else 一定要写全了,不然就会产生锁存器。
时序逻辑,if后面没else没事。
case,不管遍不遍历,最后写个default。
组合逻辑,最后一定得是else结尾。
if else组合可以对一个逻辑的真与假都进行定义,就是所有的情况你都描述了。
要是不写else,就会出现判断逻辑为真的时候运行,但是假的时候你没说要它干啥,他就停那不动了,等待下一个指令到来再进行工作。
时序逻辑没影响是因为来个时钟就刷新了,但鬼知道你组合逻辑的控制变量啥时候变。(大佬如是说)
只记载疑难杂症!!!奇奇怪怪的问题太多了,那就记个错题集吧!
1.Error (10170): Verilog HDL syntax error at mcp4822.v(18) near text: “output”; expecting “)”. Check for and fix any syntax errors that appear immediately before or at the specified keyword. The Intel FPGA Knowledge Database contains many articles with specific details on how to resolve this error. Visit the Knowledge Database at https://www.altera/support/support-resources/knowledge-base/search.html and search for this specific error message number.
这种问题要么检查上一行或者下一行的标点符号是不是中文的,要么就是另外一种了,如图:
之前我写的时候在module模块里面也可以写 clk,然后去外面写 input clk;之类的。当然也可以直接在模块中写 input clk; 但是这两种是不能混着用的,要么全在模块外定义,要么全在模块内定义!
改成这样之后,编译通过。。。
2. Error (10663): Verilog HDL Port Connection error at top.v(298): output or inout port “xxx” must be connected to a structural net expression
子模块调用到主模块要用WIRE型,不能两边都用REG,可以用wire转一下,比如子模块 output reg A ,主模块也是output reg A ,不能直接在模块调用里面写 . A (A),这样, 要先转一个中间变量,比如在主模块加一个 wire A1 ,然后 A <= A1; 模块调用里写 . A (A1), 就可以了。
3.Warning (10240): Verilog HDL Always Construct warning at J02ad5165.v(57): inferring latch(es) for variable “XXX”, which holds its previous value in one or more paths through the always construct
这个问题找了好久,去网上也查了,都没有解决,最后找了个大佬才知道是产生了latch,写代码的时候规范一点。if 。。。 else if 。。。else 一定要写全了,不然就会产生锁存器。
时序逻辑,if后面没else没事。
case,不管遍不遍历,最后写个default。
组合逻辑,最后一定得是else结尾。
if else组合可以对一个逻辑的真与假都进行定义,就是所有的情况你都描述了。
要是不写else,就会出现判断逻辑为真的时候运行,但是假的时候你没说要它干啥,他就停那不动了,等待下一个指令到来再进行工作。
时序逻辑没影响是因为来个时钟就刷新了,但鬼知道你组合逻辑的控制变量啥时候变。(大佬如是说)
本文标签: 疑难杂症
版权声明:本文标题:只记载疑难杂症!!! 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/jiaocheng/1754579510a2703910.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论