Can you take attributes from array type element?

Discussion in 'VHDL' started by Tricky, Jul 5, 2010.

  1. Tricky

    Tricky Guest

    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?
     
    Tricky, Jul 5, 2010
    #1
    1. Advertising

  2. Tricky

    KJ Guest

    On Jul 5, 5:02 am, 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?
    >
    > 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
     
    KJ, Jul 5, 2010
    #2
    1. Advertising

  3. Tricky

    Andy Rushton Guest

    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.
     
    Andy Rushton, Jul 6, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    499
  2. Replies:
    1
    Views:
    976
    Richard Bos
    Jan 17, 2008
  3. Mike N.
    Replies:
    3
    Views:
    584
    Joseph Kesselman
    Mar 17, 2008
  4. xiang chen
    Replies:
    2
    Views:
    621
    The Ghost in The Machine
    May 14, 2011
  5. Replies:
    2
    Views:
    104
Loading...

Share This Page