home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / vhdl / 621 next >
Encoding:
Text File  |  1993-01-04  |  1.4 KB  |  34 lines

  1. Newsgroups: comp.lang.vhdl
  2. Path: sparky!uunet!clsi!daniel
  3. From: daniel@clsi.COM (Daniel S. Barclay)
  4. Subject: Re: data types, vhdl
  5. In-Reply-To: mandayrv@ucunix.san.uc.edu's message of Sat, 2 Jan 1993 18:36:02 GMT
  6. Message-ID: <DANIEL.93Jan4131341@algol.clsi.COM>
  7. Sender: usenet@clsi.COM
  8. Organization: CAD Language Systems Inc.
  9. References: <C08p03.Htv@ucunix.san.uc.edu>
  10. Distribution: usa
  11. Date: 4 Jan 93 13:13:41
  12. Lines: 20
  13.  
  14. > Is there any options in the vhdl language that lets me declare types
  15. > equivalent to the "union" in C. The brute force method that I can think of
  16. > is to declare a record with all the possible choices in the original union
  17. > as a strictly present field; and have integer tags to access the types: 
  18. > ...
  19.  
  20. No.  There are no variant record types in VHDL.  Sorry.  
  21.  
  22. Your workaround is the best solution I know of if you need to declare signals
  23. or constants of that type.  If you're working with variables only (e.g., in
  24. one process), you can declare a record containing pointers to different types,
  25. and then allocate data for only the type that's used.
  26.  
  27. --
  28. ------------------------------------------------------------------------------
  29. Daniel S. Barclay                    --who's still searching for a good 
  30. CAD Language Systems, Inc.           signature, not liking any of his recent
  31. Suite 101, 5457 Twin Knolls Rd.      feeble attempts to improve on the whiny:
  32. Columbia, MD  21045  USA             Why can't _I_ think of a good signature?
  33.  
  34.