ISSUE 484

Number 484
Category errata
Synopsis 10.3.4.e: assignment of function result value
State lrmdraft
Class errata-discuss
Arrival-DateSep 20 2003
Originator "Brad Pierce" <Brad.Pierce@synopsys.com>
Release 2001b: 10.3.4e
Environment
Description
According to 10.3.4.e, "A function definition shall include an
assignment of the function result value to the internal variable
that has the same name as the function name."

Must at least one such assignment be always reachable? Is the following
function legal? --

function f ;
input i ;
if (1'b0) f = i ;
endfunction

Or, asking almost the same question, is it legal to fall off the end of
a function without making an explicit assignment to the implicitly declared
return variable? Must a simulator issue an error when this happens?
If not, why not? This seems like a more natural (and user-helpful)
restriction than the textually-based rule e, which it would subsume.

-- Brad


Fix
REMOVE (10.3.4):
Bullet e: "A function definition shall include an assignment of the function result value to the internal variable that has the same name as the function name."

"six" from first paragraph "Functions are more limited than tasks.The following six rules govern their usage:"
Audit-Trail

From: Steven Sharp <sharp@cadence.com>
To: etf-bugs@boyd.com, Brad.Pierce@synopsys.com
Cc:
Subject: Re: errata/484: 10.3.4.e: assignment of function result value
Date: Mon, 22 Sep 2003 16:13:02 -0400 (EDT)

It is a pretty weak requirement. I suppose it might save you from some gross
errors. Verilog-XL doesn't bother to do any checks of this sort.

To answer your other question, there is nothing that says it is illegal to
fall off the end of the function without assigning to the return variable.
There is no requirement for a simulator to issue an error when this happens.
One reason why not is that it would cost speed in the simulator to do this
kind of run-time checking.

Steven Sharp
sharp@cadence.com


Fix replaced by Shalom.Bresticker@motorola.com on Wed Nov 12 05:07:30 2003
Propose to close the issue with no change.


Fix replaced by stefen@boyd.com on Mon Dec 15 10:21:44 2003
REMOVE (10.3.4):
Bullet e: "A function definition shall include an assignment of the function result value to the internal variable that has the same name as the function name."

"six" from first paragraph "Functions are more limited than tasks.The following six rules govern their usage:"


Unformatted


Hosted by Boyd Technology