In reply to dave_59:
Hi Dave ,
I used the check for Non-Zero Size to make sure that sum() Constraint gets solved after the 2 Size Constraints .
I missed out on the fact that SV implicitly gives us the feature such that Size() Constraints get Implicitly Solved before sum() Constraint ( Reduction Operation ) . So the Check for size() > 0 isn’t really needed .
I noticed that Arr.sum(item) with ( item.sum() with ( int’(item) ) ) works in a Procedural Code like Module level function and initial blocks whereas none of the 3 Major Vendors have support for it ( Tried it on the Latest version for all 3 Simulators ) when using it in a Constraint ( which is Declarative rather than procedural , Hence the { } ) .
So I tried using it in a function called within a Constraint ( FUNCTN_SUM above ) but it still gives a Failure . Need your suggestions regarding it
For 1 Dimensional Unpacked Arrays ::
constraint SUMM { A.sum() with ( int'item) ) == 7 ; }
works fine but I run into trouble when i try the same for 2D Unpacked Arrays .
So I asked whether there’s an alternative for
A.sum() with ( int’(item ) so that it can be Extended and used for 2D Unpacked Arrays as well