mirror of
https://github.com/ParkerTenBroeck/hdl_sim.git
synced 2026-06-07 05:28:45 -04:00
added support for local editing with different editor
This commit is contained in:
parent
3cce2983a5
commit
0289d1171f
11 changed files with 2252 additions and 1096 deletions
29
src/dram.vhdl
Normal file
29
src/dram.vhdl
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
library ieee;
|
||||
use ieee.std_logic_1164.all;
|
||||
use ieee.numeric_std.all;
|
||||
|
||||
entity ram_8x256 is
|
||||
Port (
|
||||
clk : in std_logic;
|
||||
we : in std_logic; -- write enable
|
||||
addr : in unsigned(7 downto 0); -- 8-bit address
|
||||
din : in unsigned(7 downto 0); -- data input
|
||||
dout : out unsigned(7 downto 0) -- data output
|
||||
);
|
||||
end ram_8x256;
|
||||
|
||||
architecture Behavioral of ram_8x256 is
|
||||
type ram_type is array (0 to 255) of unsigned(7 downto 0);
|
||||
signal ram : ram_type := (others => x"AB");
|
||||
begin
|
||||
process(clk)
|
||||
begin
|
||||
if rising_edge(clk) then
|
||||
if we = '1' then
|
||||
ram(to_integer(unsigned(addr))) <= din;
|
||||
end if;
|
||||
|
||||
dout <= ram(to_integer(unsigned(addr)));
|
||||
end if;
|
||||
end process;
|
||||
end Behavioral;
|
||||
Loading…
Add table
Add a link
Reference in a new issue