Chip123 科技應用創新平台

 找回密碼
 申請會員

QQ登錄

只需一步,快速開始

Login

用FB帳號登入

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

[問題求助] 有關verilog 錯誤

[複製鏈接]
跳轉到指定樓層
1#
發表於 2010-12-27 13:54:47 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
小弟我是新手  想把呼叫function函數改成呼叫task 但不知道是哪邊有問題會一值出現  希望高手們能幫我一下  ' t) l6 ^% V. S* C2 K* D2 K
我猜應該是在always和呼叫連結不起來的問題  卻不知道如何下手
4 x$ D4 V& \' o$ r3 f, u4 ?6 encvlog: *W,FAAOP1 (shift.v,49|7): task or function call does not specify all formal output arguments [10.2.2][10.3(IEEE)].- d0 v' d0 X! u5 B3 X) x2 @! J
output [7:0] mout;
* f8 z1 e: T1 ~7 \8 m) \+ C9 _                |; y$ O7 z) |+ z# ]6 X* i+ B) S/ l
ncvlog: *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)].
6 I9 l% ^) E8 Ymultdiv8(right,indata,mout);: T# [$ |" F6 F/ v6 I0 l1 y
       |& U# h* T4 X3 ]( w4 s4 U& s
ncvlog: *W,FAAOP1 (shift.v,51|7): task or function call does not specify all formal output arguments [10.2.2][10.3(IEEE)].& ]- [: }9 o# s" P; S# O2 o
output [7:0] mout;
; [" z  i  ]% D
1 S. G- Q6 D1 Y8 V% C7 f: }0 J+ u3 x4 |0 k' g/ h, E) Z
原本的code:1 b; i1 p0 L, }

* M3 x: G& m( n2 w0 S+ `  i7 t+ Bmodule shift(indata,qout,mout);( s7 c/ M' k1 Q. l, m$ N$ a
6 W' w$ {" s& s. g) X
output [7:0] qout;
, C# W! N- ^* l0 x* Woutput [7:0] mout;/ n( W  \6 |4 J5 S+ A
input   [7:0]  indata;' w. p$ `5 d0 j
* Z: y/ a2 F% d, S2 P/ B
reg [7:0] qout;/ Z) U3 S9 V4 A9 _* S: f, T
reg [7:0] mout;. c6 s# i5 G1 `; f7 c: z# k' O2 x
parameter left=1;) [; r; L, S/ Z. B6 ?4 E
parameter right=0;/ n5 n/ A3 T: q- @4 ]

, a8 ^/ E# c% r5 u# z, falways@(indata). V% A- d4 a3 {* L3 d: |% N) I' H/ ~* ?

3 W3 e3 ^. m2 ?begin
1 d: k0 s) `! N2 B7 m2 }$ ]
8 Z1 Z2 l; z. K% V9 I- o9 amout=multdiv8 (left,indata);; _1 z7 b8 ?, S& w0 U
qout=multdiv8  (right,indata);1 R" i0 w: M* O( u5 O

: [  ]* n: q. B, F+ Eend" j. J, H9 }- P5 m

, o, B/ g" s  ^1 ~7 r. Z7 o( H# ~3 [function [7:0] multdiv8;
! f- z+ w% U" U: f3 E) n- E/ U/ v) A6 m# _
input fcn_left :4 [' ?* ~1 K  a) j
input[7:0] fcn_in;
: S8 D# Q. `; D5 mbegin
2 A+ f" {( V7 o. p7 i( X    multdiv8=(fcn_left==1)?(fcn_in<<3): (fcn_in>>3);' i# V- O% V! t& D6 x! s& C
end4 e. t# G' ]( A
endfunction
4 j8 J% k/ w$ M' r# f# \' R& l6 y& z$ s( b) F: @
endmodule/ V0 L6 l5 |& B& y
! o: D, s/ b5 l4 s; x: A; z
以下是我自己寫的
( P+ D' r, o% v+ `- P- ~: A5 j0 A" a+ F( m& j9 m! t
module (qout, mout,indata);
+ v  o+ E% x2 S) d$ a. R# j) i5 m7 S, R2 S
output [7:0] qout;
: T8 e: R1 Z  J/ u9 x$ V% foutput [7:0] mout;8 H' @9 s* r% T9 z6 V2 a
input [7:0] indata;  l" V) N4 x6 R& P9 d7 E
reg [7:0] qout;
) O1 w- c: _5 wreg [7:0] mout;
2 }5 y0 R, I9 p/ `2 }& Yparameter left=1;
, U) L. w: h% g7 S; Y5 T, c% f( Vparameter right=0;' r0 J, x" y0 Y  K. i

9 s4 c- W( N2 Malways@(indata) begin
  _; q8 l( L: }& _# ]2 _. S4 @+ X6 D# ~% D$ J7 {. N: b1 K
multdiv8 (left,indata,qout);1 M7 E/ |( t, _& L# d% Q
multdiv8 (right,indata,mout);
1 Z; H, v0 H! h2 u, F# @2 T0 b" t  r8 |: q- w) m! O
end& b2 e) P! @+ i9 P. [

# v( b8 O# S. V3 \task multdiv8;) j# R3 e5 @' I- {. J
/ |" E9 |( O5 A* U/ G
input fcn_left;- @$ \% p7 p6 C9 R( [7 ?8 T
input [7:0] fcn_in;
/ x$ g) z+ u4 {  U7 F7 qoutput [7:0] qout;9 e: H  o: l+ ~
output [7:0] mout;- `) `* h4 u8 C( ]

1 x2 Y% M: C$ P, M) x
- u2 z8 W5 _% yif (fcn_left==1)7 t; _& Y' y5 R) ]* U/ n4 u& p
qout=fcn_in<<3;
0 K+ W" {% Q+ N. @' ^0 eelse
- A4 J6 t9 Y. W  G. smout=fcn_in>>3;
; u' T' ~$ k% U1 C! y* _0 a( T: B' l: M; b) q: f) i) |
endtask
+ U/ q# R) _" I3 W' U# l4 r" n+ b$ Zendmodule
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享分享 頂 踩 分享分享
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.
3#
 樓主| 發表於 2010-12-29 16:34:47 | 只看該作者
我知道我問題所在了  task的port和宣告的port不一致5 H( e4 r% o4 d/ j; n; p

2 t; d& M3 q2 ~7 W. H& a要在task後面多打qout and mout 這樣就OK了
您需要登錄後才可以回帖 登錄 | 申請會員

本版積分規則

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

GMT+8, 2024-6-8 07:00 AM , Processed in 0.125016 second(s), 17 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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