alierossi
Newbie level 6
anyone know how to call data from .txt using vhdl code?
i have develop a rom that store data like below....
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_signed.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity sss is
Port (
clk : in STD_LOGIC;
e : in STD_LOGIC;
r : in STD_LOGIC;
data_out : out STD_LOGIC_vector (7 downto 0)
);
end entity sss;
architecture rtl of sss is
signal i : integer range 0 to 999:=0;
signal enable : std_logic:='0';
signal data : std_logic_vector (7 downto 0);
BEGIN
process (e)
begin
if e'event and e = '1' then
enable <= '1';
end if;
end process;
process ( clk)
begin
if rising_edge (clk) then
if (enable = '1') then
i <= i + 1;
end if;
end if;
end process;
process (clk)
begin
if rising_edge (clk) then
case i is
when 0 => data <= "10111100"; --value
when 1 => data <= "11011001";
when 2 => data <= "00000111";
when 3 => data <= "10101000";
when 4 => data <= "10101001";
when 5 => data <= "10101000";
when 6 => data <= "10101011";
when 7 => data <= "10110010";
-- .... until 1000
end case;
end if;
end process;
i have create .txt file that have the value in a column. how can i call the .text file to put in my rom. so that i must not fill 1000 case address for 1000 value like above code. please help.urgent.
i have develop a rom that store data like below....
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_signed.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity sss is
Port (
clk : in STD_LOGIC;
e : in STD_LOGIC;
r : in STD_LOGIC;
data_out : out STD_LOGIC_vector (7 downto 0)
);
end entity sss;
architecture rtl of sss is
signal i : integer range 0 to 999:=0;
signal enable : std_logic:='0';
signal data : std_logic_vector (7 downto 0);
BEGIN
process (e)
begin
if e'event and e = '1' then
enable <= '1';
end if;
end process;
process ( clk)
begin
if rising_edge (clk) then
if (enable = '1') then
i <= i + 1;
end if;
end if;
end process;
process (clk)
begin
if rising_edge (clk) then
case i is
when 0 => data <= "10111100"; --value
when 1 => data <= "11011001";
when 2 => data <= "00000111";
when 3 => data <= "10101000";
when 4 => data <= "10101001";
when 5 => data <= "10101000";
when 6 => data <= "10101011";
when 7 => data <= "10110010";
-- .... until 1000
end case;
end if;
end process;
i have create .txt file that have the value in a column. how can i call the .text file to put in my rom. so that i must not fill 1000 case address for 1000 value like above code. please help.urgent.