|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
本人新手,下面是一Verilog HDL程序代码,为什么总是编译不成功啊,恳请知道的帮助解决一下啊,
/ L Z9 B5 E+ W5 K. ?; jmodule ihq_counte(rst,clk,ihq_control,ia,ib,ic,iap,ibp,icp,iahq,ibhq,ichq);/ i0 P6 F, b3 t+ T
input rst;) _0 ~& _, V* t7 R; E: x7 b( j
input clk,ihq_control;
0 k( O+ o' y1 H7 pinput[15:0]ia;( O, B; o' b7 h* \% \
input[15:0]ib;
+ `7 k y+ v. @8 _# ]input[15:0]ic;
! k4 x( ^. l+ Q0 K( S7 Zinput[15:0]iap;
3 `0 ~3 C' J6 ?: O0 hinput[15:0]ibp;" @% ^0 r( _5 b# H" l: e4 e' G- Q
input[15:0]icp;' W7 c0 R" e& x
output[15:0]iahq;
0 N: Q9 A' j4 j3 ^. P' u$ ioutput[15:0]ibhq;( a2 `" I; M4 K* h5 `5 N
output[15:0]ichq;
( {3 B* q( R1 I- breg signed[15:0]a1,a2,a3,bl,b2,b3,cl,c2,c3,iahq,ibhq,ichq,iahq1,ibhq1,ichq1;2 i, @; {! o% L; V3 _) V
always @(posedge rst or posedge ihq_control)
7 i9 s. y1 d3 n5 W; n p" H! Cif(rst)
5 N" \ k4 H$ m, ?1 n; w- N6 E& _4 Cbegin
4 P/ N" y: _/ E! C% liahql=0;( @! v5 q& P A* c
ibhql=0;- j; e1 C1 a ^# B$ m4 J I z
ichql=0;- C- M1 T( s9 P- h9 k
end
7 [/ T$ K0 G# velse if(clk)
$ } w+ p9 G6 b9 V3 Y0 {, M( A; ibegin
& _9 X4 Q) v% I2 H |iahq=ihaql;% x; ?8 ?6 a. h6 Q& r
ibhq=ibhql;
9 [3 d% W4 r' R/ ^ F: w" Bichq=ichql;
q) g: p3 R" \end
+ l: w, e" C$ {else ' M8 U% l& O3 B4 k0 A. w0 ]
& a- G5 I8 S) Zbegin1 z$ O* u; T( M
if(ia[11]==0)al=ia;
K' c4 p9 f- c9 u0 S4 Yelse% h5 n6 G# U `
begin
3 F; _% _3 D2 v) r( M9 `al=ia;
! d% t( a" a6 ] ~! z' B% {a1[15:12]=15;* z+ S+ m% w. g1 @% P; _7 ^
end
U1 s) U1 r% _$ pa2=iap;' _7 }3 J, o* w4 D
if(a2>0)a2=a2>>3;
& N& {. [% z) b# U5 k y6 n4 T1 Uelse
9 l) `$ G+ K2 S5 `begin
' G3 e) p0 t. ^4 `( Pa2=a2>>3;
) k2 a# `4 I( f0 s% m9 E2 ka2[15:13]=7;0 Q) o$ q" F, v2 P0 s, F9 F0 T7 ?
end
B% ]7 N1 ~ Rif(ib[11]==0)b1=ib;
, |& V* }& o) E5 Zelse3 {' o7 { q7 k6 j" P
begin$ u; R% P( A* k. C# \: U
bl=ib;
& h; C, h- z8 e4 Z) C) y1 V2 mbl[15:12]=15;
; v" S% T: b# a3 c; W4 v: v* g2 ~0 S! Eend3 Y$ G1 D' D- X0 Y; `
b2=ibp;
% H" M" g1 ~) C0 K5 p5 n/ ~5 oif(b2>0)b2=b2>>3;' E, Z! L2 |) L* w) D& f
else y+ F. q% E$ [7 R! Y
begin( {7 J- l: h2 B8 L# ?
b2=b2>>3;
4 x! r* T$ }5 N& X5 Q/ a+ `b2[15:13]=7;
[$ B2 G `( V" e. U) X* Xend: l# C' O* K" S) Y
if(ic[11]==0)cl=ic;9 V. [ _4 u& @7 ?
else2 ~2 W# H1 V& g7 v9 e( r8 E- J& A
begin" p1 S9 ?2 g: w/ K
cl=ic;, a" y' v/ i- a
cl[15:12]=15;
. ^) w0 X/ @. V2 A! } Rend
9 Y5 M2 V* u" k% p9 Cc2=icp;+ [( V3 u+ C2 D' K7 {
if(c2>0)c2=c2>>3;
. i! P/ M5 r$ M2 A% kelse8 v' Z0 l% w' k
begin- d( G* ~3 p) V {
c2=c2>>3;' q0 _9 l1 w9 j- ]8 O* x, N3 m1 X0 l
c2[15:13]=7; C6 e- D. q. g2 f& T
end
0 f4 _! }& q% p' Z% ^a3=al-a2;
! F. I, Y! M1 Q5 y s# Y7 jb3=bl-b2; B7 x8 F8 }2 q& M% L. `( G
c3=cl-c2;. b4 `4 p& l% ~, k) P
iahql=a3;0 y& C p3 D, R
ibhql=b3;
2 v2 c# G) l" ^$ Hichql=c3;! B/ A. {* W6 q! _+ i/ v5 Y
end1 ] N3 A: N3 Q7 b
endmodule |
|