chat
Member level 5
hi all !
i have made a part of a program to read a text file from a specified location , and i want to store it an array .. i don't know how to do this...please help me..
here is the code for reading a file..
i have made a part of a program to read a text file from a specified location , and i want to store it an array .. i don't know how to do this...please help me..
here is the code for reading a file..
Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.std_logic_textio.all;
Port ( adr: in std_logic_vector(7 downto 0);
data : out std_logic_vector(11 downto 0);
clk: in std_logic);
end rom;
architecture Behavioral of rom is
file datafile: text is "c:\read.txt";
type memorytype is array(0 to 255) of std_logic_vector(11 downto 0);
signal rom: memorytype;
signal integer_address: integer range 0 to 255;
begin
clkedge: process(clk)
begin
if rising_edge(clk) then
integer_address <= to_integer(adr);
end if;
end process clkedge;
end Behavioral;