Line 9... |
Line 9... |
--
|
--
|
-- Description : Single Port Synchronous Random Access Memory
|
-- Description : Single Port Synchronous Random Access Memory
|
--
|
--
|
----------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------
|
|
|
LIBRARY ieee;
|
library ieee;
|
USE ieee.std_logic_1164.ALL;
|
use ieee.std_logic_1164.all;
|
USE ieee.std_logic_unsigned.ALL;
|
use ieee.std_logic_unsigned.all;
|
|
|
LIBRARY mblite;
|
library mblite;
|
USE mblite.std_Pkg.ALL;
|
use mblite.std_Pkg.all;
|
|
|
ENTITY sram_init IS GENERIC
|
entity sram_init is generic
|
(
|
(
|
WIDTH : integer := 32;
|
WIDTH : integer := 32;
|
SIZE : integer := 11
|
SIZE : integer := 11
|
);
|
);
|
PORT
|
port
|
(
|
(
|
dat_o : OUT std_logic_vector(WIDTH - 1 DOWNTO 0);
|
dat_o : out std_logic_vector(WIDTH - 1 downto 0);
|
dat_i : IN std_logic_vector(WIDTH - 1 DOWNTO 0);
|
dat_i : in std_logic_vector(WIDTH - 1 downto 0);
|
adr_i : IN std_logic_vector(SIZE - 1 DOWNTO 0);
|
adr_i : in std_logic_vector(SIZE - 1 downto 0);
|
wre_i : IN std_logic;
|
wre_i : in std_logic;
|
ena_i : IN std_logic;
|
ena_i : in std_logic;
|
clk_i : IN std_logic
|
clk_i : in std_logic
|
);
|
);
|
END sram_init;
|
end sram_init;
|
|
|
ARCHITECTURE arch OF sram_init IS
|
architecture arch of sram_init is
|
TYPE ram_type IS array (0 TO 2 ** SIZE - 1) OF std_logic_vector(WIDTH - 1 DOWNTO 0);
|
type ram_type is array (0 to 2 ** SIZE - 1) of std_logic_vector(WIDTH - 1 downto 0);
|
SIGNAL ram : ram_type := (
|
signal ram : ram_type := (
|
X"B8080050",X"00000000",X"B8080728",X"00000000",X"B8080738",X"00000000",X"00000000",X"00000000",
|
X"B8080050",X"00000000",X"B8080728",X"00000000",X"B8080738",X"00000000",X"00000000",X"00000000",
|
X"B8080730",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",
|
X"B8080730",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",
|
X"00000000",X"00000000",X"00000000",X"00000000",X"31A01028",X"30400F18",X"B0000000",X"30209038",
|
X"00000000",X"00000000",X"00000000",X"00000000",X"31A01028",X"30400F18",X"B0000000",X"30209038",
|
X"B9F400C0",X"80000000",X"B9F406E8",X"30A30000",X"B8000000",X"E0601028",X"3021FFE4",X"F9E10000",
|
X"B9F400C0",X"80000000",X"B9F406E8",X"30A30000",X"B8000000",X"E0601028",X"3021FFE4",X"F9E10000",
|
X"BC030014",X"B8000040",X"F8600F20",X"99FC2000",X"80000000",X"E8600F20",X"E8830000",X"BE24FFEC",
|
X"BC030014",X"B8000040",X"F8600F20",X"99FC2000",X"80000000",X"E8600F20",X"E8830000",X"BE24FFEC",
|
Line 292... |
Line 292... |
X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",
|
X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",
|
X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",
|
X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",
|
X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",
|
X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",
|
X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000");
|
X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000",X"00000000");
|
|
|
BEGIN
|
begin
|
PROCESS(clk_i)
|
process(clk_i)
|
BEGIN
|
begin
|
IF rising_edge(clk_i) THEN
|
if rising_edge(clk_i) then
|
IF notx(adr_i) AND ena_i = '1' THEN
|
if notx(adr_i) and ena_i = '1' then
|
IF wre_i = '1' THEN
|
if wre_i = '1' then
|
ram(my_conv_integer(adr_i)) <= dat_i;
|
ram(my_conv_integer(adr_i)) <= dat_i;
|
END IF;
|
end if;
|
dat_o <= ram(my_conv_integer(adr_i));
|
dat_o <= ram(my_conv_integer(adr_i));
|
END IF;
|
end if;
|
END IF;
|
end if;
|
END PROCESS;
|
end process;
|
END arch;
|
end arch;
|
|
|
No newline at end of file
|
No newline at end of file
|