help with file I/O and generic constants

B

bister

Guest
Hello,

I want to use a generic constant to pass the file name to the
following VHDL program but this type casting is killing me. Any help
with this would be greatly appreciated.


entity eprom is
generic (hex_file_name : text); <------ I want the file name to be
passed in the generic map here
port
(
.........

architecture behav_eprom of eprom is

file hex_file : text is in "/home/nelsob/d5/rtl/eeprom/npp55a.hex" ;
<--- this is what I have now that
works
but is a hard coded file name

........

begin
c_rom <= (others => 255 );
v_fileend := false;
while (not ( ENDFILE(hex_file) or v_fileend )) loop <---- this
is where it is used
-- while ((not ENDFILE(hex_file)) ) loop
READLINE(hex_file, in_text);

Thanks,
 
"bister" <bobw.nelson@comcast.net> wrote in message
news:a9c82e21-03d6-4831-b3e7-63dded5cd4cf@i7g2000prf.googlegroups.com...
Hello,

I want to use a generic constant to pass the file name to the
following VHDL program but this type casting is killing me. Any help
with this would be greatly appreciated.


entity eprom is
generic (hex_file_name : text); <------ I want the file name to be
You need 'hex_file_name' to be type 'string' above and then do the file
opening and closing down in the architecture.

passed in the generic map here
port
(
........

architecture behav_eprom of eprom is

file hex_file : text is in "/home/nelsob/d5/rtl/eeprom/npp55a.hex" ;
Use the file_open function passing it in 'hex_file_name'.

KJ
 
"KJ" <kkjennings@sbcglobal.net> wrote in message
news:hSYdj.2312$El5.1441@newssvr22.news.prodigy.net...
"bister" <bobw.nelson@comcast.net> wrote in message
news:a9c82e21-03d6-4831-b3e7-63dded5cd4cf@i7g2000prf.googlegroups.com...
Hello,

I want to use a generic constant to pass the file name to the
following VHDL program but this type casting is killing me. Any help
with this would be greatly appreciated.


entity eprom is
generic (hex_file_name : text); <------ I want the file name to be

You need 'hex_file_name' to be type 'string' above and then do the file
opening and closing down in the architecture.

passed in the generic map here
port
(
........

architecture behav_eprom of eprom is

file hex_file : text is in "/home/nelsob/d5/rtl/eeprom/npp55a.hex" ;

Use the file_open function passing it in 'hex_file_name'.
Forgot to add a link to the FAQ for VHDL language questions.

http://tams-www.informatik.uni-hamburg.de/vhdl/doc/faq/FAQ1.html

KJ
 
On Dec 30, 9:15 pm, "KJ" <kkjenni...@sbcglobal.net> wrote:
"KJ" <kkjenni...@sbcglobal.net> wrote in message

news:hSYdj.2312$El5.1441@newssvr22.news.prodigy.net...





"bister" <bobw.nel...@comcast.net> wrote in message
news:a9c82e21-03d6-4831-b3e7-63dded5cd4cf@i7g2000prf.googlegroups.com...
Hello,

I want to use a generic constant to pass the file name to the
following VHDL program but this type casting is killing me. Any help
with this would be greatly appreciated.

entity eprom is
generic (hex_file_name : text); <------ I want the file name to be

You need 'hex_file_name' to be type 'string' above and then do the file
opening and closing down in the architecture.

passed in the generic map here
port
(
........

architecture behav_eprom of eprom is

file hex_file : text is in "/home/nelsob/d5/rtl/eeprom/npp55a.hex" ;

Use the file_open function passing it in 'hex_file_name'.

Forgot to add a link to the FAQ for VHDL language questions.

http://tams-www.informatik.uni-hamburg.de/vhdl/doc/faq/FAQ1.html

KJ
Thanks for the help. With the link to the FAQ and your suggestion to
use file opening I got it to work.

--RWN
 

Welcome to EDABoard.com

Sponsor

Back
Top