|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
为什么我用Verilog HDL语言在 Quartus II 里加上'timescale 10ns/1ns 会提示出错 Error: Verilog HDL syntax error at mult_tp.v(3) near text '
9 M8 p' v4 a' {8 `! l; CError: Verilog HDL syntax error at mult_tp.v(3) near text "'"; expecting "module", or "macromodule", or "primitive", or "(*", or "config", or "include", or "library"2 z. X7 M2 I% r+ C
Error: Ignored module "mult_tp" at mult_tp.v(4) because of previous errors
+ L$ p9 E0 e+ s" x4 QError: Ignored module "mult8" at mult_tp.v(21) because of previous errors
, V7 K3 O: B8 ^- S+ r源程序是这样的,) }8 I A& H/ p, _
'timescale 10ns/1ns
+ U( d: ^, E* F7 G* ^module mult_tp;
4 R6 K1 `0 k: p; N( a; `/ K* x7 Xreg[7:0] a,b;% `( i& M ^8 R0 \$ |
wire[15:0] out;
+ K: E% N2 Y! ?6 R2 Z& {integer i,j;
+ S6 o4 X* g4 l# ?mult8 m1(out,a,b);
( u9 i% Y/ s4 X+ ]6 Uinitial begin
+ ~7 q' d$ s% J5 Y% K a=0;b=0;
9 x E5 s1 T) ~3 H% [# f for(i=1;i<255;i=i+1) #10 a=i;
. K9 t8 ?% J% ~7 k5 s4 Q7 send
' q F/ [/ ] F- sinitial begin3 z6 }2 @4 n& b- p: s
for(j=i;j<255;j=j+1) #10 b=j;9 g# \6 N7 P7 ~) r$ f! `
end
: r( Q* ^0 e9 r7 ~7 x/ ?7 ainitial begin
8 j: y R3 C# h0 N0 B1 z9 \0 Q) g" K $monitor($time,,,"%d*%d=%d",a,b,out);
0 @, x) S8 X% ? {- l #2560 $finish;
' S6 {8 Y1 Q" {# B8 s F7 W end }+ x1 a' q5 P# b$ \& ^/ c4 n
endmodule
. ?, ?- x( Y# Z$ d6 a# u0 Emodule mult8(out,a,b);
. z! z9 k) N" R( i. B/ e. T" Bparameter size=8;& M( k B9 J) O0 h6 l
input[size:1] a,b;
9 m" \' x7 e' q5 ? g; goutput[2*size:1] out;
b& L0 Q% c) B" Gassign out=a*b;" g: y! Z% g3 V$ W: m6 G4 Z6 P' |
endmodule
( i( x8 E' n/ S& T: Y0 i7 o- U请问还需要设置什么吗?时序和功能仿真都有错。 |
|