|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
为什么我用Verilog HDL语言在 Quartus II 里加上'timescale 10ns/1ns 会提示出错 Error: Verilog HDL syntax error at mult_tp.v(3) near text ': Q2 `; `& n2 A6 W7 f% z
Error: Verilog HDL syntax error at mult_tp.v(3) near text "'"; expecting "module", or "macromodule", or "primitive", or "(*", or "config", or "include", or "library"0 Y/ F) i) x2 E5 x% ]
Error: Ignored module "mult_tp" at mult_tp.v(4) because of previous errors% z" O. [7 u- m4 R, o' D% i
Error: Ignored module "mult8" at mult_tp.v(21) because of previous errors$ h6 X& p1 q0 j0 R
源程序是这样的,
8 y" i& H4 \, i P'timescale 10ns/1ns
9 _# u9 n) n% q& y& f$ \) ]. a. y0 Amodule mult_tp;. U8 B, a6 J7 k3 ? @* e, K
reg[7:0] a,b;3 z+ o- `+ c, D. K1 U8 f
wire[15:0] out;
9 P3 d# m) K2 J' |/ t, zinteger i,j;
6 L* V! `2 O( e% F- i1 x3 mmult8 m1(out,a,b);
- Z( s3 ^! l( G- ?# \5 |initial begin , S, L' _2 g) [5 C: X
a=0;b=0;" `' L9 B! K! E. Q4 G i- |! C
for(i=1;i<255;i=i+1) #10 a=i;
4 C3 a2 |. y0 h' m, kend8 v! s9 F. j& M9 y9 m2 [4 U
initial begin
4 }3 h1 y! q; v9 `6 T+ U/ O! d for(j=i;j<255;j=j+1) #10 b=j;8 l( j* P: z. M+ e1 s
end
5 P# F/ n3 e9 S. E; e6 n4 L; U cinitial begin
: {1 }# R3 x, l4 P; m9 c $monitor($time,,,"%d*%d=%d",a,b,out);$ X' }0 B ?/ Y2 C
#2560 $finish;
& p l ]% ?" w; C" V$ O" y end
1 A% E" s$ n9 J6 Z# o# Jendmodule
( Y, [" E- W+ P# ` Nmodule mult8(out,a,b);
4 p& g! L& P" ^: K- [# q7 kparameter size=8;9 y4 D v" V9 y2 r
input[size:1] a,b;6 ~5 Q; \8 C; B& S: ~# m( M) h
output[2*size:1] out;
. `2 G5 p, D* U6 h. qassign out=a*b;# u v3 M: n2 Q1 G" o1 q
endmodule
; [/ u' u" x) b0 K2 {' D请问还需要设置什么吗?时序和功能仿真都有错。 |
|