| 1 |
-- dual_port_RAM_visualTest.vhd |
| 2 |
|
| 3 |
-- created by : Meher Krishna Patel |
| 4 |
-- date : 26-Dec-16 |
| 5 |
|
| 6 |
-- Functionality: |
| 7 |
-- store and retrieve data from dual port RAM |
| 8 |
|
| 9 |
-- ports: |
| 10 |
-- Write Enable (we) : SW[16] |
| 11 |
-- Address (addr_wr) : SW[15-14] |
| 12 |
-- Address (addr_rd) : SW[13-12] |
| 13 |
-- din : SW[2:0] |
| 14 |
-- dout : LEDR |
| 15 |
|
| 16 |
use ieee.numeric_std.all;library ieee; |
| 17 |
use ieee.std_logic_1164.all; |
| 18 |
use ieee.numeric_std.all; |
| 19 |
|
| 20 |
entity dual_port_RAM_visualTest is |
| 21 |
generic ( |
| 22 |
ADDR_WIDTH : integer := 2; |
| 23 |
DATA_WIDTH : integer := 3 |
| 24 |
); |
| 25 |
|
| 26 |
port( |
| 27 |
CLOCK_50: in std_logic; |
| 28 |
SW : in std_logic_vector(16 downto 0); |
| 29 |
LEDR : out std_logic_vector(DATA_WIDTH-1 downto 0) |
| 30 |
); |
| 31 |
end dual_port_RAM_visualTest; |
| 32 |
|
| 33 |
architecture arch of dual_port_RAM_visualTest is |
| 34 |
begin |
| 35 |
dual_port_RAM_test: entity work.dual_port_RAM |
| 36 |
port map (clk=>CLOCK_50, we=>SW(16), |
| 37 |
addr_wr => SW(15 downto 14), |
| 38 |
addr_rd => SW(13 downto 12), |
| 39 |
din => SW(2 downto 0), |
| 40 |
dout =>LEDR); |
| 41 |
end arch; |
| 42 |
|
| 43 |
-- From https://vhdlguide.readthedocs.io/en/latest/vhdl/dex.html |
| 44 |
|