aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/mem01/rom1.vhdl
blob: 6b8245f30eeaee52f13fe483046f49ad2bc3720b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity rom1 is
  port (addr : std_logic_vector (3 downto 0);
        val : out std_logic_vector (7 downto 0));
end rom1;

architecture behav of rom1 is
  type t_myrom is array (0 to 15) of std_logic_vector (7 downto 0);
  constant myrom : t_myrom :=
    (x"00", x"01", x"02", x"03",
     x"40", x"41", x"42", x"43",
     x"f8", x"f9", x"fa", x"fb",
     x"fc", x"fd", x"fe", x"ff");
begin
  val <= myrom (to_integer(unsigned(addr)));
end behav;