MSAKARIM
Full Member level 3
What the best way to store data of size ( 90,000 * 32) bit (taken from a text file)?
I have a database (in a text file )of size ( 90,000 * 32), I want to know, what is the most effective way to store them, and then I compare this database with some input data to check if there is any matching.
I tried to solve this by storing them inside 14 RAMs instead of one, but it takes a very long time while synthesis (more than 24 hours) is that normal or my code has a problem.
I have a database (in a text file )of size ( 90,000 * 32), I want to know, what is the most effective way to store them, and then I compare this database with some input data to check if there is any matching.
I tried to solve this by storing them inside 14 RAMs instead of one, but it takes a very long time while synthesis (more than 24 hours) is that normal or my code has a problem.
Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
USE IEEE.STD_LOGIC_TEXTIO.ALL;
USE STD.TEXTIO.ALL;
entity List_0 is
Port ( clk : in STD_LOGIC;
din : in STD_LOGIC_VECTOR (31 downto 0);
dout : out STD_LOGIC_VECTOR (31 downto 0);
Match : out STD_LOGIC);
end List_0;
architecture Behavioral of List_0 is
type TRam is array(0 to 3871) of std_logic_vector(31 downto 0);
impure function init_bram (ram_file_name : in string) return TRam is
file ramfile : text ;
variable line_read : line;
variable ram_to_return : TRam;
begin
file_open(ramfile,"F:\RAM_0.txt",READ_MODE);
--while not endfile(ramfile) loop
for i in TRam'range loop
readline(ramfile, line_read);
hread(line_read, ram_to_return(i));
end loop;
--end loop;
return ram_to_return;
end function;
signal Ram : TRam := init_bram("F:\RAM_0.txt");
begin
process (clk)
begin
if (clk'event and clk = '1') then
for i in 0 to 3871 loop
if (din = Ram(i))then
match <= '1';
report "Matching Happened!";
exit;
else
match <= '0';
end if;
dout <= Ram(i);
end loop;
end if;
end process;
end Behavioral;