In reply to dave_59:
I appreciate the help, maybe this example will explain want I need better.
Say I am crossing the following coverpoints: c_type, c1_state, c1_mode, c1_select, c2_state, c2_mode, c2_select. These cover the registers of the same name so each value of reg_type has its own value for the reg1 and reg2. However, when either reg1_state or reg2_state is off, I don’t care about the value in the respective mode and select registers. To cover this, I need to cross all coverpoints and define explicit bins for reg1_state.off and reg2_state.off. However, because each value of reg_type has its own reg1 and reg2, I need the explicit bins for reg1_state.off and reg2_state.off to remain crossed with reg_type. Defining explicit bins as below will not be able to do this.
c_type : coverpoint reg_type {
bins type_0 = {0};
bins type_1 = {1};
bins type_2 = {2};
}
c1_state : coverpoint reg1_state {
bins off = {0};
bins on = {1};
}
c1_mode : coverpoint reg1_mode {
bins mode_0 = {0};
bins mode_1 = {1};
bins mode_2 = {2};
bins mode_3 = {3};
}
c1_select : coverpoint reg1_select {
bins sel_0 = {0};
bins sel_1 = {1};
bins sel_2 = {2};
}
c2_state : coverpoint reg2_state {
bins off = {0};
bins on = {1};
}
c2_mode : coverpoint reg2_mode {
bins mode_0 = {0};
bins mode_1 = {1};
bins mode_2 = {2};
bins mode_3 = {3};
bins mode_4 = {4};
}
c2_select : coverpoint reg2_select {
bins sel_0 = {0};
bins sel_1 = {1};
bins sel_2 = {2};
bins sel_3 = {3};
}
typeXstate1Xmode1Xsel1Xstate2Xmode2Xsel2: cross c_type, c1_state, c1_mode, c1_select, c2_state, c2_mode, c2_select {
// autocross covers all points for c1_state.on and c2_state.on correctly
bins reg1_off = binsof(c1_state.off); // this lumps all points with c1_state.off to one point, it does not maintain cross with c_type
bins reg2_off = binsof(c2_state.off); // this lumps all points with c2_state.off to one point, it does not maintain cross with c_type
}
The above cross will create:
c1 on/c2 on c1 off/c2 off
3 x (4 x 3) x (5 x 4) + 2 coverpoints
I need:
c1 on/c2 on c1 on/c2 off c2 off/c2 on c1 off/c2 off
3 x (4 x 3) x (5 x 4) + 3 x (4 x 3) + 3 x (5 x 4) + 3 x 2 coverpoints
I can split c1_state and c2_state to separate coverpoints: c1_state_on, c1_state_off, c2_state_on, c2_state_off. However then I will need to make a separate cross for each combination: (c1_state_on, c2_state_on), (c1_state_on, c2_state_off), (c1_state_off, c2_state_on), (c1_state_off, c2_state_off). And for each additional register added in the cross that has on/off toggle, you’d need another ^2 crosses.
Is there a way to specify within the cross that an explicit bin will contain only values that are included in bins expression while maintaining autocross with all bins not included? IE:
typeXstate1Xmode1Xsel1Xstate2Xmode2Xsel2: cross c_type, c1_state, c1_mode, c1_select, c2_state, c2_mode, c2_select {
// autocross covers all points for c1_state.on and c2_state.on correctly
bins reg1_off = binsof(c1_state.off) || binsof(c1_mode) || binsof(c1_mode); // create set of bins reg1_off that lumps c1_state.off and all values of c1_mode and c1_select that is still crossed with c_type and c2 coverpoints
bins reg2_off = binsof(c2_state.off) || binsof(c2_mode) || binsof(c2_mode); // create set of bins reg2_off that lumps c2_state.off and all values of c2_mode and c2_select that is still crossed with c_type and c1 coverpoints
}