"No feasible entries for subprogram"

C

Castreuil Anthony

Guest
Hi,

I'm pretty new to VHDL. I use ModelSim to write, compile and simulate
it.

I have to write a VHDL program that can output numbers into a textfile
from a for-loop.

This is the code I hacked together with code I found with Google, wich
compiles:

[code:1:2be8bf583d]
use std.textio.all;

entity io is
end io;

architecture gedrag of io is
begin
process

file OUTFILE: text is out "C:\dataout.txt";
variable temp: line;

begin
for j in 1 to 9 loop
write (temp, j);
writeline (OUTFILE, temp);
end loop;
wait;
end process;
end gedrag;
[/code:1:2be8bf583d]
Note that this compiles correctly (but I don't know how to see if it
works correctly)
I'm now trying to rewrite it with stuff from my Coursebook.

This is what I have:
[code:1:2be8bf583d]
use std.textio.all;

entity io is --geenpoortennodig
end io;

architecture gedrag of io is
begin
process
type bestand is file of character;
file OUTFILE: bestand;

variable temp: line;
variable j: character;

begin
file_open(OUTFILE,"dataout.txt",write_mode);
for j in 1 to 9 loop
write (temp, j);
writeline (OUTFILE, temp);
end loop;
wait;
file_close(OUTFILE);
end process;
end gedrag;
[/code:1:2be8bf583d]

This does not compile:

Compiler output is:
# ** Error: C:/Modeltech_xe_starter/examples/opdracht2d(19): No
feasible entries for subprogram "writeline".
# ** Error: C:/Modeltech_xe_starter/examples/opdracht2d(24): VHDL
Compiler exiting

Any suggestions ?
Thanks
 
variable temp: line;
variable j: character;

I want to add that I already changed "variable j: integer;" like it
should, but that doesn't compile either
 
The only difference I see is the file type you have declared "OUTFILE".
Modelsim gives the error "No
feasible entries for subprogram "writeline". " when either the
"writeline" procedure does not exists or it exists but there is a type
mismatch in one of its arguments.
You may want to recheck if your course book also gives you a
corresopnding writeline procedure as you had a seperate procedure to
open a file.

To check you first code, after you compile do a vsim and run. Then you
may check the file dataout.txt for the output.
 
The two procedures

file_open(file F : bestand;
External_Name : in STRING;
Open_Kind : in FILE_OPEN_KIND := READ_MODE);
and
file_open(Status : out FILE_OPEN_STATUS;
file F : bestand;
External_Name : in STRING;
Open_Kind : in FILE_OPEN_KIND := READ_MODE);


are implicitly defined when the file type "bestand" is declared.
So the call to file_open() will compile with no problems.


There is no visible procedure "writeline()" that takes a FILE object of
type "bestand". The package STD.TEXTIO defines only a procedure thus:

writeline(file F : text, L : inout LINE);

which will work only for a FILE actual parameter of type "text".
 

Welcome to EDABoard.com

Sponsor

Back
Top