Err - A reference to a rand variable in an array index is not currently supported in this context

In reply to yakirye:

Without a complete example showing your issue, it’s difficult to make any recommendations.

It seems that you are trying to impose a constraint in the post_randomize() function which needs to be utilized in the main randomize() call. What about the case where cls_out_doq_active_reg is all 0’s? It is impossible to randomize tmp_hw2sw_ring to a valid value if this occurs.

If you post your entire class and what you are trying to accomplish, perhaps a better approach could be provided.