home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!inmos!wraxall.inmos.co.uk!frogland.inmos.co.uk!des
- Newsgroups: comp.lang.vhdl
- From: des@frogland.inmos.co.uk ()
- Subject: vhdl array catenation etc
- Message-ID: <1992Aug26.130603.15459@wraxall.inmos.co.uk>
- Reply-To: des@frogland.inmos.co.uk ()
- Organization: INMOS Architecture Group
- Date: Wed, 26 Aug 92 13:06:02 BST
- Lines: 54
-
-
- can anyone help with a vhdl/synopsys problem we've been having recently
- ... at the moment we seem to be chasing the problem round a circle
- as we've now shifted it back to its original point.
-
- we have a general mulitplexor function "muxi" defined in a library
- which takes as arguments an array of selectors and an array of
- bits (which represent the catenation of same length words with
- one word per selector) and it returns the subword from the array
- of bits for which the selector is true (its assumed that only
- one is true). however i think the behaviour is not relevant to
- the problem.
-
- we have a piece of vhdl which says something like
-
- X(3 DOWNTO 0) := muxi((sig_vector_t'(<exp1>,<exp2>,<exp3>)),
- (sig_vector12_t(Y(13 DOWNTO 10) &
- (sig_vector4_t'(low,high,high,low)) &
- (sig_vector4_t'(low,high,high,low)))));
-
- where <expn> are various expressions and
-
- TYPE sig_vector_t IS ARRAY (natural RANGE <>) OF sig_t;
- SUBTYPE sig_vector4_t IS sig_vector_t(3 DOWNTO 0);
- SUBTYPE sig_vector12_t IS sig_vector_t(11 DOWNTO 0);
-
- using this we get an error
-
- Type conversion operand and result type must have matching elements in each
- dimension.
-
- flagged on the second & catenation operator.
-
- however if we try declaring temp as a sig_vector_t(11 DOWNTO 0) and
- write
-
- temp := (Y(13 DOWNTO 10) &
- (sig_vector4_t'(low,high,high,low)) &
- (sig_vector4_t'(low,high,high,low)));
- X(3 DOWNTO 0) := muxi((sig_vector_t'(<exp1>,<exp2>,<exp3>)),temp)l
-
- we don't get the error. anyone tell me what's going on .... doesn't VHDL
- have substitionaly semantics?
-
- also as a side issue ... is there any benefit from the way VHDL treats
- array types as being the start and end indices rather than just a width?
- from my recent experience it just buys you a heap of type conversions
- all over the place to ensure that array bounds are what you expect.
-
- --
- --------------------------------------------------------------------------
- david shepherd: des@inmos.co.uk or des@inmos.com tel: 0454-616616 x 625
- inmos ltd, 1000 aztec west, almondsbury, bristol, bs12 4sq
- "i don't consider myself to be narcissistic ... if i had a
-