BlinkenArea - GitList
Repositories
Blog
Wiki
mips_sys
Code
Commits
Branches
Tags
Search
Tree:
b5b070d
Branches
Tags
master
mips_sys
system
dpram.vhd
implented basic system with core, instr memory, data memory
Stefan Schuermans
commited
b5b070d
at 2012-02-06 21:28:00
dpram.vhd
Blame
History
Raw
LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.NUMERIC_STD.ALL; ENTITY e_dpram IS GENERIC ( addr_width: natural; data_width: natural ); PORT ( clk: IN std_logic; i_rd_addr: IN std_logic_vector(addr_width - 1 DOWNTO 0); o_rd_data: OUT std_logic_vector(data_width - 1 DOWNTO 0); i_wr_addr: IN std_logic_vector(addr_width - 1 DOWNTO 0); i_wr_data: IN std_logic_vector(data_width - 1 DOWNTO 0); i_wr_en: IN std_logic ); END ENTITY e_dpram; ARCHITECTURE a_dpram OF e_dpram IS SUBTYPE t_addr IS std_logic_vector(addr_width - 1 DOWNTO 0); SUBTYPE t_data IS std_logic_vector(data_width - 1 DOWNTO 0); TYPE t_buf IS ARRAY(0 TO 2 ** addr_width - 1) OF t_data; SIGNAL s_buf: t_buf; BEGIN p_dpram: PROCESS(clk) BEGIN IF rising_edge(clk) THEN IF i_wr_en = '1' THEN s_buf(to_integer(unsigned(i_wr_addr))) <= i_wr_data; END IF; o_rd_data <= s_buf(to_integer(unsigned(i_rd_addr))); END IF; END PROCESS p_dpram; END ARCHITECTURE a_dpram;