Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Method cannot have a parameter of file type

 
Thread Tools Search this Thread
Old 06-10-2007, 01:03 PM   #1
Default Method cannot have a parameter of file type


Hi all,

I am trying to declare procedure in protected type, with file as
parameter
but ModelSim does not allow that:
I am receiving an error : "Method cannot have a parameter of
file type".
The code is compiled using VHDL 1076-2002.
Also there is an explicit example in "The Designer's Guide To
VHDL", 2nd edition,p 632-633. of exactly the same thing I am trying to
do, but in my case it doesn't work .

1) Any suggestions what might be wrong ?
2) Any comment are welcome.

Thanx!

Here is the code I am trying to compile
_____________________________

Library IEEE;
use IEEE.std_logic_1164.all

Library std
use std.textio.all

package pkg_mem is
type mem is protected
procedure input_img (file image_file : text ); --
the error is recieved on this line.
end protected mem;
end pkg_mem;

package body pkg_mem is
type mem is protected body
procedure input_img(file image_file : text ) is
begin
end ;
end protected body mem ;
end pakage body pkg_mem ;
_____________________________________________

Thanx again! (a.. that's not a copy-paste so spelling errors might pop-
up )



sgregnt
  Reply With Quote
Old 06-11-2007, 04:27 PM   #2
sgregnt
 
Posts: n/a
Default Re: Method cannot have a parameter of file type

I know that in VHDL 93 Method cannot have a parameter of
file type. So maybe it has something to do with compiler
version(according to ModelSim I compile the code with VHDL 2002.)?
Have anybody experienced similar problems?




sgregnt
  Reply With Quote
Old 06-11-2007, 06:37 PM   #3
Mike Treseler
 
Posts: n/a
Default Re: Method cannot have a parameter of file type
sgregnt wrote:
> I know that in VHDL 93 Method cannot have a parameter of
> file type.


File parameters are ok in -93.
Notice that there is no error if I
remove the protected types.

-- Mike Treseler
_________________________________
library ieee;
use ieee.std_logic_1164.all;
use std.textio.all;

package pkg_mem is
procedure input_img (file image_file : text);
end package pkg_mem;

package body pkg_mem is
procedure input_img(file image_file : text) is
begin
end;
end package body pkg_mem;

--60 Mon Jun 11 /evtfs/home/tres/vhdl/play> vcom pkg_mem.vhd
--Model Technology ModelSim SE vcom 6.2a Compiler 2006.06 Jun 16 2006
---- Loading package standard
---- Loading package std_logic_1164
---- Loading package textio
---- Compiling package pkg_mem
---- Compiling package body pkg_mem
---- Loading package pkg_mem


Mike Treseler
  Reply With Quote
Old 06-11-2007, 09:59 PM   #4
Paul Uiterlinden
 
Posts: n/a
Default Re: Method cannot have a parameter of file type
sgregnt wrote:

> Hi all,
>
> I am trying to declare procedure in protected type, with file as
> parameter
> but ModelSim does not allow that:
> I am receiving an error : "Method cannot have a parameter of
> file type".
> The code is compiled using VHDL 1076-2002.
> Also there is an explicit example in "The Designer's Guide To
> VHDL", 2nd edition,p 632-633. of exactly the same thing I am trying to
> do, but in my case it doesn't work .
>
> 1) Any suggestions what might be wrong ?


Either ModelSim or the language definition.

> 2) Any comment are welcome.


It's a pity that vcom does not emit an error number. If it would, you could
get an additional description of the error with the verror command.

You could open a case on SupportNet and ask Mentor Graphics why your case
fails. And post the result here, because I'm curious too.

--
Paul Uiterlinden
www.aimvalley.nl
e-mail addres: remove the not.


Paul Uiterlinden
  Reply With Quote
Old 06-12-2007, 07:04 PM   #5
James Unterburger
 
Posts: n/a
Default Re: Method cannot have a parameter of file type
2002 LRM
[3.5.1 Protected type declarations]
....
Each subprogram specified within a given protected type declaration defines
an abstract operation, called a method, that operates atomically and exclusively
on a single object of the protected type. In addition to the (implied) object
of the protected type operated on by the subprogram, additional parameters may
be explicitly specified in the formal parameter list of the subprogram declaration
of the subprogram. Such formal parameters must not be of an access type or a
file type; moreover, they must not have a subelement that is [of] an access type
[or file type]*.

[of] added to 200X draft
*deleted from 200X draft because of LCS-2006-008; IR2029


If you put this in the protected type body only (so it's no longer a method,
but rather just a subprogram local to the body), then it's OK to have
a class FILE formal parameter. So it's conceivable to have a method that
takes a file name (string) and calls the body subprogram with a FILE
type data member having been opened by the method.


James Unterburger
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Eclipse - Axis2 - Java Webservices Error amanjsingh Software 1 10-09-2007 09:03 AM
Need help on Modelsim VHDL syntax? ASAP:) kaji General Help Related Topics 0 03-14-2007 10:43 PM
Need help on a Modelsim VHDL Syntax? ASAP:) kaji Software 0 03-14-2007 10:43 PM
Need Help on a Modelsim VHDL Syntax....ASAP:) kaji Hardware 0 03-14-2007 10:41 PM
Re: Ripping DVDs. Please answer the attached question. - Question.txt Stan Brown DVD Video 19 02-09-2005 11:19 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46