title: Invalid index in cross-module reference
body: <p>below is the code snippet of my top_file</p>
  
  <pre><code>`define NUM_SENSORS 2;
  
  module test_top();
  
    svt_configuration multiple_top_cfg[`NUM_SENSORS]; // configuration class instance
  
    svt_xmtr_if xmtr_if[`NUM_OF_SENSORS]();  // interface instance
    svt_rcvr_if rcvr_if[`NUM_OF_SENSORS](); 
  
    always begin
      fork
        change_clock_speed();
      join_none
    end
  
    task automatic change_clock_speed();
  
      for(i=0; i&lt;`NUM_OF_SENSORS; i++) begin
        wait(multiple_top_cfg[i] != null);
        @(multiple_new_dphy_ui[i]) begin 
          if(multiple_top_cfg[i].xmtr_cfg.lane_cfg.clock_type == svt_mipi_lane_configuration::NON_CONTINUOUS) begin
            wait({xmtr_if[i].serial_if.serial_tx_clk_if.dp,xmtr_if[i].serial_if.serial_tx_clk_if.dn} === 2'b11);
          end
          else begin
            if(multiple_top_cfg[i].xmtr_cfg.lane_cfg.clock_type == svt_mipi_lane_configuration::CONTINUOUS) begin
              wait({xmtr_if[i].serial_if.serial_if[0].dp,xmtr_if[i].serial_if.serial_if[0].dn} === 2'b11);
            end
          end
          multiple_change_dphy_ui[i] = 1;   //  this is a local reg
          multiple_tx_clock_period[i] = multiple_new_dphy_ui[i]; // this is a local reg
          multiple_quadrature[i] = multiple_new_dphy_ui[i];  // this is a local reg
        end
      end
  
    endtask
    // ... other lines
  endmodule
  </code></pre>
  
  <p>When i am running my test, i am getting this error :</p>
  
  <p><code>Error-[IIXMR] Invalid index in cross-module reference
  top.serial.sv, 311
    Invalid index in cross-module reference due to index is not constant.
    Argument: xmtr_if[i].serial_if.serial_tx_clk_if.dp
    Source info: : wait (({xmtr_if[i].serial_if.serial_tx_clk_if.dp,
    xmtr_if[i].serial_if.serial_tx_clk_if.dn} === 2'b11))</code></p>
  
  <p>I understand why this error is coming, but i don't have any solution to it... can any one help...</p>
  
  <p>I tried to put the always block inside <code>generate</code> block. But another error is coming. 
  Any solution to this error please...</p>
  
  <p>Thanks,
  Biren</p>