🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.vhdl
Article #410

Re: data types, vhdl

#410
From: Daniel S. Barclay
Date: Mon, 04 Jan 1993 13:13
19 lines
1495 bytes
> Is there any options in the vhdl language that lets me declare types
> equivalent to the "union" in C. The brute force method that I can think of
> is to declare a record with all the possible choices in the original union
> as a strictly present field; and have integer tags to access the types: 
> ...

No.  There are no variant record types in VHDL.  Sorry.  

Your workaround is the best solution I know of if you need to declare signals
or constants of that type.  If you're working with variables only (e.g., in
one process), you can declare a record containing pointers to different types,
and then allocate data for only the type that's used.

--
------------------------------------------------------------------------------
Daniel S. Barclay                    --who's still searching for a good 
CAD Language Systems, Inc.           signature, not liking any of his recent
Suite 101, 5457 Twin Knolls Rd.      feeble attempts to improve on the whiny:
Columbia, MD  21045  USA             Why can't _I_ think of a good signature?
Technical Details
Message-ID: <DANIEL.93Jan4131341@algol.clsi.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!clsi!daniel
References: <C08p03.Htv@ucunix.san.uc.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.vhdl
Path: arc1-ca.pugleaf.net!sparky!uunet!clsi!daniel
From: daniel@clsi.COM (Daniel S. Barclay)
Subject: Re: data types, vhdl
In-Reply-To: mandayrv@ucunix.san.uc.edu's message of Sat, 2 Jan 1993 18:36:02 GMT
Message-ID: <DANIEL.93Jan4131341@algol.clsi.COM>
Sender: usenet@clsi.COM
Organization: CAD Language Systems Inc.
References: <C08p03.Htv@ucunix.san.uc.edu>
Distribution: usa
Date: 4 Jan 93 13:13:41
Lines: 20