@@ -47,36 +47,72 @@ class coverage;
47
47
48
48
exponent_A : coverpoint o_expA{
49
49
bins exponent_A_zero= { 0 } ;
50
- bins exponent_A = { ['h1 : 'hfe ]} ;
50
+ bins exponent_A_r = { ['h1 : 'hfe ]} ;
51
51
bins exponent_A_ones= { 'hff } ;
52
52
}
53
53
54
54
exponent_B : coverpoint o_expB{
55
55
bins exponent_B_zero= { 0 } ;
56
- bins exponent_B = { ['h1 : 'hfe ]} ;
56
+ bins exponent_B_r = { ['h1 : 'hfe ]} ;
57
57
bins exponent_B_ones= { 'hff } ;
58
58
}
59
59
60
60
fraction_A : coverpoint o_mantA{
61
61
bins fraction_A_zero= { 0 } ;
62
- bins fraction_A = { ['h1 : 'h7ffffe ]} ;
62
+ bins fraction_A_r = { ['h1 : 'h7ffffe ]} ;
63
63
bins fraction_A_ones= { 'h7fffff } ;
64
64
}
65
65
66
66
fraction_B : coverpoint o_mantB{
67
67
bins fraction_B_zero= { 0 } ;
68
- bins fraction_B = { ['h1 : 'h7ffffe ]} ;
68
+ bins fraction_B_r = { ['h1 : 'h7ffffe ]} ;
69
69
bins fraction_B_ones= { 'hfffff } ;
70
70
}
71
71
72
- // ignoring mantasa and exponent when the number is negative for A
73
- cross o_signA,o_expA,o_mantA{
74
- ignore_bins negative = binsof (o_signA) intersect { 1 } ;
72
+ opA_0_and_inf : cross op_code,exponent_A,fraction_A{
73
+ bins add_A0 = binsof (op_code) intersect { ADD } &&
74
+ (binsof (exponent_A.exponent_A_zero) && binsof (fraction_A.fraction_A_zero));
75
+ bins sub_A0 = binsof (op_code) intersect { SUB } &&
76
+ (binsof (exponent_A.exponent_A_zero) && binsof (fraction_A.fraction_A_zero));
77
+ bins mul_A0 = binsof (op_code) intersect { MUL } &&
78
+ (binsof (exponent_A.exponent_A_zero) && binsof (fraction_A.fraction_A_zero));
79
+ bins div_A0 = binsof (op_code) intersect { DIV } &&
80
+ (binsof (exponent_A.exponent_A_zero) && binsof (fraction_A.fraction_A_zero));
81
+ bins add_Ainf = binsof (op_code) intersect { ADD } &&
82
+ (binsof (exponent_A.exponent_A_ones) && binsof (fraction_A.fraction_A_zero));
83
+ bins sub_Ainf = binsof (op_code) intersect { SUB } &&
84
+ (binsof (exponent_A.exponent_A_ones) && binsof (fraction_A.fraction_A_zero));
85
+ bins mul_Ainf = binsof (op_code) intersect { MUL } &&
86
+ (binsof (exponent_A.exponent_A_ones) && binsof (fraction_A.fraction_A_zero));
87
+ bins div_Ainf = binsof (op_code) intersect { DIV } &&
88
+ (binsof (exponent_A.exponent_A_ones) && binsof (fraction_A.fraction_A_zero));
89
+ ignore_bins others_all = binsof (op_code.all_follow_div_op) || binsof (op_code.all_follow_mul_op) ||
90
+ binsof (op_code.all_follow_sub_op) || binsof (op_code.all_follow_add_op) ||
91
+ binsof (fraction_A.fraction_A_r) || binsof (exponent_A.exponent_A_r) ||
92
+ binsof (fraction_A.fraction_A_ones) || binsof (fraction_A.fraction_A_r);
75
93
}
76
94
77
- // ignoring mantasa and exponent when the number is negative for B
78
- cross o_signB,o_expB,o_mantB{
79
- ignore_bins negative = binsof (o_signB) intersect { 1 } ;
95
+ opB_0_and_inf : cross op_code,exponent_B,fraction_B{
96
+ bins add_B0 = binsof (op_code) intersect { ADD } &&
97
+ (binsof (exponent_B.exponent_B_zero) && binsof (fraction_B.fraction_B_zero));
98
+ bins sub_B0 = binsof (op_code) intersect { SUB } &&
99
+ (binsof (exponent_B.exponent_B_zero) && binsof (fraction_B.fraction_B_zero));
100
+ bins mul_B0 = binsof (op_code) intersect { MUL } &&
101
+ (binsof (exponent_B.exponent_B_zero) && binsof (fraction_B.fraction_B_zero));
102
+ bins div_B0 = binsof (op_code) intersect { DIV } &&
103
+ (binsof (exponent_B.exponent_B_zero) && binsof (fraction_B.fraction_B_zero));
104
+ bins add_Binf = binsof (op_code) intersect { ADD } &&
105
+ (binsof (exponent_B.exponent_B_ones) && binsof (fraction_B.fraction_B_zero));
106
+ bins sub_Binf = binsof (op_code) intersect { SUB } &&
107
+ (binsof (exponent_B.exponent_B_ones) && binsof (fraction_B.fraction_B_zero));
108
+ bins mul_Binf = binsof (op_code) intersect { MUL } &&
109
+ (binsof (exponent_B.exponent_B_ones) && binsof (fraction_B.fraction_B_zero));
110
+ bins div_Binf = binsof (op_code) intersect { DIV } &&
111
+ (binsof (exponent_B.exponent_B_ones) && binsof (fraction_B.fraction_B_zero));
112
+ ignore_bins others_all = binsof (op_code.all_follow_div_op) || binsof (op_code.all_follow_mul_op) ||
113
+ binsof (op_code.all_follow_sub_op) || binsof (op_code.all_follow_add_op) ||
114
+ binsof (fraction_B.fraction_B_r) || binsof (exponent_B.exponent_B_r) ||
115
+ binsof (fraction_B.fraction_B_ones) || binsof (fraction_B.fraction_B_r);
80
116
}
81
117
82
118
endgroup
@@ -87,20 +123,32 @@ class coverage;
87
123
88
124
negative_out : coverpoint o_fpu_out{
89
125
bins negative_output = { 1 } ; // covering if output is negative
126
+ bins positive_output = { 0 } ;
90
127
}
91
128
92
129
exponent_out : coverpoint o_expO{
93
- bins exponent_O_zero= { 0 } ;
94
- bins exponent_O = { ['h1 : 'hfe ]} ;
95
- bins exponent_O_ones= { 'hff } ;
130
+ bins exponent_O_zero = { 0 } ;
131
+ bins exponent_O_r = { ['h1 : 'hfe ]} ;
132
+ bins exponent_O_ones = { 'hff } ;
96
133
}
97
134
98
135
fraction_out : coverpoint o_mantO{
99
- bins fraction_O_zero= { 0 } ;
100
- bins fraction_O = { ['h1 : 'h7ffffe ]} ;
101
- bins fraction_O_ones= { 'hfffff } ;
136
+ bins fraction_O_zero = { 0 } ;
137
+ bins fraction_O_r = { ['h1 : 'h7ffffe ]} ;
138
+ bins fraction_O_ones = { 'hfffff } ;
102
139
}
103
140
141
+ output_special : cross exponent_out, fraction_out{
142
+ bins op_zero = binsof (exponent_out.exponent_O_zero) && binsof (fraction_out.fraction_O_zero);
143
+ bins op_inf = binsof (exponent_out.exponent_O_ones) && binsof (fraction_out.fraction_O_zero);
144
+ bins op_normal = binsof (exponent_out.exponent_O_r);
145
+ bins op_subnorm = binsof (exponent_out.exponent_O_zero) &&
146
+ (binsof (fraction_out.fraction_O_r) || binsof (fraction_out.fraction_O_ones));
147
+ bins op_NaN = binsof (exponent_out.exponent_O_ones) &&
148
+ (binsof (fraction_out.fraction_O_r) || binsof (fraction_out.fraction_O_ones));
149
+
150
+ }
151
+
104
152
endgroup
105
153
106
154
task run ();
@@ -116,17 +164,17 @@ class coverage;
116
164
out_op = transaction0.fpuOp;
117
165
out_O = transaction0.fpuOut;
118
166
119
- o_signA= out_A[31 ];
120
- o_expA= out_A[30 : 23 ];
121
- o_mantA= out_A[22 : 0 ];
167
+ o_signA = out_A[31 ];
168
+ o_expA = out_A[30 : 23 ];
169
+ o_mantA = out_A[22 : 0 ];
122
170
123
- o_signB= out_A [31 ];
124
- o_expB= out_B[30 : 23 ];
125
- o_mantB= out_B[22 : 0 ];
171
+ o_signB = out_B [31 ];
172
+ o_expB = out_B[30 : 23 ];
173
+ o_mantB = out_B[22 : 0 ];
126
174
127
175
o_fpu_out = out_O[31 ];
128
- o_expO = out_B [30 : 23 ];
129
- o_mantO = out_B [22 : 0 ];
176
+ o_expO = out_O [30 : 23 ];
177
+ o_mantO = out_O [22 : 0 ];
130
178
131
179
inputs.sample ();
132
180
outputs.sample ();
0 commit comments