Chip123 科技應用創新平台

 找回密碼
 申請會員

QQ登錄

只需一步,快速開始

Login

用FB帳號登入

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

[問題求助] 有關verilog 錯誤

[複製鏈接]
跳轉到指定樓層
1#
發表於 2010-12-27 13:54:47 | 只看該作者 回帖獎勵 |正序瀏覽 |閱讀模式
小弟我是新手  想把呼叫function函數改成呼叫task 但不知道是哪邊有問題會一值出現  希望高手們能幫我一下  ( w9 R, b% z" T0 f  h% B& o7 \
我猜應該是在always和呼叫連結不起來的問題  卻不知道如何下手5 }! N/ m# f8 }* Z! u
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 I1 U: @2 w% l" aoutput [7:0] mout;9 m5 P/ P& X" X
                |
2 |3 S% W' B& A5 V' |: H7 x( ^0 gncvlog: *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)].& S; X9 B; z) k: f  f% q4 p8 {
multdiv8(right,indata,mout);
% X% ]% k# e8 M/ g       |
$ v0 c+ m/ p" h% _ncvlog: *W,FAAOP1 (shift.v,51|7): task or function call does not specify all formal output arguments [10.2.2][10.3(IEEE)]." p8 S8 o' g  N* u7 k2 z
output [7:0] mout;/ T& O3 F2 O- t( i  d% o
- K, t1 J- S; @4 v# U5 d
2 F+ y: r" D; `# h. N/ L
原本的code:( ]* o9 S0 v4 O' [( n8 z
7 h: h1 ~; O; @4 t- _% s! o
module shift(indata,qout,mout);
- D9 R/ f& h  C$ N
5 e6 ]5 H8 T  J2 k1 P3 v( y! D  Joutput [7:0] qout;
0 n5 E- a; T5 Z- P! b" Foutput [7:0] mout;+ N  S& _% S* T
input   [7:0]  indata;
  F* D9 B+ R+ m; l0 j2 e( ?
0 A+ I5 d6 F/ K. }0 }, K* ireg [7:0] qout;# ^% d9 L7 z4 e2 C% X
reg [7:0] mout;
: s6 ~/ d. G# |" T& r1 g4 H* m9 Wparameter left=1;
+ i- m7 \$ T8 l6 \; nparameter right=0;
- v6 d2 N# \% j# |! |: A% z$ V- E
" G4 d  i( I4 @4 z5 S* b4 `! Xalways@(indata)
, q. g# j" R0 X, p+ T, g; E9 n4 _3 F/ p) `' r. N' b% Y2 b
begin+ N: [2 j. b) x$ p) J/ w2 s# ]' q

& w4 G- |4 i: q$ {: U+ omout=multdiv8 (left,indata);
, q+ l8 S. S! V; \) p; n* lqout=multdiv8  (right,indata);
, w$ B; P; q- E' _$ E9 P
7 m  W/ v% ~- g+ W! |1 r) |6 E2 U6 Hend
' ]: f  \) V) d1 C$ c: E# X; @: D9 S7 c6 E  ~5 Y7 G# \
function [7:0] multdiv8;
' n% W- @% ?9 K7 m0 s& L
3 P* c8 v7 O) B# L7 p9 g0 u2 Kinput fcn_left :
: u2 P2 d; F9 ^3 |2 T' Ainput[7:0] fcn_in;
! Q5 K8 y5 p: z# Q/ y+ xbegin2 O; t% K2 d% ~4 n6 [2 X% S+ o! t
    multdiv8=(fcn_left==1)?(fcn_in<<3): (fcn_in>>3);
5 k! y$ s/ S  `8 Xend; Q! L1 l% Y6 t4 T9 \5 e9 u
endfunction, V# l' S$ o# x, Y
0 e, B/ |3 m  H1 g; L1 B0 t
endmodule% i3 \3 J( Y$ s& u9 e. E7 o; T

. n1 l% C8 c, d$ E( s. l2 G以下是我自己寫的 $ A8 X* R: U. a% C. c! b

) {4 Q! f' [/ p! u& r; A. z. kmodule (qout, mout,indata);
  M6 N- U, U0 Q# O; w; ?" ^' i; M" u, |
output [7:0] qout;8 v- e) e- e2 s" |1 F
output [7:0] mout;
8 C$ }6 l1 _6 K/ e3 N9 O9 pinput [7:0] indata;- p+ s2 m1 w. \; ~* ~( W
reg [7:0] qout;; h  G. Q% f* Z) P+ \. u
reg [7:0] mout;' c4 l- r6 O9 Y0 |
parameter left=1;
) Q& K6 s+ ^' `4 n, ]& i0 eparameter right=0;9 y/ Z. n. ~! J! o

" ?$ p1 J% V& Y2 I7 a- s/ {always@(indata) begin
# t( Z9 O  t0 @% n( O
; [* j" }8 H" Jmultdiv8 (left,indata,qout);
+ D5 P" c) e  l: Smultdiv8 (right,indata,mout);
- {  j3 _1 ~5 N
  c5 \/ x& W2 X" b5 L8 ]% Rend0 P6 M2 g# j! w

5 m' [0 c' K, B6 N, F3 \task multdiv8;
7 Z8 J, s8 ?: e+ b7 h
$ L$ }: m! m+ Z: q# jinput fcn_left;: F5 d8 k* L2 H: |
input [7:0] fcn_in;
" M. ]9 t# ^" @6 g0 l4 noutput [7:0] qout;
$ G6 F% r7 ?; W0 ?, zoutput [7:0] mout;3 C( k' ]  S7 i& e0 R
7 F) K4 k# D" j$ t. {

4 w: Z) U" e) `3 P% c$ dif (fcn_left==1)
  v, X5 V$ |  i  Q4 C; |  [qout=fcn_in<<3;" n& n! x; n( M  B' l5 {
else
7 v: I: _- B' d" dmout=fcn_in>>3;
: }5 A  _/ G5 M3 Z: d% P
$ P- v/ _2 d3 g  W0 ]# U9 o( Qendtask
! l4 |* Q" B5 [7 v. Y" Pendmodule
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享分享 頂 踩 分享分享
3#
 樓主| 發表於 2010-12-29 16:34:47 | 只看該作者
我知道我問題所在了  task的port和宣告的port不一致
/ B2 y: j5 T# a4 p9 `2 A& S* b
" a" B& ]( J1 t$ ~6 w/ f要在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-14 09:05 PM , Processed in 0.123516 second(s), 18 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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