Constraint with variable distribution

In reply to brab:

One issue with code is ::

int [9:0] weight_box ={10,5,5,7,3,5,5,10,10,50}; // Illegal .

Should be ::


bit [9:0] weight_box[$] = '{10,5,5,7,3,5,5,10,10,50} ; 

With the constraint , I do notice an issue . Will update

https://verificationacademy.com/verification-horizons/june-2014-volume-10-issue-2/Use-of-Iterative-Weight-Age-Constraint-to-Implement-Dynamic-Verification-Components

mentions using unpacked array elements both as weight as well as values .
Even the code given under " iterative weight-age constraint " doesn’t work ( Seems like the 2 authors didn’t verify the code )