RE: [sv-bc] enumerated variable used with an equality operator

From: Bresticker, Shalom <shalom.bresticker@intel.com>
Date: Sun Mar 23 2014 - 00:58:09 PDT
I see a lot of SV RTL code that uses enums and not just in FSMs.

Shalom


> -----Original Message-----
> From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
> Greg Jaxon
> Sent: Friday, March 21, 2014 22:24
> To: Steven Sharp; SV_BC List
> Subject: Re: [sv-bc] enumerated variable used with an equality operator
> 
> We've certainly seen FSMs written with enum-valued states.
> I don't know whether they're "trending" or not.
> But the 'X initialization aspect does not directly affect synthesis.
> It's a matter of concern to simulators, if they are going to
> track how the first valid state of the machine emerges.
> 
> We don't synthesize implicit initializations at time 0.
> Instead we (try to) statically detect uses of uninitialized nets.
> Type-safety of enums opens up the possibility of optimizations that re-
> encode the enum state values.
> Some of this is old practice, and some is still blue-sky.
> So far the SV language hasn't unlocked any new opportunities here.
> 
> On 3/21/2014 2:59 PM, Steven Sharp wrote:
> > Your mention of synthesis makes me curious.
> >
> > One of the reasons for the "schizophrenia" that Gord mentioned is
> that
> > there are at least two different general uses for enums, which may
> have
> > different requirements.  There is the software-like use in
> testbenches,
> > where strong typing is more likely to be desired.  And there is the
> > hardware-like use in designs, for things like state machine states,
> where
> > overly strong typing is inconvenient.
> >
> > I originally assumed that the hardware-like uses would be common.  I
> > proposed the initialization of 4-state enums to X for this reason,
> because
> > initializing state machine states to known values would not correctly
> > model hardware initialization.  This could have led to faulty
> hardware.
> > But when I saw very little of this in user designs, I started
> thinking
> > that I had been wrong about this.
> >
> > Now I am curious whether you have started seeing more enums used in
> > synthesizable code.  Were they just slower to be adopted by users in
> > synthesizeable code (perhaps due to limited tool support as well as
> > conservativism), but are finally becoming more common?  Or are you
> just
> > speaking theoretically about what would be possible if users actually
> did
> > start using them this way?

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sun Mar 23 00:58:49 2014

This archive was generated by hypermail 2.1.8 : Sun Mar 23 2014 - 00:59:05 PDT