title: Syntax for looping through lower dimension of multidimensional associative array in a constraint
body: <pre><code>class ns_data_struct;
    rand bit [63:0] ns_size = 64'h0000_0000_0000_0800;
  endclass : ns_data_struct
  
  class conf;
    ns_data_struct ns_data[];
  
    function new();
      ns_data = new[5];
      foreach (ns_data[i])
        ns_data[i] = new();
    endfunction
  endclass : conf
  
  class x;
    randc bit [63:0] slba;
    randc bit [63:0] nlb;
    bit [63:0] slba_previous [bit [31:0]][bit [63:0]];
    conf cfg;
    bit [31:0] nsid = 'h1;
    bit [63:0] num [bit [31:0]];
  
    constraint slba_nlb_inside_ns_c
    {
      slba inside {[1:cfg.ns_data[nsid-1].ns_size]};
      nlb inside {[0:(cfg.ns_data[nsid-1].ns_size - slba)]};
    }
  
    constraint slba_nlb_non_overlapping_c
    {
      foreach(slba_previous[nsid, i])
      {
        if(!(i%2))
        {
          slba &lt; slba_previous[nsid][i] -&gt; (slba + nlb) &lt; slba_previous[nsid]  [i];
          slba &gt; slba_previous[nsid][i] -&gt; slba &gt; slba_previous[nsid][i+1]; //  &lt;-- Warning Here
          slba &gt; slba_previous[nsid][i+1] -&gt; (slba + nlb) &gt;   slba_previous[nsid][i+1]; //  &lt;-- Warning Here
          slba &lt; slba_previous[nsid][i+1] -&gt; slba &lt; slba_previous[nsid][i]; //  &lt;-- Warning Here
        }
      }
    }
  
    function void post_randomize();
      num[nsid] = (num.exists(nsid))?(num[nsid]):0;
  
      slba_previous[nsid][num[nsid]++] = slba;
      slba_previous[nsid][num[nsid]++] = (slba + nlb);
  
      $display("\nslba_previous - %p\n", slba_previous);
    endfunction
  
    function new (input conf _cfg);
      this.cfg = _cfg;
    endfunction: new
  endclass : x
  
  program p1;
    conf c;
    x t;
  
    initial
    begin
      c = new;
      t = new(c);
      t.nsid = 3;
      for(int i=0; i&lt;15; i++)
      begin
        if(!t.randomize())
          $display("ERROR : Starting LBA &amp; NLB Provider Randomization  Failed");
        $display("@%0t : KARAN, Starting LBA - %0h %0d", $time, t.slba, t.slba);
        $display("@%0t : KARAN, Number of LBA - %0h %0d", $time, t.nlb,  t.nlb);
      end
    end
  endprogram
  </code></pre>
  
  <p>In this code, I am facing 2 issues in QuestaSIM.</p>
  
  <ol>
  <li><p>In the constraint, I have used (i%2), still it is showing this warning:</p>
  
  <blockquote>
    <p>Warning : (vsim-3829) Non-existent associative array entry. Returning default value. </p>
  </blockquote></li>
  <li><p>How to loop through lower dimension in 2 dimensional associative array in a constraint? <code>foreach(slba_previous[, i])</code> is not working.</p></li>
  </ol>