- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm trying to read a text file with VHDL to generate some automatic input codes. I made a project just to test this entity, but my output is always with value 'Z'. my text file contains only one line and the line contains this "11111111" Observation : the cod.txt was created with QuartusII and is included to the project! i think quartus can't open or read the file or something like that thanks in advancelibrary std;
library ieee;
use std.textio.all;
use ieee.std_logic_1164.all;
entity readfile is
port(clock : in std_logic;
--output : out std_logic_vector(7 downto 0);
output : out std_logic
);
end readfile;
architecture logic of readfile is
--signal aux: std_logic_vector(7 downto 0);
begin
process(clock)
variable inline:line;
variable character_variable:character;
variable end_of_line:boolean;
file myfile:text is "cod.txt";
begin
if(clock'event and clock = '1') then
readline(myfile,inline);
read(inline,character_variable,end_of_line);
for i in 0 to 7 loop
read(inline,character_variable,end_of_line);
case character_variable is
when '0' =>
output <= '0';
when '1' =>
output <= '1';
when others =>
output <= 'Z';
end case;
end loop;
--output <= aux;
end if;
end process;
end logic;
Link Copied
- « Previous
-
- 1
- 2
- Next »
23 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ohhhhhhhhhhhhhhhhh
so the problem is the Quartus Software... the modelSim from altera can read it then?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- the modelSim from altera can read it then? --- Quote End --- Read the above posts... everything has been said. P.S.: The Atera edition has all basic ModelSim features.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks eveyrone for this big help!

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »