title: Indexing arrays in VHDL
body: <p>I have an array:  </p>
  
  <pre><code>type offsets_type is array (4 downto 0) of std_logic_vector (4 downto 0); 
  signal av     : offsets_type;
  </code></pre>
  
  <p>I want to do this, essentially: <code>av[addr] += 1;</code><br>
  But this line:</p>
  
  <pre><code> av(to_integer(unsigned(addr))) &lt;= unsigned(av(to_integer(unsigned(addr))) + 1;
  </code></pre>
  
  <p>yields this error:<br>
  <code>to_integer can not have such operands in this context.</code></p>
  
  <p>I've also tried using <code>conv_integer</code>, but that gives <code>Wrong type of index</code> as an error.</p>
  
  <p>Any solutions? Thanks.</p>