Chip123 科技應用創新平台

 找回密碼
 申請會員

QQ登錄

只需一步,快速開始

Login

用FB帳號登入

搜索
1 2 3 4
查看: 9655|回復: 2
打印 上一主題 下一主題

[問題求助] 有關verilog 錯誤

[複製鏈接]
跳轉到指定樓層
1#
發表於 2010-12-27 13:54:47 | 只看該作者 回帖獎勵 |正序瀏覽 |閱讀模式
小弟我是新手  想把呼叫function函數改成呼叫task 但不知道是哪邊有問題會一值出現  希望高手們能幫我一下  : E1 a  \3 J3 G
我猜應該是在always和呼叫連結不起來的問題  卻不知道如何下手
! q' w5 Z) \; b) C$ d& x+ rncvlog: *W,FAAOP1 (shift.v,49|7): task or function call does not specify all formal output arguments [10.2.2][10.3(IEEE)].; T! `( [& r2 n  a6 s& B
output [7:0] mout;
. j. B, p- S# h3 N, R2 ]0 x                |
! x# g; F7 f" f% A+ R$ o* K( A, x2 Oncvlog: *W,FAAOP2 (shift.v,60|16): Formal output argument 'mout' is absent in the task or function call identified by the previous error message [10.2.2][10.3(IEEE)].% h3 h& Y7 Z& _$ ?; V
multdiv8(right,indata,mout);& e2 _9 z5 \+ r, y. r! ]1 m; Y
       |) ]' V2 e- W6 O. r( C; z
ncvlog: *W,FAAOP1 (shift.v,51|7): task or function call does not specify all formal output arguments [10.2.2][10.3(IEEE)].7 N& R9 T2 j0 r* O
output [7:0] mout;5 a" e- k6 q* x4 n" t+ C  s4 V. v
8 b0 X+ F( R' C
8 x4 M! R2 X! E+ c. \! j
原本的code:- y  J  U# d% i, d, J9 R7 x

1 P: j) A4 ~$ Gmodule shift(indata,qout,mout);) ^/ F9 }* w1 U

1 z! x7 F: [8 S1 soutput [7:0] qout;: {% b# C1 _& \3 ?: b" b- e% q% t# `
output [7:0] mout;( i. q, H/ E5 _+ u* P( R- M: q
input   [7:0]  indata;
5 U% }6 U2 }# z# w
- T2 Y2 C' w/ y: Breg [7:0] qout;5 C* m, L7 Z0 S/ z: u# r0 U5 C
reg [7:0] mout;7 O; E, |( S! D2 f4 S7 J  ]! w
parameter left=1;; f) p0 }( ~- J5 Y- X
parameter right=0;4 u% ?3 j' U5 R. X' `( B2 B- g
( M( y9 b& ~+ q( @$ r' A4 k' b8 U
always@(indata)
& ^0 u& z% i/ y+ h, X  l7 s- h) H- U+ k" [
begin9 X* @! b/ a. [& F3 J: P
5 g5 i; @) p- s3 _
mout=multdiv8 (left,indata);
* f& U; D6 @. N3 Oqout=multdiv8  (right,indata);) m1 p9 l# Z9 s6 T( N

: {7 s8 I" O2 a& Nend
6 D. {5 v5 N7 b
; m" b* p- C. ]) E* t$ V( ~$ Ifunction [7:0] multdiv8;; `/ T! N  ^- `2 H: L

0 h0 k1 y0 S* S, r" q7 K  ginput fcn_left :
6 W5 Y9 H/ P4 r9 |6 W2 _4 Iinput[7:0] fcn_in;
4 Y5 y1 c4 V$ b* x: @7 e* Pbegin
, U+ T- c5 T, N8 F8 j' b+ B- e    multdiv8=(fcn_left==1)?(fcn_in<<3): (fcn_in>>3);
( G' A! C2 P/ b( }/ |end) l9 J% A6 I; u, }; k! X% i- B' T
endfunction3 H. B! V3 @4 _: D6 n1 b1 t
( g4 y# u% c5 ^$ v
endmodule
+ x% u& k5 P; K3 i4 H2 q& i4 z9 v" O
以下是我自己寫的
1 b. ?% |7 g1 n# L, E. H' K, X: I* k1 g6 f$ V
module (qout, mout,indata);
, Z) }+ y& b9 H" u% ~. V) m  {4 m8 I% U6 p$ B, @; n% R8 J* K
output [7:0] qout;4 b- [# o5 ?, T1 }! i
output [7:0] mout;0 P# M5 m. e' y; D! C
input [7:0] indata;$ R5 z! ~/ m# ~5 Z. \
reg [7:0] qout;+ L( R' X, B. I; m( ]
reg [7:0] mout;
1 _' z9 s  z- K9 `: C6 n( w+ K$ b; _parameter left=1;
5 F* Y( ?4 P, n4 @6 Q0 ?% Iparameter right=0;; V9 Y& I8 ?0 J- F
0 D( Y+ D; q+ d( W+ B. u$ E
always@(indata) begin+ P# c6 f% s: I7 P

% u, u. L8 @" x+ Vmultdiv8 (left,indata,qout);
* b8 X$ d* y. j: |0 E9 p! qmultdiv8 (right,indata,mout);
$ z3 a9 \* O- }% ], w& M3 M: }
( ]5 ]( c2 @% x3 U6 R2 nend' f0 I$ |, S9 i) w2 U6 @

" T/ _4 _$ W8 M. Ntask multdiv8;! r" \2 k' k8 Y" B; C+ r
. u, _  x- i. a1 l1 g+ L
input fcn_left;
: p3 X' i* u4 L% c$ P& Hinput [7:0] fcn_in;
. A! i% p# g' [0 g) s- V. `. u- Toutput [7:0] qout;
3 ^+ q' ]& ?) N: S" Woutput [7:0] mout;; s6 X" o3 H0 C- u, e2 q  k

" k' |4 w) a, b5 p: p
! F) ^" g8 N* B3 ?: z  sif (fcn_left==1)# x0 c' i* d: t* n% i" M& ~
qout=fcn_in<<3;
5 s3 C+ F" o. k. Welse
$ s% s  ~4 }1 P; a* wmout=fcn_in>>3;
: G7 z5 w% a) p# f- i  I6 ~0 i$ m1 a9 F6 O
endtask
( M8 s+ m; z+ m) Uendmodule
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享分享 頂 踩 分享分享
3#
 樓主| 發表於 2010-12-29 16:34:47 | 只看該作者
我知道我問題所在了  task的port和宣告的port不一致
1 y9 n( B: Y/ u" J2 y
  f0 \1 S. I( s. J要在task後面多打qout and mout 這樣就OK了
2#
發表於 2010-12-29 13:19:41 | 只看該作者
you did not specify qout when you called the task, which is the error message tries to tell you.
您需要登錄後才可以回帖 登錄 | 申請會員

本版積分規則

首頁|手機版|Chip123 科技應用創新平台 |新契機國際商機整合股份有限公司

GMT+8, 2024-5-30 04:15 PM , Processed in 0.106013 second(s), 18 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表