|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
为什么我用Verilog HDL语言在 Quartus II 里加上'timescale 10ns/1ns 会提示出错 Error: Verilog HDL syntax error at mult_tp.v(3) near text '
5 A2 K2 x" N9 Z* ?2 s. PError: Verilog HDL syntax error at mult_tp.v(3) near text "'"; expecting "module", or "macromodule", or "primitive", or "(*", or "config", or "include", or "library"3 k/ n5 x2 w1 H2 v3 D
Error: Ignored module "mult_tp" at mult_tp.v(4) because of previous errors9 c6 @& q8 e: ~+ P2 B
Error: Ignored module "mult8" at mult_tp.v(21) because of previous errors: o9 }6 q- m8 V4 x$ h" e
源程序是这样的,
M7 }. g% p: [) t# s'timescale 10ns/1ns! ?" C6 |% }, }, h1 J* b! h& O
module mult_tp;1 z' ]3 [ E3 m2 V$ B F
reg[7:0] a,b;
& t6 z/ F. q$ C" h: r2 X' fwire[15:0] out;
- |. \2 w) k# o0 `' @integer i,j;
& C b5 l0 r: gmult8 m1(out,a,b);- ?- v- }2 E3 E6 H$ i4 L7 L0 a, e% {
initial begin
* d* r3 d/ `& V2 Y1 y; s9 z a=0;b=0; a( k/ f; v3 o+ }0 t1 {* H/ L
for(i=1;i<255;i=i+1) #10 a=i;( f* ^- a# N6 t
end! ?/ e! e% W g
initial begin' B+ k% ?) _8 ~7 y
for(j=i;j<255;j=j+1) #10 b=j;6 E `$ v4 W( @8 L( ?) h
end
5 S9 y7 [& c ~* D6 Xinitial begin
' d& \9 G: V! Z( C- i9 `8 q $monitor($time,,,"%d*%d=%d",a,b,out);) }; r8 v2 d) b g% r0 U, @' h
#2560 $finish;# c% n |/ B1 o: a+ R
end
- F& V+ c5 D. R4 j% Vendmodule
- m" a4 F, s1 H- s: }module mult8(out,a,b);
! y8 D- w1 x' Hparameter size=8;
, X5 Z; U) A0 u$ v0 Z, K0 T. H5 N' jinput[size:1] a,b;
7 f- ^9 q( T. x: X) c( ooutput[2*size:1] out;
! n$ d: y) V) N. s6 _; rassign out=a*b;
6 I& |2 a, }* O4 V; rendmodule6 I1 ?+ [. L9 L9 ?, W. X
请问还需要设置什么吗?时序和功能仿真都有错。 |
|