4
44mc44
Guest
Hi
I would like to read data from the binary file.
I have written the following code:
LIBRARY IEEE;
use IEEE.std_logic_1164.all, IEEE.numeric_std.all;
entity io is
port
(
clk : in std_logic;
ena : in std_logic;
Q : out std_logic_vector (7 downto 0 )
);
end entity io;
architecture czytaj of io is
type log_file is file of std_logic_vector (7 downto 0);
file my_file : log_file;
begin
process (clk, ena)
variable my_byte : std_logic_vector (7 downto 0);
begin
file_open( my_file, "F:\cyfry\train-images.idx3-ubyte", read_mode);
if rising_edge(clk) then
if ena = '1' then read(my_file, my_byte);
end if;
end if;
Q <= my_byte;
end process;
end architecture czytaj ;
I tasted it in ModelSim but i was suprised by the values of Q : (for
example )
(U, U, ?(23), ?(78), U, U , U, ?(106))
What do I wrong? Why values of Q are so strange?
Please help me solve this mistery.
Regards
MichaĹ
I would like to read data from the binary file.
I have written the following code:
LIBRARY IEEE;
use IEEE.std_logic_1164.all, IEEE.numeric_std.all;
entity io is
port
(
clk : in std_logic;
ena : in std_logic;
Q : out std_logic_vector (7 downto 0 )
);
end entity io;
architecture czytaj of io is
type log_file is file of std_logic_vector (7 downto 0);
file my_file : log_file;
begin
process (clk, ena)
variable my_byte : std_logic_vector (7 downto 0);
begin
file_open( my_file, "F:\cyfry\train-images.idx3-ubyte", read_mode);
if rising_edge(clk) then
if ena = '1' then read(my_file, my_byte);
end if;
end if;
Q <= my_byte;
end process;
end architecture czytaj ;
I tasted it in ModelSim but i was suprised by the values of Q : (for
example )
(U, U, ?(23), ?(78), U, U , U, ?(106))
What do I wrong? Why values of Q are so strange?
Please help me solve this mistery.
Regards
MichaĹ