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
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 )