aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue1781/simple3.vhdl
blob: fda848b5b708ff5da9c52f31ce7090104481a53b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity imem2a is
  port (
    clk_i  : in  std_ulogic;
    addr_i : in  std_ulogic_vector(30 downto 0);
    data_i : in  std_ulogic_vector(15 downto 0);
    data_o : out std_ulogic_vector(15 downto 0)
  );
end entity;

architecture notok of imem2a is
  type ram_t is array(0 to 2**8-1) of std_ulogic_vector(15 downto 0);
begin
  process(clk_i)
    variable memory : ram_t;
  begin
    if rising_edge(clk_i) then
      memory(to_integer(unsigned(addr_i))) := data_i;
      data_o <= memory(to_integer(unsigned(addr_i)));
    end if;
  end process;
end architecture;