Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > problems with readline function within a subprogram

Reply
Thread Tools

problems with readline function within a subprogram

 
 
ed.agunos@gmail.com
Guest
Posts: n/a
 
      09-08-2006
All,

I am having problems with the readline function within a subprogram.

Check out the following processes. In the first process
"proc_wo_subprogram", everything works correctly. The next line from
the file is read and the pointer is assigned to "data_line" and I can
access the object that "data_line" points to. But in the second process
"proc_w_subrprogram", I can't access the object and I don't really
understand why. Can any one explain?

proc_wo_subprogram : process
variable stat : file_open_status;
file data_file : text;
variable data_line : line;
begin
file_open(stat, data_file, "test_data.dat", read_mode);
readline(data_file, data_line);
file_close(data_file);
wait;
end process;

proc_w_subprogram : process

procedure go is
variable stat : file_open_status;
file data_file : text;
variable data_line : line;
begin
file_open(stat, data_file, "test_data.dat", read_mode);
readline(data_file, data_line);
file_close(data_file);
end procedure;

begin
go;
wait;
end process;

 
Reply With Quote
 
 
 
 
Paul Uiterlinden
Guest
Posts: n/a
 
      09-08-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> All,
>
> I am having problems with the readline function within a subprogram.
>
> Check out the following processes. In the first process
> "proc_wo_subprogram", everything works correctly. The next line from
> the file is read and the pointer is assigned to "data_line" and I
> can access the object that "data_line" points to. But in the second
> process "proc_w_subrprogram", I can't access the object and I don't
> really understand why. Can any one explain?
>
> proc_wo_subprogram : process
> variable stat : file_open_status;
> file data_file : text;
> variable data_line : line;
> begin
> file_open(stat, data_file, "test_data.dat", read_mode);
> readline(data_file, data_line);
> file_close(data_file);
> wait;
> end process;
>
> proc_w_subprogram : process
>
> procedure go is
> variable stat : file_open_status;
> file data_file : text;
> variable data_line : line;
> begin
> file_open(stat, data_file, "test_data.dat", read_mode);
> readline(data_file, data_line);
> file_close(data_file);
> end procedure;
>
> begin
> go;
> wait;
> end process;


I don't get it. What do you mean with "can't access". Are there any
error messages?

Of course you realize the variables of the procedure cannot be
accessed in the proc_w_subprogram process, don't you? The variables
are local to the procedure.

--
Paul.

 
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
compiling python 3.1.2 with local readline fails to get readline - help! gavino Python 4 09-20-2010 05:17 AM
Getting application ReadLine and Perl debugger ReadLine to cooperate Andrew DeFaria Perl Misc 1 01-30-2008 11:46 PM
Readline::readline() blocking all other threads Jean-Michel Ruby 0 12-22-2007 01:00 AM
Simulating testbench waveform error: "No feasible entries for subprogram write" Taras_96 VHDL 2 08-03-2005 02:55 AM
Hiding of subprogram designators David Jones VHDL 1 11-18-2003 09:37 AM



Advertisments