I was trying to understand the basics of Coverpoint expression ::
bit [3:0] a ;
covergroup cg_exp ;
a_auto : coverpoint a ;
a_sum : coverpoint ( a.sum() with ( 32'( item ) ) ) // Valid ??
bins less_than_50 = a_sum with ( item < 50 ) ;
bins equal_to_50 = a_sum with ( item == 50 ) ;
bins greater_than_50 = a_sum with ( item > 50 ) ;
LRM 2017 , Section 19.5 Defining coverage points :: " A coverage point specifies an integral expression that is to be covered."
So coverpoint ' a_auto ' would be Illegal .
Array Reduction method reduces an unpacked array to a single value .
[Q1] So coverpoint ' a_sum ' would be Legal , right ? ( I Observe Compilation Issue on some Simulators )
[Q2] Any possible alternative for coverpoint ' a_sum ' ?