|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
为什么我用Verilog HDL语言在 Quartus II 里加上'timescale 10ns/1ns 会提示出错 Error: Verilog HDL syntax error at mult_tp.v(3) near text '- S& l, `: `* h2 ] Y6 s4 q: {. ?
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"
, u, N9 e" N% O$ EError: Ignored module "mult_tp" at mult_tp.v(4) because of previous errors
5 R5 t% e" r9 ]. N: NError: Ignored module "mult8" at mult_tp.v(21) because of previous errors8 Y( M2 J$ {! x$ v- E" `8 F
源程序是这样的,
+ K2 {6 e& o( A; F5 W'timescale 10ns/1ns, N* S6 a4 F) p0 O. j% B' J2 V$ Q
module mult_tp;& T2 E% {! M+ u1 G2 o# D. {
reg[7:0] a,b;
; M" j# ^5 S2 e3 w# Z# a! Y0 rwire[15:0] out;* D2 u% } T2 b E$ ^
integer i,j;; Z6 e0 j. H3 D3 n" z8 V$ _
mult8 m1(out,a,b);
3 W& m$ N) U9 u# b& S$ {! ]initial begin ) A! x/ @ K% q2 o
a=0;b=0;
( z2 N; p X1 N9 }3 Y for(i=1;i<255;i=i+1) #10 a=i;0 k$ g8 o5 q* X L9 J9 @3 ~
end
4 b9 P. h+ L8 c2 d1 e4 N' |) w1 Pinitial begin
" P1 a n2 B& f2 Q for(j=i;j<255;j=j+1) #10 b=j;3 Y1 n' ?: A$ ]9 I( U9 X* S2 l
end7 n4 L) P8 r: j
initial begin
: c4 P. h9 |8 [) O$ A6 Q $monitor($time,,,"%d*%d=%d",a,b,out);0 {1 K) O! t; `7 M/ H2 A6 u
#2560 $finish;
& A+ n7 @: M" k( ^9 N; A, r end+ `7 j7 w2 p( N; c
endmodule3 K. I) M' }/ @8 P7 D
module mult8(out,a,b);
& ^+ s, h7 @+ xparameter size=8; X; V( O7 y" {; v( n) q- [, Y
input[size:1] a,b;$ l ~8 o8 T& U. q# x
output[2*size:1] out;
+ h. m1 }/ k# M. }' {5 \& Y2 Jassign out=a*b;# M, g$ z* }" i
endmodule6 J6 r1 x" j: R( `# y
请问还需要设置什么吗?时序和功能仿真都有错。 |
|