@@ -24,10 +24,32 @@ covergroup Zacas_amocas_w_cg with function sample(ins_t ins);
2424 ignore_bins x0 = { x0} ;
2525 }
2626
27+ cmp_rd_rs1_val_eq : coverpoint (ins.current.rd_val == ins.prev.rd_val) iff (ins.trap == 0 ) {
28+ // Compare rd current to rd previous value (which is the same as rs1 value for the current instruction)
29+ }
30+
31+ cmp_rd_rs1_val_hw : coverpoint (ins.current.rd_val[15 : 0 ] == ins.prev.rd_val[15 : 0 ]) iff (ins.trap == 0 ) {
32+ // Compare the lowest 16 bits of current rd value to
33+ // lowest 16 bits of previous rd value (which is the same as rs1 value for the current instruction)
34+ bins rd_equal_val_hw_rs1 = { 1 } ; // Cases where the lowest 16 bits of rd and rs1 are equal
35+ bins rd_not_equal_val_hw_rs1 = { 0 } ; // Cases where the lowest 16 bits of rd and rs1 are not equal
36+ }
37+
38+ cmp_rd_rs1_val_lsb : coverpoint (ins.current.rd_val[7 : 0 ] == ins.prev.rd_val[7 : 0 ]) iff (ins.trap == 0 ) {
39+ // Compare the least significant byte of current rd value to the
40+ // least significant byte of previous rd value (which is the same as rs1 value for the current instruction)
41+ bins rd_equal_val_lsb_rs1 = { 1 } ; // Cases where the least significant byte of rd and rs1 are equal
42+ bins rd_not_equal_val_lsb_rs1 = { 0 } ; // Cases where the least significant byte of rd and rs1 are not equal
43+ }
44+
2745 cmp_rd_rs2 : coverpoint ins.get_gpr_reg (ins.current.rd) iff (ins.current.rd == ins.current.rs2 & ins.trap == 0 ) {
2846 // Compare assignments of all registers
2947 }
3048
49+ cmp_rd_sign_ext : coverpoint ins.current.rd_val[31 ] iff (ins.trap == 0 ) {
50+
51+ }
52+
3153 cmp_rs1_rs2_nx0 : coverpoint ins.get_gpr_reg (ins.current.rs1) iff (ins.current.rs1 == ins.current.rs2 & ins.trap == 0 ) {
3254 // Compare assignments of all 31 registers excluding x0
3355 ignore_bins x0 = { x0} ;
@@ -99,12 +121,47 @@ covergroup Zacas_amocas_d_cg with function sample(ins_t ins);
99121 bins reg_pair[] = { [$: $]} with (item % 2 == 0 );
100122 }
101123
124+ cmp_rd_rs1_pair_partial_val : coverpoint (
125+ (ins.current.rd_val == ins.prev.rd_val) ^
126+ (ins.current.rd_next_val == ins.prev.rd_next_val)
127+ ) iff (ins.trap == 0 )
128+ {
129+ // Cases where rd and rs1 have matching high or low halves but not both
130+ bins rd_pair_partial_equal_val_rs1 = { 1 } ;
131+ bins rd_pair_partial_not_equal_val_rs1 = { 0 } ;
132+ }
133+
102134 cmp_rd_rs1_rs2_nx0_pair : coverpoint ins.get_gpr_reg (ins.current.rd) iff (ins.current.rd == ins.current.rs1 & ins.current.rd == ins.current.rs2 & ins.trap == 0 ) {
103135 // Compare assignments of all even registers excluding x0
104136 ignore_bins x0 = { x0} ;
105137 bins reg_pair[] = { [$: $]} with (item % 2 == 0 );
106138 }
107139
140+ cmp_rd_rs1_val_eq : coverpoint (ins.current.rd_val == ins.prev.rd_val) iff (ins.trap == 0 ) {
141+ // Compare rd current to rd previous value (which is the same as rs1 value for the current instruction)
142+ }
143+
144+ cmp_rd_rs1_val_hw : coverpoint (ins.current.rd_val[15 : 0 ] == ins.prev.rd_val[15 : 0 ]) iff (ins.trap == 0 ) {
145+ // Compare the lowest 16 bits of current rd value to
146+ // lowest 16 bits of previous rd value (which is the same as rs1 value for the current instruction)
147+ bins rd_equal_val_hw_rs1 = { 1 } ; // Cases where the lowest 16 bits of rd and rs1 are equal
148+ bins rd_not_equal_val_hw_rs1 = { 0 } ; // Cases where the lowest 16 bits of rd and rs1 are not equal
149+ }
150+
151+ cmp_rd_rs1_val_lsb : coverpoint (ins.current.rd_val[7 : 0 ] == ins.prev.rd_val[7 : 0 ]) iff (ins.trap == 0 ) {
152+ // Compare the least significant byte of current rd value to the
153+ // least significant byte of previous rd value (which is the same as rs1 value for the current instruction)
154+ bins rd_equal_val_lsb_rs1 = { 1 } ; // Cases where the least significant byte of rd and rs1 are equal
155+ bins rd_not_equal_val_lsb_rs1 = { 0 } ; // Cases where the least significant byte of rd and rs1 are not equal
156+ }
157+
158+ cmp_rd_rs1_val_w : coverpoint (ins.current.rd_val[31 : 0 ] == ins.prev.rd_val[31 : 0 ]) iff (ins.trap == 0 ) {
159+ // Compare the lowest 32 bits of current rd value to the
160+ // lowest 32 bits of previous rd value (which is the same as rs1 value for the current instruction)
161+ bins rd_equal_val_w_rs1 = { 1 } ; // Cases where the lowest 32 bits of rd and rs1 are equal
162+ bins rd_not_equal_val_w_rs1 = { 0 } ; // Cases where the lowest 32 bits of rd and rs1 are not equal
163+ }
164+
108165 cmp_rd_rs2_pair : coverpoint ins.get_gpr_reg (ins.current.rd) iff (ins.current.rd == ins.current.rs2 & ins.trap == 0 ) {
109166 // Compare assignments of all even registers
110167 bins reg_pair[] = { [$: $]} with (item % 2 == 0 );
@@ -186,6 +243,31 @@ covergroup Zacas_amocas_d_cg with function sample(ins_t ins);
186243 ignore_bins x0 = { x0} ;
187244 }
188245
246+ cmp_rd_rs1_val_eq : coverpoint (ins.current.rd_val == ins.prev.rd_val) iff (ins.trap == 0 ) {
247+ // Compare rd current to rd previous value (which is the same as rs1 value for the current instruction)
248+ }
249+
250+ cmp_rd_rs1_val_hw : coverpoint (ins.current.rd_val[15 : 0 ] == ins.prev.rd_val[15 : 0 ]) iff (ins.trap == 0 ) {
251+ // Compare the lowest 16 bits of current rd value to
252+ // lowest 16 bits of previous rd value (which is the same as rs1 value for the current instruction)
253+ bins rd_equal_val_hw_rs1 = { 1 } ; // Cases where the lowest 16 bits of rd and rs1 are equal
254+ bins rd_not_equal_val_hw_rs1 = { 0 } ; // Cases where the lowest 16 bits of rd and rs1 are not equal
255+ }
256+
257+ cmp_rd_rs1_val_lsb : coverpoint (ins.current.rd_val[7 : 0 ] == ins.prev.rd_val[7 : 0 ]) iff (ins.trap == 0 ) {
258+ // Compare the least significant byte of current rd value to the
259+ // least significant byte of previous rd value (which is the same as rs1 value for the current instruction)
260+ bins rd_equal_val_lsb_rs1 = { 1 } ; // Cases where the least significant byte of rd and rs1 are equal
261+ bins rd_not_equal_val_lsb_rs1 = { 0 } ; // Cases where the least significant byte of rd and rs1 are not equal
262+ }
263+
264+ cmp_rd_rs1_val_w : coverpoint (ins.current.rd_val[31 : 0 ] == ins.prev.rd_val[31 : 0 ]) iff (ins.trap == 0 ) {
265+ // Compare the lowest 32 bits of current rd value to the
266+ // lowest 32 bits of previous rd value (which is the same as rs1 value for the current instruction)
267+ bins rd_equal_val_w_rs1 = { 1 } ; // Cases where the lowest 32 bits of rd and rs1 are equal
268+ bins rd_not_equal_val_w_rs1 = { 0 } ; // Cases where the lowest 32 bits of rd and rs1 are not equal
269+ }
270+
189271 cmp_rd_rs2 : coverpoint ins.get_gpr_reg (ins.current.rd) iff (ins.current.rd == ins.current.rs2 & ins.trap == 0 ) {
190272 // Compare assignments of all registers
191273 }
@@ -257,12 +339,47 @@ covergroup Zacas_amocas_q_cg with function sample(ins_t ins);
257339 bins reg_pair[] = { [$: $]} with (item % 2 == 0 );
258340 }
259341
342+ cmp_rd_rs1_pair_partial_val : coverpoint (
343+ (ins.current.rd_val == ins.prev.rd_val) ^
344+ (ins.current.rd_next_val == ins.prev.rd_next_val)
345+ ) iff (ins.trap == 0 )
346+ {
347+ // Cases where rd and rs1 have matching high or low halves but not both
348+ bins rd_pair_partial_equal_val_rs1 = { 1 } ;
349+ bins rd_pair_partial_not_equal_val_rs1 = { 0 } ;
350+ }
351+
260352 cmp_rd_rs1_rs2_nx0_pair : coverpoint ins.get_gpr_reg (ins.current.rd) iff (ins.current.rd == ins.current.rs1 & ins.current.rd == ins.current.rs2 & ins.trap == 0 ) {
261353 // Compare assignments of all even registers excluding x0
262354 ignore_bins x0 = { x0} ;
263355 bins reg_pair[] = { [$: $]} with (item % 2 == 0 );
264356 }
265357
358+ cmp_rd_rs1_val_eq : coverpoint (ins.current.rd_val == ins.prev.rd_val) iff (ins.trap == 0 ) {
359+ // Compare rd current to rd previous value (which is the same as rs1 value for the current instruction)
360+ }
361+
362+ cmp_rd_rs1_val_hw : coverpoint (ins.current.rd_val[15 : 0 ] == ins.prev.rd_val[15 : 0 ]) iff (ins.trap == 0 ) {
363+ // Compare the lowest 16 bits of current rd value to
364+ // lowest 16 bits of previous rd value (which is the same as rs1 value for the current instruction)
365+ bins rd_equal_val_hw_rs1 = { 1 } ; // Cases where the lowest 16 bits of rd and rs1 are equal
366+ bins rd_not_equal_val_hw_rs1 = { 0 } ; // Cases where the lowest 16 bits of rd and rs1 are not equal
367+ }
368+
369+ cmp_rd_rs1_val_lsb : coverpoint (ins.current.rd_val[7 : 0 ] == ins.prev.rd_val[7 : 0 ]) iff (ins.trap == 0 ) {
370+ // Compare the least significant byte of current rd value to the
371+ // least significant byte of previous rd value (which is the same as rs1 value for the current instruction)
372+ bins rd_equal_val_lsb_rs1 = { 1 } ; // Cases where the least significant byte of rd and rs1 are equal
373+ bins rd_not_equal_val_lsb_rs1 = { 0 } ; // Cases where the least significant byte of rd and rs1 are not equal
374+ }
375+
376+ cmp_rd_rs1_val_w : coverpoint (ins.current.rd_val[31 : 0 ] == ins.prev.rd_val[31 : 0 ]) iff (ins.trap == 0 ) {
377+ // Compare the lowest 32 bits of current rd value to the
378+ // lowest 32 bits of previous rd value (which is the same as rs1 value for the current instruction)
379+ bins rd_equal_val_w_rs1 = { 1 } ; // Cases where the lowest 32 bits of rd and rs1 are equal
380+ bins rd_not_equal_val_w_rs1 = { 0 } ; // Cases where the lowest 32 bits of rd and rs1 are not equal
381+ }
382+
266383 cmp_rd_rs2_pair : coverpoint ins.get_gpr_reg (ins.current.rd) iff (ins.current.rd == ins.current.rs2 & ins.trap == 0 ) {
267384 // Compare assignments of all even registers
268385 bins reg_pair[] = { [$: $]} with (item % 2 == 0 );
0 commit comments