home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / vhdl / 424 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  2.6 KB

  1. Path: sparky!uunet!inmos!wraxall.inmos.co.uk!frogland.inmos.co.uk!des
  2. Newsgroups: comp.lang.vhdl
  3. From: des@frogland.inmos.co.uk ()
  4. Subject: vhdl array catenation etc
  5. Message-ID: <1992Aug26.130603.15459@wraxall.inmos.co.uk>
  6. Reply-To: des@frogland.inmos.co.uk ()
  7. Organization: INMOS Architecture Group
  8. Date: Wed, 26 Aug 92 13:06:02 BST
  9. Lines: 54
  10.  
  11.  
  12. can anyone help with a vhdl/synopsys problem we've been having recently
  13. ... at the moment we seem to be chasing the problem round a circle
  14. as we've now shifted it back to its original point.
  15.  
  16. we have a general mulitplexor function "muxi" defined in a library
  17. which takes as arguments an array of selectors and an array of
  18. bits (which represent the catenation of same length words with
  19. one word per selector) and it returns the subword from the array
  20. of bits for which the selector is true (its assumed that only
  21. one is true). however i think the behaviour is not relevant to
  22. the problem.
  23.  
  24. we have a piece of vhdl which says something like
  25.  
  26. X(3 DOWNTO 0) := muxi((sig_vector_t'(<exp1>,<exp2>,<exp3>)),
  27.                       (sig_vector12_t(Y(13 DOWNTO 10) &
  28.                                       (sig_vector4_t'(low,high,high,low)) &
  29.                                       (sig_vector4_t'(low,high,high,low)))));
  30.  
  31. where <expn> are various expressions and
  32.  
  33. TYPE     sig_vector_t        IS ARRAY (natural RANGE <>) OF sig_t;
  34. SUBTYPE  sig_vector4_t       IS sig_vector_t(3 DOWNTO 0);
  35. SUBTYPE  sig_vector12_t      IS sig_vector_t(11 DOWNTO 0);
  36.  
  37. using this we get an error
  38.  
  39.     Type conversion operand and result type must have matching elements in each
  40.        dimension.
  41.  
  42. flagged on the second & catenation operator.
  43.  
  44. however if we try declaring temp as a sig_vector_t(11 DOWNTO 0) and
  45. write
  46.  
  47. temp := (Y(13 DOWNTO 10) &
  48.          (sig_vector4_t'(low,high,high,low)) &
  49.          (sig_vector4_t'(low,high,high,low)));
  50. X(3 DOWNTO 0) := muxi((sig_vector_t'(<exp1>,<exp2>,<exp3>)),temp)l
  51.  
  52. we don't get the error. anyone tell me what's going on .... doesn't VHDL
  53. have substitionaly semantics?
  54.  
  55. also as a side issue ... is there any benefit from the way VHDL treats
  56. array types as being the start and end indices rather than just a width?
  57. from my recent experience it just buys you a heap of type conversions
  58. all over the place to ensure that array bounds are what you expect.
  59.  
  60. --
  61. --------------------------------------------------------------------------
  62. david shepherd: des@inmos.co.uk or des@inmos.com    tel: 0454-616616 x 625
  63.                 inmos ltd, 1000 aztec west, almondsbury, bristol, bs12 4sq
  64.                 "i don't consider myself to be narcissistic ... if i had a
  65.