title: How do I access an array element using a variable as index?
body: <p>I'm trying to access an element from an array using an input as index and I keep getting this error:</p>
  
  <blockquote>
    <p>cache.v:27: error: array 'tagc' index must be a constant in this context.</p>
  </blockquote>
  
  <p>Here's how I'm trying to do it:</p>
  
  <pre><code>assign tagc[index] = tag;
  </code></pre>
  
  <p>tagc is an array of 1024 regs; index is a 10 bits input; tag is a 20 bits input.</p>
  
  <p>Is there a way to do that?</p>