Re: Proper syntax of 'left?

From: John Shields <jshields_at_.....>
Date: Wed Feb 15 2006 - 11:41:36 PST
Arpad,

As far as I am concerned, the subtype of Test1(1) is an implicit array 
subtype for element subtype of type tables_type.  It meets the 
requirement of being a constrained array subtype.  The object Test1(1) 
is an array object.  The vendor gave you a workaround for
a bug in their tool.

Regards, John

Muranyi, Arpad wrote:

>Hello everyone,
>
>Sorry for another syntax question.
>
>I am using an array of arrays, declared this way:
>
>  type tables_type is array(1 to 3) of real_vector(1 to 5);
>  constant Test1 : tables_type := ((others=>1.0), (others=>2.0), (others=>3.0));
>
>Then I would like to work with the arrays inside the "container
>array", and in that process I need to find out the first and last
>index values using the 'left and 'right attributes.  (The reason
>I need to do this is because in reality the definition uses
>parameters, not hard coded numbers, and the function in which I
>need to know the indexes doesn't know about the boundaries of
>the array indexes).  Some tools will allow me to write the
>following:
>
>  Test(1)'left
>  Test(1)'right
>
>while others will not.  The tech support people of the vendor
>which doesn't allow this code says that I need to use a
>temporary variable in order to be able to do this:
>
>  variable temp_vector : real_vector(1 to 5);
>  temp_vector := Test(1);
>
>and then apply the 'left and 'right attributes to the temp vector:
>
>  temp_vector'left
>  temp_vector'right
>
>To me this seems to be a waste of resources and I think it will
>slow down the code and waste a lot of memory when the vectors are
>large.  I tried to get the answer to this by reading Peter
>Ashenden's book, but I didn't see anything in it that explains
>this (and I do not have a copy of the VHDL-AMS LRM).  Could
>someone please explain to me whether the syntax I am trying to
>write is legal according to the LRM (so I could perhaps convince
>the tool vendor that they need to implement it if it is legal)?
>
>Thanks,
>
>Arpad Muranyi
>Intel Corporation
>======================================================================
>
>  
>
Received on Wed Feb 15 11:41:39 2006

This archive was generated by hypermail 2.1.8 : Wed Feb 15 2006 - 11:42:44 PST