Chip123 科技應用創新平台

 找回密碼
 申請會員

QQ登錄

只需一步,快速開始

Login

用FB帳號登入

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

[問題求助] 有關verilog 錯誤

[複製鏈接]
跳轉到指定樓層
1#
發表於 2010-12-27 13:54:47 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
小弟我是新手  想把呼叫function函數改成呼叫task 但不知道是哪邊有問題會一值出現  希望高手們能幫我一下  
. e+ ], O- w0 y' j# B8 [9 P% f  y我猜應該是在always和呼叫連結不起來的問題  卻不知道如何下手# G2 |" @% N0 T( k6 G
ncvlog: *W,FAAOP1 (shift.v,49|7): task or function call does not specify all formal output arguments [10.2.2][10.3(IEEE)].2 G, Q" _% ]7 L( a
output [7:0] mout;
& y& X- W( g, e( g4 r                |6 ]+ @3 s8 D$ F% `
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)].
$ l* v- G7 d( Y% Mmultdiv8(right,indata,mout);4 l7 u4 a) B) {% l2 e7 n: P
       |
; I* s1 q# I) `: W) g/ dncvlog: *W,FAAOP1 (shift.v,51|7): task or function call does not specify all formal output arguments [10.2.2][10.3(IEEE)].
( S# o! [. v8 x" U/ U6 ~$ loutput [7:0] mout;* A8 Y/ l& c3 Q! b

0 w4 v8 v& q) q: Z9 |6 U2 S1 ~2 A0 D3 \
原本的code:
$ x8 t( w" r9 s6 w9 X; d
) L: m2 c4 A+ k+ c$ @module shift(indata,qout,mout);6 n( V6 w$ Q; A1 N; S. J& s1 {( M
7 @$ I1 i- T1 c5 z5 q1 d
output [7:0] qout;- Y: Z4 M! Q( a% M
output [7:0] mout;
3 d! {2 `) O/ E9 Einput   [7:0]  indata;8 B) H8 |6 {9 ]  {1 H
  l! J) ^( I. b; ^4 L  }9 s
reg [7:0] qout;8 p( x* V' c( x+ w! i7 u3 u  y
reg [7:0] mout;
4 v- z) D6 i( |7 x5 d- K& [8 K2 Wparameter left=1;& n& `( J; r; d; _+ f0 \) D
parameter right=0;
& z) K% o) a3 f3 P: A! x, C0 R5 X* ], z- k" i* E! K, C
always@(indata)
) n' a; l% [  [# ?) F9 e, _- Z6 m! b# c6 S& }, ]3 z
begin
1 y/ W( {. g. |) V" I; b7 e/ C0 P6 D7 k
mout=multdiv8 (left,indata);
1 i" [$ T$ z, ?# b' Hqout=multdiv8  (right,indata);
4 T. w& @. o  i* c' X1 F: i  t& ~6 }, S9 p4 C" R* X( E5 K
end
: }2 l( O) p) U- h/ |7 w5 y
% P: P# u: y) y" l- g2 o% Ufunction [7:0] multdiv8;
7 {5 {+ p3 o  j) }) Z# Z) Y$ W9 J3 P. P) k% M  X& v* O5 w% @
input fcn_left :+ E0 o* c$ j, O( V
input[7:0] fcn_in;% A% E: {' ~* [- F
begin" u. L1 J( F# _: k+ ~- Z
    multdiv8=(fcn_left==1)?(fcn_in<<3): (fcn_in>>3);
% F8 I4 S0 O5 ?( ?: u% t/ @( hend5 |2 ]4 i% y9 G! D
endfunction
, R% Q, G: Z6 b' r$ q' c4 I2 z5 v+ _2 f8 L. s, m0 b9 c
endmodule
' h- Q4 d4 D, ~* l3 i" O; G7 M: Z9 p8 Y/ p( R. c- w
以下是我自己寫的
5 c& h  L1 T$ \: ?. g; B
! J+ |! ]. B7 |# mmodule (qout, mout,indata);$ d8 }. n" O. r: ]0 P9 \
6 g+ @5 o" Z  `/ W3 b
output [7:0] qout;
. C3 M" b2 Y9 H+ i- D) h/ Doutput [7:0] mout;
( c! O, K% \8 a. ~5 hinput [7:0] indata;
5 s% D. C8 L3 }: m# ]. W1 Vreg [7:0] qout;: T  g* M6 V& h! B# T( O$ \
reg [7:0] mout;1 V: P; d& o0 C4 e
parameter left=1;
9 Y3 N3 P( [& [8 o$ hparameter right=0;
3 z8 `! H4 c( a, [& g4 ]$ S. G, i  |* y/ O, s  E: k7 Z
always@(indata) begin" o5 e+ {# i6 _  j

! n* M. V$ w. ]: O0 [multdiv8 (left,indata,qout);
6 c1 I3 R; z8 E+ y* j: D9 D" J0 ]multdiv8 (right,indata,mout);) H+ ?# n  l# |7 F1 q0 b! U' h; J

7 ?: U1 R* M' ?! F7 Xend
0 p( e$ j; ~5 Z7 o" I# k9 ]3 j1 K7 l0 j/ W4 D& b# V6 O9 q4 M  E
task multdiv8;
  v( j; h( }9 j( b# A  v
  c9 U: [) B- L  d/ Linput fcn_left;0 g8 ?" I) H- q+ S
input [7:0] fcn_in;
! k4 u. e$ R. d- s* {( {# koutput [7:0] qout;
' j' ^1 V  f+ E& ^output [7:0] mout;
- |8 T% n, P, B" Y# G! K% c: }1 x( l% y1 H

& r" U& P) O) x* y# {if (fcn_left==1)
! ?* H8 u" j" [  N; T" Y5 H2 L/ m; nqout=fcn_in<<3;
; E2 R0 D5 G. Q, Q5 N0 y- H% Jelse
9 r3 m/ s& ~+ R2 gmout=fcn_in>>3;
5 y5 i; R# Z; e  C5 Z/ h& k5 D4 r, Q& n7 I2 ]2 Y6 o6 x1 }
endtask ( z" ~1 y" T; {& X
endmodule
分享到:  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不一致0 b9 m+ i, C- F6 ~' F, V4 _

- M. o$ K! [) G0 m! X要在task後面多打qout and mout 這樣就OK了
您需要登錄後才可以回帖 登錄 | 申請會員

本版積分規則

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

GMT+8, 2024-5-16 11:13 AM , Processed in 0.105514 second(s), 17 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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