error原因 当我们把变量声明在这里时: 编译会报下面的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. 解决方法 将变量声明放在function 和 task 的首行。如下: