Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Is this a VHDL limitation, or Modelsim bug

Reply
Thread Tools

Is this a VHDL limitation, or Modelsim bug

 
 
Tricky
Guest
Posts: n/a
 
      04-11-2011
I have the following line of code:

img_height := ( img.get_image )'length(1);

img is a protected type.
get_image is a function returning a 2D array containing the image
data.
img_height is an integer.

Now, in modesim I get the compilation error:

# ** Error: hdl/mem_interface_model.vhd(745): near "'": expecting ';'

The error is pointing to the 'length attribute.

So I can see that modelsim wants to end the like at the function call,
but what's wrong with taking the attribute of a return value.

Before anyone asks, Ive found an annoying bug that crashes the
modelsim compiler which mean (for reasons of my file) I cannot have
functions that return the width or height of the image in the
protected type. It works when I return the image array, so Im trying
to work around this bug with the code above.
 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      04-11-2011
On 4/11/2011 4:37 AM, Tricky wrote:
> I have the following line of code:
>
> img_height := ( img.get_image )'length(1);
>
> img is a protected type.
> get_image is a function returning a 2D array containing the image
> data.
> img_height is an integer.



Why doesn't the (1) go with the array?

-- Mike Treseler
 
Reply With Quote
 
 
 
 
Tricky
Guest
Posts: n/a
 
      04-11-2011
On Apr 11, 8:13*pm, Mike Treseler <(E-Mail Removed)> wrote:
> On 4/11/2011 4:37 AM, Tricky wrote:
>
> > I have the following line of code:

>
> > img_height * * * * * * *:= ( img.get_image )'length(1);

>
> > img is a protected type.
> > get_image is a function returning a 2D array containing the image
> > data.
> > img_height is an integer.

>
> Why doesn't the (1) go with the array?
>
> * * * * * * *-- Mike Treseler


n-d arrays, declared like this:

type my_array is array( integer range <>, integer range <>, integer
range etc etc) of integer;

means that you have to specify which dimension you are talking about
when you try and take an attribute, hence the (1).
 
Reply With Quote
 
Peter Spjuth
Guest
Posts: n/a
 
      04-15-2011
On 11 Apr, 14:37, Tricky <(E-Mail Removed)> wrote:
> I have the following line of code:
>
> img_height * * * * * * *:= ( img.get_image )'length(1);


I think ' must be preceeded by a name or function call, and in your
case it
is preceeded by a parenthesised expression.

Does img.get_image'length(1) or img.get_image()'length(1) work?

/Peter
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL Operator associativity (Quartus II VHDL parser bug?) fons VHDL 0 06-18-2008 10:07 PM
VHDL-2002 vs VHDL-93 vs VHDL-87? afd VHDL 1 03-23-2007 09:33 AM
modelsim error with synthesizeable VHDL Patrick Erich VHDL 5 11-27-2003 03:36 PM
VHDL design and ModelSim Vilvox VHDL 2 09-01-2003 06:23 PM
VHDL Simulation in ModelSim Manfred Balik VHDL 0 07-15-2003 02:12 PM



Advertisments