title: RAM to read/write in VHDL
body: <p>I'm trying to use RAM in order to read/write. My address is an integer value and it should be a memory of integers. This is my code below but i keep getting an error.</p>
  
  <p>This is from my data path where the address selection is from a register of integers.</p>
  
  <p>Code:</p>
  
  <pre><code>    library ieee;
  use ieee.std_logic_1164.all;
  use ieee.std_logic_arith.all;
  use ieee.std_logic_unsigned.all;
  
  entity Mem is
  generic(    width:  integer:=4;
          depth:  integer:=4;
          addr:   integer:=2);
  port(   Clock:      in std_logic;   
      Enable:     in std_logic;
      Read:       in std_logic;
      Write:      in std_logic;
      Read_Addr:  in integer;
      Write_Addr:     in integer; 
      Data_in:    in integer;
      Data_out:   out integer
  );
  end Mem;
  
  --------------------------------------------------------------
  
  architecture behav of Mem is
  
  type ram_type is array (0 to 31) of 
      integer;
  signal tmp_ram: ram_type;
  
  begin   
  
      -- Read Functional Section
      process(Clock, Read)
      begin
      if (Clock'event and Clock='1') then
          if Enable='1' then
          if Read='1' then
              -- buildin function conv_integer change the type
              -- from std_logic_vector to integer
              Data_out &lt;= tmp_ram(conv_integer(Read_Addr)); 
          else
              Data_out &lt;= (Data_out'range =&gt; 'Z');
          end if;
          end if;
      end if;
      end process;
  
      -- Write Functional Section
      process(Clock, Write)
      begin
      if (Clock'event and Clock='1') then
          if Enable='1' then
          if Write='1' then
              tmp_ram(conv_integer(Write_Addr)) &lt;= Data_in;
          end if;
          end if;
      end if;
      end process;
  
  end behav;
  ----------------------------------------------------------------
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Error (10514): VHDL aggregate error at Mem.vhd(41): can't determine type of aggregate -- found 0 possible types
  </code></pre>