Chip123 科技應用創新平台

 找回密碼
 申請會員

QQ登錄

只需一步,快速開始

Login

用FB帳號登入

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

[問題求助] 有關verilog 錯誤

[複製鏈接]
跳轉到指定樓層
1#
發表於 2010-12-27 13:54:47 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
小弟我是新手  想把呼叫function函數改成呼叫task 但不知道是哪邊有問題會一值出現  希望高手們能幫我一下  7 G8 N( }7 ^# S5 O2 w5 U) d
我猜應該是在always和呼叫連結不起來的問題  卻不知道如何下手; ?1 M/ \" b" F1 ~
ncvlog: *W,FAAOP1 (shift.v,49|7): task or function call does not specify all formal output arguments [10.2.2][10.3(IEEE)].
! c$ N' R8 H9 Houtput [7:0] mout;% U! W1 z5 B; |
                |
4 j3 }* l* ~6 }. [; Lncvlog: *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)].3 M$ Y; q7 a( x! R2 U
multdiv8(right,indata,mout);0 ~/ b1 Y, \; R2 z/ T7 T
       |
/ j4 r$ Q' y8 ]+ B- Zncvlog: *W,FAAOP1 (shift.v,51|7): task or function call does not specify all formal output arguments [10.2.2][10.3(IEEE)].) `0 ^: X/ i% G' s. x
output [7:0] mout;  ?2 q8 i6 x6 I- l* t* r
+ v& Z' L- ~' u7 z" k5 F; M

6 M1 f8 k; |% ^2 u3 T; i, }8 ]原本的code:
( H% T/ A+ i% g3 c+ _- L% g7 Y: o. c6 p. X
module shift(indata,qout,mout);/ G& F& A- _' Q; |
9 m) @3 ?4 }# G1 Y3 D1 `  L0 U
output [7:0] qout;% K5 D9 d7 ]3 D  k; K1 D, V, a4 l% e
output [7:0] mout;9 Z% }( w7 g- @- D' W% p
input   [7:0]  indata;5 ]2 ~' u; i: m! U, Q

0 ]% ], W) \6 o/ o% K9 K1 r' N3 Xreg [7:0] qout;% O+ |, ]/ ^0 A& j2 G# }+ l
reg [7:0] mout;
5 q! f+ j% P7 jparameter left=1;+ `1 D. Q  h7 ^/ L, V
parameter right=0;
8 L6 v) J+ x  Q5 M1 J: g
; ~& z; {6 p7 q0 {& g$ H3 \; Malways@(indata)6 x0 D, n0 A* r$ l* f

& f8 q  G3 v& O8 c4 ^- Rbegin, g. ~1 U' m. N3 P: G
+ F( E" F4 f) _) D! c
mout=multdiv8 (left,indata);
, }% {/ i' `; f5 Rqout=multdiv8  (right,indata);7 q$ x4 d9 o) |4 T. Q

) y6 P  y! L+ S( I4 Lend+ J7 B4 I$ {: |" ?/ T3 r4 _
: ~+ t4 B- u4 r
function [7:0] multdiv8;
1 ~& m/ `# b8 P0 N: ]7 z$ x, ]" E( L
input fcn_left :
& r0 X$ z( w6 V4 v. einput[7:0] fcn_in;; y7 o4 b7 @6 D
begin
# t4 t. K" U, e, {, A. ^& H' _; f    multdiv8=(fcn_left==1)?(fcn_in<<3): (fcn_in>>3);
- X* {/ i' D2 |* [% C' ^end
: @4 Y! @; Q5 H, tendfunction
  {' a5 R- p8 A+ ?8 A' g% b5 i, P
endmodule  W: B- Q6 ]) T- A* j5 F* ]
+ S% I4 r3 |) X6 ?& s1 H
以下是我自己寫的
. S. q( C$ ^7 n4 i
* c0 ^, W& ?9 C% Z. Gmodule (qout, mout,indata);% m8 }6 a' i8 M  ]+ t

0 }- v1 q5 m2 T+ F( g4 Uoutput [7:0] qout;; x, y4 i% k* o6 i3 c# c' J
output [7:0] mout;  {$ O/ v7 H7 _" F7 v" {
input [7:0] indata;2 r) R! z! ]; P
reg [7:0] qout;
: J, ^, R" L: Breg [7:0] mout;
& I0 L( |2 T0 D3 \. ~* X5 yparameter left=1;
0 E/ B5 F( u& L" B, ?parameter right=0;
$ L; ^- R7 V# R8 @6 E7 E  a/ E! z" G8 c2 n( i  [$ w
always@(indata) begin
' ^3 ?6 V5 \8 s% }$ V9 |
% N9 Y  m$ w2 i' Y3 }- h$ umultdiv8 (left,indata,qout);) {4 \4 d: `* H2 Q
multdiv8 (right,indata,mout);) d9 b  M" E+ {  Y
& g3 B* a8 \" @; x* ~# M# o
end" {9 k6 g+ {+ T% m: J
8 r# A7 E0 k7 @* u% O
task multdiv8;4 u' Z1 w  V7 I# B1 G
7 X% D" c& i! Z# P: B
input fcn_left;6 u4 I( J* ~; l8 [1 {! [# O6 X  L' R
input [7:0] fcn_in;
7 y$ E; w: M* f2 _" b# toutput [7:0] qout;
" I9 S, C; B# z% M6 aoutput [7:0] mout;2 G. r0 U2 @& i! p
- Z: R3 A& M& ^1 V( Z, Q& {
& e, G1 N% M/ z0 Z: C& Y
if (fcn_left==1)
" p  C$ H1 L2 M- {" Yqout=fcn_in<<3;5 j# k3 L- w6 s5 t
else
# I& n& s3 A/ R+ ^) `: \9 ^  @mout=fcn_in>>3;
. t$ _: B  K: i% S& Z) K" x
# G* |+ [2 N  i7 H0 \  ~; uendtask
% U9 x* h. O/ Y" f. O- P; Wendmodule
分享到:  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不一致
, x* n9 v- M& ^, l8 _
- T* g% P: T# I要在task後面多打qout and mout 這樣就OK了
您需要登錄後才可以回帖 登錄 | 申請會員

本版積分規則

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

GMT+8, 2024-4-29 08:58 AM , Processed in 0.103006 second(s), 17 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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