本文介绍了在Verilog编程中遇到的错误,特别是在声明变量时出现的问题。错误提示为'Illegal declaration after the statement near line 90. Declarations must precede statements. Look for stray semicolons.' 解决方案是在function或task的首行进行变量声明,以避免语法错误。
当我们把变量声明在这里时: 编译会报下面的error: ** at /home/verifier/project/ahb2apb/dv/vip/user_ahb_mst/ahb_transfer.sv(93): Illegal declaration after the statement near line ‘90’. Declarations must precede statements. Look for stray semicolons.