Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   VHDL (http://www.velocityreviews.com/forums/f18-vhdl.html)
-   -   Can you take attributes from array type element? (http://www.velocityreviews.com/forums/t727454-can-you-take-attributes-from-array-type-element.html)

Tricky 07-05-2010 09:02 AM

Can you take attributes from array type element?
 
Is there any way to get access to the elements in an array type?

eg, array is declared:
type sfixed_array_t is array(integer range<>) of sfixed(5 downto -12);

is there any way to access the length of the sfixed element via the
sfixed_array_t?

Or do I just have to declare a subtype and make an array of them?

KJ 07-05-2010 02:18 PM

Re: Can you take attributes from array type element?
 
On Jul 5, 5:02*am, Tricky <trickyh...@gmail.com> wrote:
> Is there any way to get access to the elements in an array type?
>
> eg, array is declared:
> type sfixed_array_t is array(integer range<>) of sfixed(5 downto -12);
>
> is there any way to access the length of the sfixed element via the
> sfixed_array_t?
>
> Or do I just have to declare a subtype and make an array of them?


Once you declare a signal or variable of the sfixed_array_t, (or
you're within a function or a procedure that gets passed an
sfixed_array_t parameter) then you can get the length of an element of
the array.

KJ

Andy Rushton 07-06-2010 06:13 PM

Re: Can you take attributes from array type element?
 
Tricky wrote:
> Is there any way to get access to the elements in an array type?


>
> eg, array is declared:
> type sfixed_array_t is array(integer range<>) of sfixed(5 downto -12);
>
> is there any way to access the length of the sfixed element via the
> sfixed_array_t?


No there isn't

>
> Or do I just have to declare a subtype and make an array of them?


Exactly. Then you can use attributes of the subtype to get details such
as the length of the element.


All times are GMT. The time now is 11:09 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.