RE: [sv-bc] Function return values

From: Arturo Salz <Arturo.Salz_at_.....>
Date: Fri Mar 02 2007 - 23:45:17 PST
Shalom,

Maintaining a common counter is better accomplished by an automatic
function with a static counter. Clearly static data is useful. It's the
static return value that is more problematic.

And, BTW, dumping automatics is not so much a lifetime issue as a naming
problem. It would not be difficult to arrange for the simulator to dump
automatics every time an automatic task or function is called. But, when
the same function is called more than once in the same time slot (or
recursively), the names used in the dump must be unique, simple, and
meaningful to designers. Finding such a naming scheme is a challenge.

	Arturo 

-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
Bresticker, Shalom
Sent: Friday, March 02, 2007 6:40 AM
To: Rich, Dave; sv-bc@eda-stds.org
Subject: RE: [sv-bc] Function return values

On the other hand, statics have the advantage of being able, for
example, to maintain a counter of how many times the routine was called
(just an example). Currently, automatics also have the major
disadvantage of not being able to dump them to VCD, display their value
hierarchically, etc. How about solving that problem?

Shalom


> It too bad we can't switch the default lifetime to automatic. I've
seen
> countless experienced Verilog users get burned by multiple threads
> executing the same static task and having their static arguments
> clobbered. I hope that people are teaching users to avoid static tasks
> and functions and always make them automatic.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Mar 2 23:45:40 2007

This archive was generated by hypermail 2.1.8 : Fri Mar 02 2007 - 23:46:08 PST