Constraint for one hot encoded vectors in SV

Hi Dave,

I tried to this using a dynamic array but, it is not working for me. IN EDA playground it is timing out. Not sure if there is any issue in my constraint. I should try this probably in my work place environment and, see as well.

This is getting timed out after a min or 2. Is this some stack mem limitation of EDA Tools that is using Synopsys VCS 2014.

module top;
  class A;
    rand bit [24:0] vector[];
    constraint one_hot {
       vector.size() == 25;
      foreach(vector[i])
        $countones(vector[i]) == 1;
    }
    
    constraint c_uniq  {
        unique {vector};
       
    }
    
  endclass
 
  //A h;
module top ();
  initial begin
    A h = new;
    //repeat (25) begin
       assert (h.randomize());
       $displayb(h.vector);
    //end
  end
endmodule