From bfade4c6a17848c018ea03e405d13c22d2ba1d83 Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Mon, 27 Apr 2026 01:39:42 -0700 Subject: [PATCH 01/13] fix arithmetic operation bins --- coverage/covergroups/B5.svh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/coverage/covergroups/B5.svh b/coverage/covergroups/B5.svh index 00296df..ed56d19 100644 --- a/coverage/covergroups/B5.svh +++ b/coverage/covergroups/B5.svh @@ -8,8 +8,13 @@ covergroup B5_cg (virtual coverfloat_interface CFI); FP_result_ops: coverpoint CFI.op { type_option.weight = 0; - `include "bins_templates/FP_result_op_bins.svh" - } + bins mul = {OP_MUL}; + bins div = {OP_DIV}; + bins fmadd = {OP_FMADD}; + bins fmsub = {OP_FMSUB}; + bins fnmadd = {OP_FNMADD}; + bins fnmsub = {OP_FNMSUB}; +} rounding_mode_all: coverpoint CFI.rm { type_option.weight = 0; From 5ef77d38a90f2994c5f735d9e00c3e4ac37fa990 Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Mon, 27 Apr 2026 01:41:13 -0700 Subject: [PATCH 02/13] remove sign from cross --- coverage/covergroups/B5.svh | 80 ++++++++++++------------------------- 1 file changed, 25 insertions(+), 55 deletions(-) diff --git a/coverage/covergroups/B5.svh b/coverage/covergroups/B5.svh index ed56d19..4302515 100644 --- a/coverage/covergroups/B5.svh +++ b/coverage/covergroups/B5.svh @@ -25,36 +25,6 @@ covergroup B5_cg (virtual coverfloat_interface CFI); bins round_near_maxmag = {ROUND_NEAR_MAXMAG}; } - F32_sign: coverpoint CFI.result[31] { - type_option.weight = 0; - bins pos = {0}; - bins neg = {1}; - } - - F64_sign: coverpoint CFI.result[63] { - type_option.weight = 0; - bins pos = {0}; - bins neg = {1}; - } - - F128_sign: coverpoint CFI.result[127] { - type_option.weight = 0; - bins pos = {0}; - bins neg = {1}; - } - - F16_sign: coverpoint CFI.result[15] { - type_option.weight = 0; - bins pos = {0}; - bins neg = {1}; - } - - BF16_sign: coverpoint CFI.result[15] { - type_option.weight = 0; - bins pos = {0}; - bins neg = {1}; - } - F16_result_fmt: coverpoint (CFI.resultFmt == FMT_HALF) { type_option.weight = 0; bins f16 = {1}; @@ -212,43 +182,43 @@ covergroup B5_cg (virtual coverfloat_interface CFI); ************************************************************************/ `ifdef COVER_F32 - B5_F32_subnorm: cross FP_result_ops, rounding_mode_all, F32_sign, FP_subnorm, F32_result_fmt; - B5_F32_minSubnorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F32_sign, F32_minSubnorm_pm_3ulp, F32_result_fmt; - B5_F32_minNorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F32_sign, F32_minNorm_pm_3ulp, F32_result_fmt; - B5_F32_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F32_sign, F32_btw_minSubnorm_zero, F32_result_fmt; - B5_F32_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, F32_sign, FP_minNorm_p5_exp_range, F32_result_fmt; + B5_F32_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F32_result_fmt; + B5_F32_minSubnorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F32_minSubnorm_pm_3ulp, F32_result_fmt; + B5_F32_minNorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F32_minNorm_pm_3ulp, F32_result_fmt; + B5_F32_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F32_btw_minSubnorm_zero, F32_result_fmt; + B5_F32_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F32_result_fmt; `endif `ifdef COVER_F64 - B5_F64_subnorm: cross FP_result_ops, rounding_mode_all, F32_sign, FP_subnorm, F64_result_fmt; - B5_F64_minSubnorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F32_sign, F64_minSubnorm_pm_3ulp, F64_result_fmt; - B5_F64_minNorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F32_sign, F64_minNorm_pm_3ulp, F64_result_fmt; - B5_F64_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F32_sign, F64_btw_minSubnorm_zero, F64_result_fmt; - B5_F64_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, F32_sign, FP_minNorm_p5_exp_range, F64_result_fmt; + B5_F64_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F64_result_fmt; + B5_F64_minSubnorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F64_minSubnorm_pm_3ulp, F64_result_fmt; + B5_F64_minNorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F64_minNorm_pm_3ulp, F64_result_fmt; + B5_F64_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F64_btw_minSubnorm_zero, F64_result_fmt; + B5_F64_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F64_result_fmt; `endif `ifdef COVER_F128 - B5_F128_subnorm: cross FP_result_ops, rounding_mode_all, F32_sign, FP_subnorm, F128_result_fmt; - B5_F128_minSubnorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F32_sign, F128_minSubnorm_pm_3ulp, F128_result_fmt; - B5_F128_minNorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F32_sign, F128_minNorm_pm_3ulp, F128_result_fmt; - B5_F128_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F32_sign, F128_btw_minSubnorm_zero, F128_result_fmt; - B5_F128_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, F32_sign, FP_minNorm_p5_exp_range, F128_result_fmt; + B5_F128_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F128_result_fmt; + B5_F128_minSubnorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F128_minSubnorm_pm_3ulp, F128_result_fmt; + B5_F128_minNorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F128_minNorm_pm_3ulp, F128_result_fmt; + B5_F128_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F128_btw_minSubnorm_zero, F128_result_fmt; + B5_F128_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F128_result_fmt; `endif `ifdef COVER_F16 - B5_F16_subnorm: cross FP_result_ops, rounding_mode_all, F32_sign, FP_subnorm, F16_result_fmt; - B5_F16_minSubnorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F32_sign, F16_minSubnorm_pm_3ulp, F16_result_fmt; - B5_F16_minNorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F32_sign, F16_minNorm_pm_3ulp, F16_result_fmt; - B5_F16_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F32_sign, F16_btw_minSubnorm_zero, F16_result_fmt; - B5_F16_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, F32_sign, FP_minNorm_p5_exp_range, F16_result_fmt; + B5_F16_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F16_result_fmt; + B5_F16_minSubnorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F16_minSubnorm_pm_3ulp, F16_result_fmt; + B5_F16_minNorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F16_minNorm_pm_3ulp, F16_result_fmt; + B5_F16_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F16_btw_minSubnorm_zero, F16_result_fmt; + B5_F16_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F16_result_fmt; `endif `ifdef COVER_BF16 - B5_BF16_subnorm: cross FP_result_ops, rounding_mode_all, F32_sign, FP_subnorm, BF16_result_fmt; - B5_BF16_minSubnorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F32_sign, BF16_minSubnorm_pm_3ulp, BF16_result_fmt; - B5_BF16_minNorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F32_sign, BF16_minNorm_pm_3ulp, BF16_result_fmt; - B5_BF16_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F32_sign, BF16_btw_minSubnorm_zero, BF16_result_fmt; - B5_BF16_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, F32_sign, FP_minNorm_p5_exp_range, BF16_result_fmt; + B5_BF16_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, BF16_result_fmt; + B5_BF16_minSubnorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minSubnorm_pm_3ulp, BF16_result_fmt; + B5_BF16_minNorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minNorm_pm_3ulp, BF16_result_fmt; + B5_BF16_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, BF16_btw_minSubnorm_zero, BF16_result_fmt; + B5_BF16_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, BF16_result_fmt; `endif endgroup From 111df646f3ca0bfd28fc0e884a7e650030abf82e Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Mon, 27 Apr 2026 03:15:25 -0700 Subject: [PATCH 03/13] Correct for updated ulp definition --- coverage/covergroups/B5.svh | 213 ++++++++++++++++++++++++++++-------- 1 file changed, 168 insertions(+), 45 deletions(-) diff --git a/coverage/covergroups/B5.svh b/coverage/covergroups/B5.svh index 4302515..7a455d3 100644 --- a/coverage/covergroups/B5.svh +++ b/coverage/covergroups/B5.svh @@ -98,77 +98,190 @@ covergroup B5_cg (virtual coverfloat_interface CFI); } // cases v & vi - F32_minNorm_pm_3ulp: coverpoint CFI.intermM[(INTERM_M_BITS - F32_M_BITS) -: 3] - iff (CFI.intermX == 0 && CFI.intermM[(INTERM_M_BITS - 1) -: F32_M_BITS - 1] == 0) { + + // Guard bit sticky bit + F32_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} + // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == 0) { type_option.weight = 0; - bins minNorm_pm_3ulp[] = {[3'b001 : 3'b111]}; + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; } - F64_minNorm_pm_3ulp: coverpoint CFI.intermM[(INTERM_M_BITS - F64_M_BITS) -: 3] - iff (CFI.intermX == 0 && CFI.intermM[(INTERM_M_BITS - 1) -: F64_M_BITS - 1] == 0) { + // Guard bit sticky bit + F32_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == '1) { type_option.weight = 0; - bins minNorm_pm_3ulp[] = {[3'b001 : 3'b111]}; + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; } - F128_minNorm_pm_3ulp: coverpoint CFI.intermM[(INTERM_M_BITS - F128_M_BITS) -: 3] - iff (CFI.intermX == 0 && CFI.intermM[(INTERM_M_BITS - 1) -: F128_M_BITS - 1] == 0) { + // Guard bit sticky bit + F64_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} + // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == 0) { type_option.weight = 0; - bins minNorm_pm_3ulp[] = {[3'b001 : 3'b111]}; + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; } - F16_minNorm_pm_3ulp: coverpoint CFI.intermM[(INTERM_M_BITS - F16_M_BITS) -: 3] - iff (CFI.intermX == 0 && CFI.intermM[(INTERM_M_BITS - 1) -: F16_M_BITS - 1] == 0) { + // Guard bit sticky bit + F64_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == '1) { type_option.weight = 0; - bins minNorm_pm_3ulp[] = {[3'b001 : 3'b111]}; + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; } - BF16_minNorm_pm_3ulp: coverpoint CFI.intermM[(INTERM_M_BITS - BF16_M_BITS) -: 3] - iff (CFI.intermX == 0 && CFI.intermM[(INTERM_M_BITS - 1) -: BF16_M_BITS - 1] == 0) { + // Guard bit sticky bit + F128_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} + // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == 0) { type_option.weight = 0; - bins minNorm_pm_3ulp[] = {[3'b001 : 3'b111]}; + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; + } + + // Guard bit sticky bit + F128_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == '1) { + type_option.weight = 0; + + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + } + + // Guard bit sticky bit + F16_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} + // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == 0) { + type_option.weight = 0; + + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; + } + + // Guard bit sticky bit + F16_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == '1) { + type_option.weight = 0; + + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + } + + // Guard bit sticky bit + BF16_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} + // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == 0) { + type_option.weight = 0; + + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; + } + + // Guard bit sticky bit + BF16_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == '1) { + type_option.weight = 0; + + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; } // cases vii & viii - F32_btw_minSubnorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { - type_option.weight = 0; - // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) - bins btw_minSubnorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F32_M_BITS)) - 1)]}; + // Guard bit sticky bit + F32_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == 1) { + type_option.weight = 0; + + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; } - F64_btw_minSubnorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { - type_option.weight = 0; + // Guard bit sticky bit + F32_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == 0) { + type_option.weight = 0; - // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) - bins btw_minSubnorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F64_M_BITS)) - 1)]}; + bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; } - F128_btw_minSubnorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { - type_option.weight = 0; + // Guard bit sticky bit + F64_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == 1) { + type_option.weight = 0; - // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) - bins btw_minSubnorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F128_M_BITS)) - 1)]}; + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; } - F16_btw_minSubnorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { - type_option.weight = 0; + // Guard bit sticky bit + F64_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == 0) { + type_option.weight = 0; - // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) - bins btw_minSubnorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F16_M_BITS)) - 1)]}; + bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; } - BF16_btw_minSubnorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { - type_option.weight = 0; + // Guard bit sticky bit + F128_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == 1) { + type_option.weight = 0; - // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) - bins btw_minSubnorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - BF16_M_BITS)) - 1)]}; + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; } + // Guard bit sticky bit + F128_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == 0) { + type_option.weight = 0; + + bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + } + + // Guard bit sticky bit + F16_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == 1) { + type_option.weight = 0; + + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; + } + + // Guard bit sticky bit + F16_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == 0) { + type_option.weight = 0; + + bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + } + + // Guard bit sticky bit + BF16_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == 1) { + type_option.weight = 0; + + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; + } + + // Guard bit sticky bit + BF16_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == 0) { + type_option.weight = 0; + + bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + } + + // case ix FP_minNorm_p5_exp_range: coverpoint CFI.intermX { type_option.weight = 0; @@ -183,40 +296,50 @@ covergroup B5_cg (virtual coverfloat_interface CFI); `ifdef COVER_F32 B5_F32_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F32_result_fmt; - B5_F32_minSubnorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F32_minSubnorm_pm_3ulp, F32_result_fmt; - B5_F32_minNorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F32_minNorm_pm_3ulp, F32_result_fmt; + B5_F32_minSubnorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F32_minSubnorm_p_3ulp, F32_result_fmt; + B5_F32_minSubnorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F32_minSubnorm_m_3ulp, F32_result_fmt; + B5_F32_minNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F32_minNorm_p_3ulp, F32_result_fmt; + B5_F32_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F32_minNorm_m_3ulp, F32_result_fmt; B5_F32_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F32_btw_minSubnorm_zero, F32_result_fmt; B5_F32_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F32_result_fmt; `endif `ifdef COVER_F64 B5_F64_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F64_result_fmt; - B5_F64_minSubnorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F64_minSubnorm_pm_3ulp, F64_result_fmt; - B5_F64_minNorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F64_minNorm_pm_3ulp, F64_result_fmt; + B5_F64_minSubnorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F64_minSubnorm_p_3ulp, F64_result_fmt; + B5_F64_minSubnorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F64_minSubnorm_m_3ulp, F64_result_fmt; + B5_F64_minNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F64_minNorm_p_3ulp, F64_result_fmt; + B5_F64_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F64_minNorm_m_3ulp, F64_result_fmt; B5_F64_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F64_btw_minSubnorm_zero, F64_result_fmt; B5_F64_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F64_result_fmt; `endif `ifdef COVER_F128 B5_F128_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F128_result_fmt; - B5_F128_minSubnorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F128_minSubnorm_pm_3ulp, F128_result_fmt; - B5_F128_minNorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F128_minNorm_pm_3ulp, F128_result_fmt; + B5_F128_minSubnorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F128_minSubnorm_p_3ulp, F128_result_fmt; + B5_F128_minSubnorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F128_minSubnorm_m_3ulp, F128_result_fmt; + B5_F128_minNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F128_minNorm_p_3ulp, F128_result_fmt; + B5_F128_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F128_minNorm_m_3ulp, F128_result_fmt; B5_F128_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F128_btw_minSubnorm_zero, F128_result_fmt; B5_F128_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F128_result_fmt; `endif `ifdef COVER_F16 B5_F16_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F16_result_fmt; - B5_F16_minSubnorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F16_minSubnorm_pm_3ulp, F16_result_fmt; - B5_F16_minNorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, F16_minNorm_pm_3ulp, F16_result_fmt; + B5_F16_minSubnorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F16_minSubnorm_p_3ulp, F16_result_fmt; + B5_F16_minSubnorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F16_minSubnorm_m_3ulp, F16_result_fmt; + B5_F16_minNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F16_minNorm_p_3ulp, F16_result_fmt; + B5_F16_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F16_minNorm_m_3ulp, F16_result_fmt; B5_F16_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F16_btw_minSubnorm_zero, F16_result_fmt; B5_F16_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F16_result_fmt; `endif `ifdef COVER_BF16 B5_BF16_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, BF16_result_fmt; - B5_BF16_minSubnorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minSubnorm_pm_3ulp, BF16_result_fmt; - B5_BF16_minNorm_pm_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minNorm_pm_3ulp, BF16_result_fmt; + B5_BF16_minSubnorm_p_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minSubnorm_p_3ulp, BF16_result_fmt; + B5_BF16_minSubnorm_m_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minSubnorm_m_3ulp, BF16_result_fmt; + B5_BF16_minNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minNorm_p_3ulp, BF16_result_fmt; + B5_BF16_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minNorm_m_3ulp, BF16_result_fmt; B5_BF16_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, BF16_btw_minSubnorm_zero, BF16_result_fmt; B5_BF16_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, BF16_result_fmt; `endif From 5b2b851ccf343d0f729fb89d12c4f6f71acb5ef4 Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Mon, 27 Apr 2026 03:28:57 -0700 Subject: [PATCH 04/13] Add TODOs --- coverage/covergroups/B5.svh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coverage/covergroups/B5.svh b/coverage/covergroups/B5.svh index 7a455d3..2ef2b5a 100644 --- a/coverage/covergroups/B5.svh +++ b/coverage/covergroups/B5.svh @@ -294,6 +294,9 @@ covergroup B5_cg (virtual coverfloat_interface CFI); Main Coverpoints ************************************************************************/ +// TODO: Missing certain ignore bins +// TODO: Missing narrowing converts + `ifdef COVER_F32 B5_F32_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F32_result_fmt; B5_F32_minSubnorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F32_minSubnorm_p_3ulp, F32_result_fmt; From 9efb086d70eb01eaad8ecda413e11dc25ec80869 Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Mon, 27 Apr 2026 18:35:48 -0700 Subject: [PATCH 05/13] Restore between minsubnorm and zero helper coverpoints --- coverage/covergroups/B5.svh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/coverage/covergroups/B5.svh b/coverage/covergroups/B5.svh index 1ebf268..9700edc 100644 --- a/coverage/covergroups/B5.svh +++ b/coverage/covergroups/B5.svh @@ -297,6 +297,42 @@ covergroup B5_cg (virtual coverfloat_interface CFI); } + // cases vii & viii + F32_btw_minSubnorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { + type_option.weight = 0; + + // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) + bins btw_minSubnorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F32_M_BITS)) - 1)]}; + } + + F64_btw_minSubnorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { + type_option.weight = 0; + + // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) + bins btw_minSubnorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F64_M_BITS)) - 1)]}; + } + + F128_btw_minSubnorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { + type_option.weight = 0; + + // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) + bins btw_minSubnorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F128_M_BITS)) - 1)]}; + } + + F16_btw_minSubnorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { + type_option.weight = 0; + + // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) + bins btw_minSubnorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F16_M_BITS)) - 1)]}; + } + + BF16_btw_minSubnorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { + type_option.weight = 0; + + // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) + bins btw_minSubnorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - BF16_M_BITS)) - 1)]}; + } + // case ix FP_minNorm_p5_exp_range: coverpoint CFI.intermX { type_option.weight = 0; From 066a82114ab76fe25572273fd010ca030b1a3558 Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Mon, 27 Apr 2026 18:53:15 -0700 Subject: [PATCH 06/13] remove depricated plus/minus 3ulp coverpoints --- coverage/covergroups/B5.svh | 178 ++++++++++++++---------------------- 1 file changed, 71 insertions(+), 107 deletions(-) diff --git a/coverage/covergroups/B5.svh b/coverage/covergroups/B5.svh index 9700edc..850cf3b 100644 --- a/coverage/covergroups/B5.svh +++ b/coverage/covergroups/B5.svh @@ -77,223 +77,187 @@ covergroup B5_cg (virtual coverfloat_interface CFI); } // cases iii & iv - F32_minSubnorm_pm_3ulp: coverpoint CFI.intermM[(INTERM_M_BITS - F32_M_BITS) -: 3] - iff (CFI.intermX == 0 && CFI.intermM[(INTERM_M_BITS - 1) -: F32_M_BITS - 1] == 0) { - type_option.weight = 0; - - bins minSubNorm_pm_3ulp[] = {[3'b001 : 3'b111]}; - } - - F64_minSubnorm_pm_3ulp: coverpoint CFI.intermM[(INTERM_M_BITS - F64_M_BITS) -: 3] - iff (CFI.intermX == 0 && CFI.intermM[(INTERM_M_BITS - 1) -: F64_M_BITS - 1] == 0) { - type_option.weight = 0; - - bins minSubNorm_pm_3ulp[] = {[3'b001 : 3'b111]}; - } - - F128_minSubnorm_pm_3ulp: coverpoint CFI.intermM[(INTERM_M_BITS - F128_M_BITS) -: 3] - iff (CFI.intermX == 0 && CFI.intermM[(INTERM_M_BITS - 1) -: F128_M_BITS - 1] == 0) { - type_option.weight = 0; - - bins minSubNorm_pm_3ulp[] = {[3'b001 : 3'b111]}; - } - - F16_minSubnorm_pm_3ulp: coverpoint CFI.intermM[(INTERM_M_BITS - F16_M_BITS) -: 3] - iff (CFI.intermX == 0 && CFI.intermM[(INTERM_M_BITS - 1) -: F16_M_BITS - 1] == 0) { - type_option.weight = 0; - - bins minSubNorm_pm_3ulp[] = {[3'b001 : 3'b111]}; - } - - BF16_minSubnorm_pm_3ulp: coverpoint CFI.intermM[(INTERM_M_BITS - BF16_M_BITS) -: 3] - iff (CFI.intermX == 0 && CFI.intermM[(INTERM_M_BITS - 1) -: BF16_M_BITS - 1] == 0) { - type_option.weight = 0; - - bins minSubNorm_pm_3ulp[] = {[3'b001 : 3'b111]}; - } - - // cases v & vi // Guard bit sticky bit - F32_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} - // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) - iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == 0) { + F32_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == 1) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; } // Guard bit sticky bit - F32_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} - // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == '1) { + F32_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == 0) { type_option.weight = 0; - bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; } // Guard bit sticky bit - F64_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} - // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) - iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == 0) { + F64_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == 1) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; } // Guard bit sticky bit - F64_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} - // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == '1) { + F64_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == 0) { type_option.weight = 0; - bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; } // Guard bit sticky bit - F128_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} - // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) - iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == 0) { + F128_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == 1) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; } // Guard bit sticky bit - F128_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} - // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == '1) { + F128_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == 0) { type_option.weight = 0; - bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; } // Guard bit sticky bit - F16_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} - // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) - iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == 0) { + F16_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == 1) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; } // Guard bit sticky bit - F16_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} - // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == '1) { + F16_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == 0) { type_option.weight = 0; - bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; } // Guard bit sticky bit - BF16_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} - // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) - iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == 0) { + BF16_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == 1) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; } // Guard bit sticky bit - BF16_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} - // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == '1) { + BF16_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == 0) { type_option.weight = 0; - bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; } - // cases vii & viii + // cases v & vi // Guard bit sticky bit - F32_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} - // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == 1) { + F32_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} + // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == 0) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; } // Guard bit sticky bit - F32_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} - // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == 0) { + F32_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == '1) { type_option.weight = 0; - bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; } // Guard bit sticky bit - F64_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} - // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == 1) { + F64_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} + // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == 0) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; } // Guard bit sticky bit - F64_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} - // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == 0) { + F64_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == '1) { type_option.weight = 0; - bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; } // Guard bit sticky bit - F128_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} - // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == 1) { + F128_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} + // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == 0) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; } // Guard bit sticky bit - F128_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} - // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == 0) { + F128_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == '1) { type_option.weight = 0; - bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; } // Guard bit sticky bit - F16_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} - // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == 1) { + F16_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} + // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == 0) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; } // Guard bit sticky bit - F16_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} - // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == 0) { + F16_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == '1) { type_option.weight = 0; - bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; } // Guard bit sticky bit - BF16_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} - // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == 1) { + BF16_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} + // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == 0) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; } // Guard bit sticky bit - BF16_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} - // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == 0) { + BF16_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} + // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == '1) { type_option.weight = 0; - bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; } From 8f1d1442bc5f3af2fccabad9c226e2dca51df779 Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Mon, 27 Apr 2026 19:07:47 -0700 Subject: [PATCH 07/13] Correct minNorm cp iff ranges --- coverage/covergroups/B5.svh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/coverage/covergroups/B5.svh b/coverage/covergroups/B5.svh index 850cf3b..cd90edb 100644 --- a/coverage/covergroups/B5.svh +++ b/coverage/covergroups/B5.svh @@ -173,7 +173,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F32_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) - iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == 0) { + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -1 -: F32_M_BITS] == 0) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; @@ -182,7 +182,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F32_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == '1) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 -: F32_M_BITS] == '1) { type_option.weight = 0; bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; @@ -191,7 +191,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F64_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) - iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == 0) { + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -1 -: F64_M_BITS] == 0) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; @@ -200,7 +200,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F64_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == '1) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 -: F64_M_BITS] == '1) { type_option.weight = 0; bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; @@ -209,7 +209,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F128_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) - iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == 0) { + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -1 -: F128_M_BITS] == 0) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; @@ -218,7 +218,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F128_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == '1) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 -: F128_M_BITS] == '1) { type_option.weight = 0; bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; @@ -227,7 +227,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F16_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) - iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == 0) { + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -1 -: F16_M_BITS] == 0) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; @@ -236,7 +236,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F16_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == '1) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 -: F16_M_BITS] == '1) { type_option.weight = 0; bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; @@ -245,7 +245,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit BF16_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) - iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == 0) { + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -1 -: BF16_M_BITS] == 0) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; @@ -254,7 +254,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit BF16_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) all ones fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == '1) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 -: BF16_M_BITS] == '1) { type_option.weight = 0; bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; From a6a9b185ec99e01d525fa8b0541b2a359ef6ac78 Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Mon, 27 Apr 2026 19:23:54 -0700 Subject: [PATCH 08/13] standardize SubNorm case --- coverage/covergroups/B5.svh | 50 ++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/coverage/covergroups/B5.svh b/coverage/covergroups/B5.svh index cd90edb..70f3e4d 100644 --- a/coverage/covergroups/B5.svh +++ b/coverage/covergroups/B5.svh @@ -262,39 +262,39 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // cases vii & viii - F32_btw_minSubnorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { + F32_btw_minSubNorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { type_option.weight = 0; // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) - bins btw_minSubnorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F32_M_BITS)) - 1)]}; + bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F32_M_BITS)) - 1)]}; } - F64_btw_minSubnorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { + F64_btw_minSubNorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { type_option.weight = 0; // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) - bins btw_minSubnorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F64_M_BITS)) - 1)]}; + bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F64_M_BITS)) - 1)]}; } - F128_btw_minSubnorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { + F128_btw_minSubNorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { type_option.weight = 0; // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) - bins btw_minSubnorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F128_M_BITS)) - 1)]}; + bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F128_M_BITS)) - 1)]}; } - F16_btw_minSubnorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { + F16_btw_minSubNorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { type_option.weight = 0; // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) - bins btw_minSubnorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F16_M_BITS)) - 1)]}; + bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F16_M_BITS)) - 1)]}; } - BF16_btw_minSubnorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { + BF16_btw_minSubNorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { type_option.weight = 0; // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) - bins btw_minSubnorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - BF16_M_BITS)) - 1)]}; + bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - BF16_M_BITS)) - 1)]}; } // case ix @@ -314,51 +314,51 @@ covergroup B5_cg (virtual coverfloat_interface CFI); `ifdef COVER_F32 B5_F32_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F32_result_fmt; - B5_F32_minSubnorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F32_minSubnorm_p_3ulp, F32_result_fmt; - B5_F32_minSubnorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F32_minSubnorm_m_3ulp, F32_result_fmt; + B5_F32_minSubNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F32_minSubNorm_p_3ulp, F32_result_fmt; + B5_F32_minSubNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F32_minSubNorm_m_3ulp, F32_result_fmt; B5_F32_minNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F32_minNorm_p_3ulp, F32_result_fmt; B5_F32_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F32_minNorm_m_3ulp, F32_result_fmt; - B5_F32_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F32_btw_minSubnorm_zero, F32_result_fmt; + B5_F32_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F32_btw_minSubNorm_zero, F32_result_fmt; B5_F32_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F32_result_fmt; `endif `ifdef COVER_F64 B5_F64_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F64_result_fmt; - B5_F64_minSubnorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F64_minSubnorm_p_3ulp, F64_result_fmt; - B5_F64_minSubnorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F64_minSubnorm_m_3ulp, F64_result_fmt; + B5_F64_minSubNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F64_minSubNorm_p_3ulp, F64_result_fmt; + B5_F64_minSubNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F64_minSubNorm_m_3ulp, F64_result_fmt; B5_F64_minNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F64_minNorm_p_3ulp, F64_result_fmt; B5_F64_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F64_minNorm_m_3ulp, F64_result_fmt; - B5_F64_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F64_btw_minSubnorm_zero, F64_result_fmt; + B5_F64_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F64_btw_minSubNorm_zero, F64_result_fmt; B5_F64_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F64_result_fmt; `endif `ifdef COVER_F128 B5_F128_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F128_result_fmt; - B5_F128_minSubnorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F128_minSubnorm_p_3ulp, F128_result_fmt; - B5_F128_minSubnorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F128_minSubnorm_m_3ulp, F128_result_fmt; + B5_F128_minSubNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F128_minSubNorm_p_3ulp, F128_result_fmt; + B5_F128_minSubNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F128_minSubNorm_m_3ulp, F128_result_fmt; B5_F128_minNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F128_minNorm_p_3ulp, F128_result_fmt; B5_F128_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F128_minNorm_m_3ulp, F128_result_fmt; - B5_F128_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F128_btw_minSubnorm_zero, F128_result_fmt; + B5_F128_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F128_btw_minSubNorm_zero, F128_result_fmt; B5_F128_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F128_result_fmt; `endif `ifdef COVER_F16 B5_F16_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F16_result_fmt; - B5_F16_minSubnorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F16_minSubnorm_p_3ulp, F16_result_fmt; - B5_F16_minSubnorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F16_minSubnorm_m_3ulp, F16_result_fmt; + B5_F16_minSubNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F16_minSubNorm_p_3ulp, F16_result_fmt; + B5_F16_minSubNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F16_minSubNorm_m_3ulp, F16_result_fmt; B5_F16_minNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F16_minNorm_p_3ulp, F16_result_fmt; B5_F16_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F16_minNorm_m_3ulp, F16_result_fmt; - B5_F16_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, F16_btw_minSubnorm_zero, F16_result_fmt; + B5_F16_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F16_btw_minSubNorm_zero, F16_result_fmt; B5_F16_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F16_result_fmt; `endif `ifdef COVER_BF16 B5_BF16_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, BF16_result_fmt; - B5_BF16_minSubnorm_p_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minSubnorm_p_3ulp, BF16_result_fmt; - B5_BF16_minSubnorm_m_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minSubnorm_m_3ulp, BF16_result_fmt; + B5_BF16_minSubNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minSubNorm_p_3ulp, BF16_result_fmt; + B5_BF16_minSubNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minSubNorm_m_3ulp, BF16_result_fmt; B5_BF16_minNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minNorm_p_3ulp, BF16_result_fmt; B5_BF16_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minNorm_m_3ulp, BF16_result_fmt; - B5_BF16_btw_minSubnorm_zero: cross FP_result_ops, rounding_mode_all, BF16_btw_minSubnorm_zero, BF16_result_fmt; + B5_BF16_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, BF16_btw_minSubNorm_zero, BF16_result_fmt; B5_BF16_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, BF16_result_fmt; `endif From 544cc1189aa975b9bcf324c91fd876587593d110 Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Mon, 27 Apr 2026 19:27:44 -0700 Subject: [PATCH 09/13] Correct minsubnorm +/- 3ulp IFF ranges --- coverage/covergroups/B5.svh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/coverage/covergroups/B5.svh b/coverage/covergroups/B5.svh index 70f3e4d..2da873e 100644 --- a/coverage/covergroups/B5.svh +++ b/coverage/covergroups/B5.svh @@ -81,7 +81,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F32_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == 1) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS +1] == 1) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; @@ -90,7 +90,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F32_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS] == 0) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS +1] == 0) { type_option.weight = 0; bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; @@ -99,7 +99,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F64_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == 1) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS +1] == 1) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; @@ -108,7 +108,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F64_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS] == 0) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS +1] == 0) { type_option.weight = 0; bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; @@ -117,7 +117,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F128_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == 1) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS +1] == 1) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; @@ -126,7 +126,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F128_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS] == 0) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS +1] == 0) { type_option.weight = 0; bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; @@ -135,7 +135,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F16_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == 1) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS +1] == 1) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; @@ -144,7 +144,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F16_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS] == 0) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS +1] == 0) { type_option.weight = 0; bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; @@ -153,7 +153,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit BF16_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == 1) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS +1] == 1) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; @@ -162,7 +162,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit BF16_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS] == 0) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS +1] == 0) { type_option.weight = 0; bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; From f5a2369d5028d47015773194929d172e1831596d Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Mon, 27 Apr 2026 19:30:56 -0700 Subject: [PATCH 10/13] Typo fix --- coverage/covergroups/B14.svh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coverage/covergroups/B14.svh b/coverage/covergroups/B14.svh index e9e3100..899823b 100644 --- a/coverage/covergroups/B14.svh +++ b/coverage/covergroups/B14.svh @@ -80,7 +80,7 @@ covergroup B14_cg (virtual coverfloat_interface CFI); type_option.weight = 0; bins big_neg_shift = {[ $ : -(2*F16_P + 2)]}; - bins mid_shift[] = {[-(2*F16_P + 1) : (F16_P + 1) ]};~ + bins mid_shift[] = {[-(2*F16_P + 1) : (F16_P + 1) ]}; bins big_pos_shift = {[ (F16_P + 2) : $ ]}; } From 7a1781abdf1a0fda1801a0e7a8295c4f9df7ff9e Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Tue, 28 Apr 2026 00:38:17 -0700 Subject: [PATCH 11/13] restore add/sub with necessary coverage restrictions --- coverage/covergroups/B5.svh | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/coverage/covergroups/B5.svh b/coverage/covergroups/B5.svh index 2da873e..f89238e 100644 --- a/coverage/covergroups/B5.svh +++ b/coverage/covergroups/B5.svh @@ -23,6 +23,8 @@ covergroup B5_cg (virtual coverfloat_interface CFI); FP_result_ops: coverpoint CFI.op { type_option.weight = 0; + bins add = {OP_ADD}; + bins sub = {OP_SUB}; bins mul = {OP_MUL}; bins div = {OP_DIV}; bins fmadd = {OP_FMADD}; @@ -315,7 +317,9 @@ covergroup B5_cg (virtual coverfloat_interface CFI); `ifdef COVER_F32 B5_F32_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F32_result_fmt; B5_F32_minSubNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F32_minSubNorm_p_3ulp, F32_result_fmt; - B5_F32_minSubNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F32_minSubNorm_m_3ulp, F32_result_fmt; + B5_F32_minSubNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F32_minSubNorm_m_3ulp, F32_result_fmt { + ignore_bins impossible_addsub = binsof(FP_result_ops.add) && binsof(FP_result_ops.add); + } B5_F32_minNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F32_minNorm_p_3ulp, F32_result_fmt; B5_F32_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F32_minNorm_m_3ulp, F32_result_fmt; B5_F32_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F32_btw_minSubNorm_zero, F32_result_fmt; @@ -325,7 +329,9 @@ covergroup B5_cg (virtual coverfloat_interface CFI); `ifdef COVER_F64 B5_F64_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F64_result_fmt; B5_F64_minSubNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F64_minSubNorm_p_3ulp, F64_result_fmt; - B5_F64_minSubNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F64_minSubNorm_m_3ulp, F64_result_fmt; + B5_F64_minSubNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F64_minSubNorm_m_3ulp, F64_result_fmt { + ignore_bins impossible_addsub = binsof(FP_result_ops.add) && binsof(FP_result_ops.add); + } B5_F64_minNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F64_minNorm_p_3ulp, F64_result_fmt; B5_F64_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F64_minNorm_m_3ulp, F64_result_fmt; B5_F64_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F64_btw_minSubNorm_zero, F64_result_fmt; @@ -335,7 +341,9 @@ covergroup B5_cg (virtual coverfloat_interface CFI); `ifdef COVER_F128 B5_F128_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F128_result_fmt; B5_F128_minSubNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F128_minSubNorm_p_3ulp, F128_result_fmt; - B5_F128_minSubNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F128_minSubNorm_m_3ulp, F128_result_fmt; + B5_F128_minSubNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F128_minSubNorm_m_3ulp, F128_result_fmt { + ignore_bins impossible_addsub = binsof(FP_result_ops.add) && binsof(FP_result_ops.add); + } B5_F128_minNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F128_minNorm_p_3ulp, F128_result_fmt; B5_F128_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F128_minNorm_m_3ulp, F128_result_fmt; B5_F128_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F128_btw_minSubNorm_zero, F128_result_fmt; @@ -345,7 +353,9 @@ covergroup B5_cg (virtual coverfloat_interface CFI); `ifdef COVER_F16 B5_F16_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F16_result_fmt; B5_F16_minSubNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F16_minSubNorm_p_3ulp, F16_result_fmt; - B5_F16_minSubNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F16_minSubNorm_m_3ulp, F16_result_fmt; + B5_F16_minSubNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F16_minSubNorm_m_3ulp, F16_result_fmt { + ignore_bins impossible_addsub = binsof(FP_result_ops.add) && binsof(FP_result_ops.add); + } B5_F16_minNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, F16_minNorm_p_3ulp, F16_result_fmt; B5_F16_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F16_minNorm_m_3ulp, F16_result_fmt; B5_F16_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F16_btw_minSubNorm_zero, F16_result_fmt; @@ -355,7 +365,9 @@ covergroup B5_cg (virtual coverfloat_interface CFI); `ifdef COVER_BF16 B5_BF16_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, BF16_result_fmt; B5_BF16_minSubNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minSubNorm_p_3ulp, BF16_result_fmt; - B5_BF16_minSubNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minSubNorm_m_3ulp, BF16_result_fmt; + B5_BF16_minSubNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minSubNorm_m_3ulp, BF16_result_fmt { + ignore_bins impossible_addsub = binsof(FP_result_ops.add) && binsof(FP_result_ops.add); + } B5_BF16_minNorm_p_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minNorm_p_3ulp, BF16_result_fmt; B5_BF16_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minNorm_m_3ulp, BF16_result_fmt; B5_BF16_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, BF16_btw_minSubNorm_zero, BF16_result_fmt; From 90ed7f586d396272152bf9b3ec2533043d59039e Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Tue, 28 Apr 2026 02:29:03 -0700 Subject: [PATCH 12/13] WIP: adding converts; missing helper cps --- coverage/covergroups/B5.svh | 632 +++++++++++++++++++++++++++++++++++- 1 file changed, 630 insertions(+), 2 deletions(-) diff --git a/coverage/covergroups/B5.svh b/coverage/covergroups/B5.svh index f89238e..dbecf43 100644 --- a/coverage/covergroups/B5.svh +++ b/coverage/covergroups/B5.svh @@ -311,8 +311,136 @@ covergroup B5_cg (virtual coverfloat_interface CFI); Main Coverpoints ************************************************************************/ -// TODO: Missing certain ignore bins -// TODO: Missing narrowing converts +// TODO: need to add helper coverpoints for int formats, and fmt coverpoints for available conversion destination formats + + B5_int_convert_subnorm: cross FP_convert_ops, rounding_mode_all, FP_subnorm, FP_convert_fmt, int_result_fmt { + bins narrow_f64_to_int = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_int = binsof(FP_convert_fmt.fmt_quad); + } + B5_uint_convert_subnorm: cross FP_convert_ops, rounding_mode_all, FP_subnorm, FP_convert_fmt, uint_result_fmt { + bins narrow_f64_to_uint = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_uint = binsof(FP_convert_fmt.fmt_quad); + } + + B5_int_convert_minSubNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, int_minSubNorm_p_3ulp, FP_convert_fmt, int_result_fmt { + bins narrow_f64_to_int = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_int = binsof(FP_convert_fmt.fmt_quad); + } + B5_uint_convert_minSubNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, uint_minSubNorm_p_3ulp, FP_convert_fmt, uint_result_fmt { + bins narrow_f64_to_uint = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_uint = binsof(FP_convert_fmt.fmt_quad); + } + + B5_int_convert_minSubNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, int_minSubNorm_m_3ulp, FP_convert_fmt, int_result_fmt { + bins narrow_f64_to_int = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_int = binsof(FP_convert_fmt.fmt_quad); + } + B5_uint_convert_minSubNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, uint_minSubNorm_m_3ulp, FP_convert_fmt, uint_result_fmt { + bins narrow_f64_to_uint = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_uint = binsof(FP_convert_fmt.fmt_quad); + } + + B5_int_convert_minNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, int_minNorm_p_3ulp, FP_convert_fmt, int_result_fmt { + bins narrow_f64_to_int = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_int = binsof(FP_convert_fmt.fmt_quad); + } + B5_uint_convert_minNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, uint_minNorm_p_3ulp, FP_convert_fmt, uint_result_fmt { + bins narrow_f64_to_uint = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_uint = binsof(FP_convert_fmt.fmt_quad); + } + + B5_int_convert_minNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, int_minNorm_m_3ulp, FP_convert_fmt, int_result_fmt { + bins narrow_f64_to_int = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_int = binsof(FP_convert_fmt.fmt_quad); + } + B5_uint_convert_minNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, uint_minNorm_m_3ulp, FP_convert_fmt, uint_result_fmt { + bins narrow_f64_to_uint = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_uint = binsof(FP_convert_fmt.fmt_quad); + } + + B5_int_convert_btw_minSubNorm_zero: cross FP_convert_ops, rounding_mode_all, int_btw_minSubNorm_zero, FP_convert_fmt, int_result_fmt { + bins narrow_f64_to_int = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_int = binsof(FP_convert_fmt.fmt_quad); + } + B5_uint_convert_btw_minSubNorm_zero: cross FP_convert_ops, rounding_mode_all, uint_btw_minSubNorm_zero, FP_convert_fmt, uint_result_fmt { + bins narrow_f64_to_uint = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_uint = binsof(FP_convert_fmt.fmt_quad); + } + + B5_int_convert_minNorm_p5_exp_range: cross FP_convert_ops, rounding_mode_all, FP_minNorm_p5_exp_range, FP_convert_fmt, int_result_fmt { + bins narrow_f64_to_int = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_int = binsof(FP_convert_fmt.fmt_quad); + } + B5_uint_convert_minNorm_p5_exp_range: cross FP_convert_ops, rounding_mode_all, FP_minNorm_p5_exp_range, FP_convert_fmt, uint_result_fmt { + bins narrow_f64_to_uint = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_uint = binsof(FP_convert_fmt.fmt_quad); + } + + `ifdef COVER_LONG + + B5_long_convert_subnorm: cross FP_convert_ops, rounding_mode_all, FP_subnorm, FP_convert_fmt, long_result_fmt { + bins narrow_f64_to_long = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_long = binsof(FP_convert_fmt.fmt_quad); + } + B5_ulong_convert_subnorm: cross FP_convert_ops, rounding_mode_all, FP_subnorm, FP_convert_fmt, ulong_result_fmt { + bins narrow_f64_to_ulong = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_ulong = binsof(FP_convert_fmt.fmt_quad); + } + + B5_long_convert_minSubNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, long_minSubNorm_p_3ulp, FP_convert_fmt, long_result_fmt { + bins narrow_f64_to_long = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_long = binsof(FP_convert_fmt.fmt_quad); + } + B5_ulong_convert_minSubNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, ulong_minSubNorm_p_3ulp, FP_convert_fmt, ulong_result_fmt { + bins narrow_f64_to_ulong = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_ulong = binsof(FP_convert_fmt.fmt_quad); + } + + B5_long_convert_minSubNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, long_minSubNorm_m_3ulp, FP_convert_fmt, long_result_fmt { + bins narrow_f64_to_long = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_long = binsof(FP_convert_fmt.fmt_quad); + } + B5_ulong_convert_minSubNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, ulong_minSubNorm_m_3ulp, FP_convert_fmt, ulong_result_fmt { + bins narrow_f64_to_ulong = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_ulong = binsof(FP_convert_fmt.fmt_quad); + } + + B5_long_convert_minNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, long_minNorm_p_3ulp, FP_convert_fmt, long_result_fmt { + bins narrow_f64_to_long = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_long = binsof(FP_convert_fmt.fmt_quad); + } + B5_ulong_convert_minNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, ulong_minNorm_p_3ulp, FP_convert_fmt, ulong_result_fmt { + bins narrow_f64_to_ulong = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_ulong = binsof(FP_convert_fmt.fmt_quad); + } + + B5_long_convert_minNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, long_minNorm_m_3ulp, FP_convert_fmt, long_result_fmt { + bins narrow_f64_to_long = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_long = binsof(FP_convert_fmt.fmt_quad); + } + B5_ulong_convert_minNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, ulong_minNorm_m_3ulp, FP_convert_fmt, ulong_result_fmt { + bins narrow_f64_to_ulong = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_ulong = binsof(FP_convert_fmt.fmt_quad); + } + + B5_long_convert_btw_minSubNorm_zero: cross FP_convert_ops, rounding_mode_all, long_btw_minSubNorm_zero, FP_convert_fmt, long_result_fmt { + bins narrow_f64_to_long = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_long = binsof(FP_convert_fmt.fmt_quad); + } + B5_ulong_convert_btw_minSubNorm_zero: cross FP_convert_ops, rounding_mode_all, ulong_btw_minSubNorm_zero, FP_convert_fmt, ulong_result_fmt { + bins narrow_f64_to_ulong = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_ulong = binsof(FP_convert_fmt.fmt_quad); + } + + B5_long_convert_minNorm_p5_exp_range: cross FP_convert_ops, rounding_mode_all, FP_minNorm_p5_exp_range, FP_convert_fmt, long_result_fmt { + bins narrow_f64_to_long = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_long = binsof(FP_convert_fmt.fmt_quad); + } + B5_ulong_convert_minNorm_p5_exp_range: cross FP_convert_ops, rounding_mode_all, FP_minNorm_p5_exp_range, FP_convert_fmt, ulong_result_fmt { + bins narrow_f64_to_ulong = binsof(FP_convert_fmt.fmt_double); + bins narrow_f128_to_ulong = binsof(FP_convert_fmt.fmt_quad); + } + `endif // COVER_LONG `ifdef COVER_F32 B5_F32_subnorm: cross FP_result_ops, rounding_mode_all, FP_subnorm, F32_result_fmt; @@ -324,6 +452,106 @@ covergroup B5_cg (virtual coverfloat_interface CFI); B5_F32_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F32_minNorm_m_3ulp, F32_result_fmt; B5_F32_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F32_btw_minSubNorm_zero, F32_result_fmt; B5_F32_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F32_result_fmt; + + + B5_F32_convert_subnorm: cross FP_convert_ops, rounding_mode_all, FP_subnorm, FP_convert_fmt, F32_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_single); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f32 = binsof(FP_convert_fmt.fmt_single); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f32 = binsof(FP_convert_fmt.fmt_single); + `endif // COVER_BF16 + + } + + B5_F32_convert_minSubNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, F32_minSubNorm_p_3ulp, FP_convert_fmt, F32_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_single); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f32 = binsof(FP_convert_fmt.fmt_single); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f32 = binsof(FP_convert_fmt.fmt_single); + `endif // COVER_BF16 + + } + + B5_F32_convert_minSubNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, F32_minSubNorm_m_3ulp, FP_convert_fmt, F32_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_single); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f32 = binsof(FP_convert_fmt.fmt_single); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f32 = binsof(FP_convert_fmt.fmt_single); + `endif // COVER_BF16 + + } + + B5_F32_convert_minNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, F32_minNorm_p_3ulp, FP_convert_fmt, F32_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_single); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f32 = binsof(FP_convert_fmt.fmt_single); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f32 = binsof(FP_convert_fmt.fmt_single); + `endif // COVER_BF16 + + } + + B5_F32_convert_minNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, F32_minNorm_m_3ulp, FP_convert_fmt, F32_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_single); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f32 = binsof(FP_convert_fmt.fmt_single); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f32 = binsof(FP_convert_fmt.fmt_single); + `endif // COVER_BF16 + + } + + B5_F32_convert_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F32_btw_minSubNorm_zero, F32_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_single); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f32 = binsof(FP_convert_fmt.fmt_single); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f32 = binsof(FP_convert_fmt.fmt_single); + `endif // COVER_BF16 + + } + + B5_F32_convert_minNorm_p5_exp_range: cross FP_convert_ops, rounding_mode_all, FP_minNorm_p5_exp_range, FP_convert_fmt, F32_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_single); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f32 = binsof(FP_convert_fmt.fmt_single); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f32 = binsof(FP_convert_fmt.fmt_single); + `endif // COVER_BF16 + + } + `endif `ifdef COVER_F64 @@ -336,6 +564,141 @@ covergroup B5_cg (virtual coverfloat_interface CFI); B5_F64_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F64_minNorm_m_3ulp, F64_result_fmt; B5_F64_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F64_btw_minSubNorm_zero, F64_result_fmt; B5_F64_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F64_result_fmt; + + + B5_F64_convert_subnorm: cross FP_convert_ops, rounding_mode_all, FP_subnorm, FP_convert_fmt, F64_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_double); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_BF16 + + + `ifdef COVER_F32 + ignore_bins widen_f32_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_F32 + + } + + B5_F64_convert_minSubNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, F64_minSubNorm_p_3ulp, FP_convert_fmt, F64_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_double); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_BF16 + + + `ifdef COVER_F32 + ignore_bins widen_f32_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_F32 + + } + + B5_F64_convert_minSubNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, F64_minSubNorm_m_3ulp, FP_convert_fmt, F64_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_double); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_BF16 + + + `ifdef COVER_F32 + ignore_bins widen_f32_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_F32 + + } + + B5_F64_convert_minNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, F64_minNorm_p_3ulp, FP_convert_fmt, F64_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_double); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_BF16 + + + `ifdef COVER_F32 + ignore_bins widen_f32_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_F32 + + } + + B5_F64_convert_minNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, F64_minNorm_m_3ulp, FP_convert_fmt, F64_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_double); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_BF16 + + + `ifdef COVER_F32 + ignore_bins widen_f32_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_F32 + + } + + B5_F64_convert_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F64_btw_minSubNorm_zero, F64_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_double); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_BF16 + + + `ifdef COVER_F32 + ignore_bins widen_f32_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_F32 + + } + + B5_F64_convert_minNorm_p5_exp_range: cross FP_convert_ops, rounding_mode_all, FP_minNorm_p5_exp_range, FP_convert_fmt, F64_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_double); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_BF16 + + + `ifdef COVER_F32 + ignore_bins widen_f32_to_f64 = binsof(FP_convert_fmt.fmt_double); + `endif // COVER_F32 + + } + `endif `ifdef COVER_F128 @@ -348,6 +711,176 @@ covergroup B5_cg (virtual coverfloat_interface CFI); B5_F128_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F128_minNorm_m_3ulp, F128_result_fmt; B5_F128_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F128_btw_minSubNorm_zero, F128_result_fmt; B5_F128_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F128_result_fmt; + + + B5_F128_convert_subnorm: cross FP_convert_ops, rounding_mode_all, FP_subnorm, FP_convert_fmt, F128_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_quad); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_BF16 + + + `ifdef COVER_F32 + ignore_bins widen_f32_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F32 + + + `ifdef COVER_F64 + ignore_bins widen_f64_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F64 + + } + + B5_F128_convert_minSubNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, F128_minSubNorm_p_3ulp, FP_convert_fmt, F128_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_quad); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_BF16 + + + `ifdef COVER_F32 + ignore_bins widen_f32_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F32 + + + `ifdef COVER_F64 + ignore_bins widen_f64_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F64 + + } + + B5_F128_convert_minSubNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, F128_minSubNorm_m_3ulp, FP_convert_fmt, F128_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_quad); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_BF16 + + + `ifdef COVER_F32 + ignore_bins widen_f32_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F32 + + + `ifdef COVER_F64 + ignore_bins widen_f64_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F64 + + } + + B5_F128_convert_minNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, F128_minNorm_p_3ulp, FP_convert_fmt, F128_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_quad); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_BF16 + + + `ifdef COVER_F32 + ignore_bins widen_f32_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F32 + + + `ifdef COVER_F64 + ignore_bins widen_f64_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F64 + + } + + B5_F128_convert_minNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, F128_minNorm_m_3ulp, FP_convert_fmt, F128_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_quad); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_BF16 + + + `ifdef COVER_F32 + ignore_bins widen_f32_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F32 + + + `ifdef COVER_F64 + ignore_bins widen_f64_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F64 + + } + + B5_F128_convert_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F128_btw_minSubNorm_zero, F128_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_quad); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_BF16 + + + `ifdef COVER_F32 + ignore_bins widen_f32_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F32 + + + `ifdef COVER_F64 + ignore_bins widen_f64_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F64 + + } + + B5_F128_convert_minNorm_p5_exp_range: cross FP_convert_ops, rounding_mode_all, FP_minNorm_p5_exp_range, FP_convert_fmt, F128_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_quad); + + `ifdef COVER_F16 + ignore_bins widen_f16_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F16 + + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_BF16 + + + `ifdef COVER_F32 + ignore_bins widen_f32_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F32 + + + `ifdef COVER_F64 + ignore_bins widen_f64_to_f128 = binsof(FP_convert_fmt.fmt_quad); + `endif // COVER_F64 + + } + `endif `ifdef COVER_F16 @@ -360,6 +893,71 @@ covergroup B5_cg (virtual coverfloat_interface CFI); B5_F16_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, F16_minNorm_m_3ulp, F16_result_fmt; B5_F16_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F16_btw_minSubNorm_zero, F16_result_fmt; B5_F16_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, F16_result_fmt; + + + B5_F16_convert_subnorm: cross FP_convert_ops, rounding_mode_all, FP_subnorm, FP_convert_fmt, F16_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_half); + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f16 = binsof(FP_convert_fmt.fmt_half); + `endif // COVER_BF16 + + } + + B5_F16_convert_minSubNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, F16_minSubNorm_p_3ulp, FP_convert_fmt, F16_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_half); + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f16 = binsof(FP_convert_fmt.fmt_half); + `endif // COVER_BF16 + + } + + B5_F16_convert_minSubNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, F16_minSubNorm_m_3ulp, FP_convert_fmt, F16_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_half); + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f16 = binsof(FP_convert_fmt.fmt_half); + `endif // COVER_BF16 + + } + + B5_F16_convert_minNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, F16_minNorm_p_3ulp, FP_convert_fmt, F16_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_half); + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f16 = binsof(FP_convert_fmt.fmt_half); + `endif // COVER_BF16 + + } + + B5_F16_convert_minNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, F16_minNorm_m_3ulp, FP_convert_fmt, F16_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_half); + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f16 = binsof(FP_convert_fmt.fmt_half); + `endif // COVER_BF16 + + } + + B5_F16_convert_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F16_btw_minSubNorm_zero, F16_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_half); + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f16 = binsof(FP_convert_fmt.fmt_half); + `endif // COVER_BF16 + + } + + B5_F16_convert_minNorm_p5_exp_range: cross FP_convert_ops, rounding_mode_all, FP_minNorm_p5_exp_range, FP_convert_fmt, F16_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_half); + + `ifdef COVER_BF16 + ignore_bins widen_bf16_to_f16 = binsof(FP_convert_fmt.fmt_half); + `endif // COVER_BF16 + + } + `endif `ifdef COVER_BF16 @@ -372,6 +970,36 @@ covergroup B5_cg (virtual coverfloat_interface CFI); B5_BF16_minNorm_m_3ulp: cross FP_result_ops, rounding_mode_all, BF16_minNorm_m_3ulp, BF16_result_fmt; B5_BF16_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, BF16_btw_minSubNorm_zero, BF16_result_fmt; B5_BF16_minNorm_p5_exp_range: cross FP_result_ops, rounding_mode_all, FP_minNorm_p5_exp_range, BF16_result_fmt; + + + B5_BF16_convert_subnorm: cross FP_convert_ops, rounding_mode_all, FP_subnorm, FP_convert_fmt, BF16_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_bf16); + } + + B5_BF16_convert_minSubNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, BF16_minSubNorm_p_3ulp, FP_convert_fmt, BF16_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_bf16); + } + + B5_BF16_convert_minSubNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, BF16_minSubNorm_m_3ulp, FP_convert_fmt, BF16_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_bf16); + } + + B5_BF16_convert_minNorm_p_3ulp: cross FP_convert_ops, rounding_mode_all, BF16_minNorm_p_3ulp, FP_convert_fmt, BF16_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_bf16); + } + + B5_BF16_convert_minNorm_m_3ulp: cross FP_convert_ops, rounding_mode_all, BF16_minNorm_m_3ulp, FP_convert_fmt, BF16_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_bf16); + } + + B5_BF16_convert_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, BF16_btw_minSubNorm_zero, BF16_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_bf16); + } + + B5_BF16_convert_minNorm_p5_exp_range: cross FP_convert_ops, rounding_mode_all, FP_minNorm_p5_exp_range, FP_convert_fmt, BF16_result_fmt { + ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_bf16); + } + `endif endgroup From 18e673bedae8a6d856682fbbfc0e89e7eaf85d64 Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Wed, 29 Apr 2026 00:11:39 -0700 Subject: [PATCH 13/13] Fix B5 converts coverage --- coverage/covergroups/B5.svh | 270 +++++++++++++++++++++++++++++++++--- 1 file changed, 250 insertions(+), 20 deletions(-) diff --git a/coverage/covergroups/B5.svh b/coverage/covergroups/B5.svh index dbecf43..b6243cb 100644 --- a/coverage/covergroups/B5.svh +++ b/coverage/covergroups/B5.svh @@ -67,6 +67,63 @@ covergroup B5_cg (virtual coverfloat_interface CFI); bins f128 = {1}; } + int_result_fmt : coverpoint CFI.resultFmt == FMT_INT { + type_option.weight = 0; + // int format for result + bins fmt_int = {1}; + } + uint_result_fmt : coverpoint CFI.resultFmt == FMT_UINT { + type_option.weight = 0; + // uint format for result + bins fmt_uint = {1}; + } + long_result_fmt : coverpoint CFI.resultFmt == FMT_LONG { + type_option.weight = 0; + // long format for result + bins fmt_long = {1}; + } + ulong_result_fmt : coverpoint CFI.resultFmt == FMT_ULONG { + type_option.weight = 0; + // ulong format for result + bins fmt_ulong = {1}; + } + + FP_convert_ops: coverpoint CFI.op { + type_option.weight = 0; + // checks that a convert is happening (F2X, X2F, or F2F) + // operand and result formats infer which type + + bins convert = {OP_CFI, OP_CFF, OP_CIF}; + // bins op_cfi + // bins op_cff + // bins op_cif + } + + FP_convert_fmt: coverpoint CFI.operandFmt { + type_option.weight = 0; + // all formats to convert to + + `ifdef COVER_F16 + bins fmt_half = {FMT_HALF}; + `endif // COVER_F16 + + `ifdef COVER_F32 + bins fmt_single = {FMT_SINGLE}; + `endif // COVER_F32 + + `ifdef COVER_F64 + bins fmt_double = {FMT_DOUBLE}; + `endif // COVER_F64 + + `ifdef COVER_F128 + bins fmt_quad = {FMT_QUAD}; + `endif // COVER_F128 + + `ifdef COVER_BF16 + bins fmt_bf16 = {FMT_BF16}; + `endif // COVER_BF16 + } + /************************************************************************ Underflow Boundary Helper Coverpoints ************************************************************************/ @@ -80,10 +137,82 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // cases iii & iv + // Guard bit sticky bit + int_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_INT)], |CFI.intermM[INTERM_M_BITS - SIZEOF_INT - 1 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_INT +1] == 1) { + type_option.weight = 0; + + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; + } + + // Guard bit sticky bit + uint_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_INT - 1)], |CFI.intermM[INTERM_M_BITS - SIZEOF_INT - 2 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_INT] == 1) { + type_option.weight = 0; + + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; + } + + // Guard bit sticky bit + long_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_LONG)], |CFI.intermM[INTERM_M_BITS - SIZEOF_LONG - 1 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_LONG +1] == 1) { + type_option.weight = 0; + + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; + } + + // Guard bit sticky bit + ulong_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_LONG - 1)], |CFI.intermM[INTERM_M_BITS - SIZEOF_LONG - 2 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_LONG] == 1) { + type_option.weight = 0; + + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; + } + + // Guard bit sticky bit + int_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_INT)], |CFI.intermM[INTERM_M_BITS - SIZEOF_INT - 1 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_INT +1] == 0) { + type_option.weight = 0; + + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + } + + // Guard bit sticky bit + uint_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_INT - 1)], |CFI.intermM[INTERM_M_BITS - SIZEOF_INT - 2 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_INT] == 0) { + type_option.weight = 0; + + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + } + + // Guard bit sticky bit + long_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_LONG)], |CFI.intermM[INTERM_M_BITS - SIZEOF_LONG - 1 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_LONG +1] == 0) { + type_option.weight = 0; + + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + } + + // Guard bit sticky bit + ulong_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_LONG - 1)], |CFI.intermM[INTERM_M_BITS - SIZEOF_LONG - 2 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_LONG] == 0) { + type_option.weight = 0; + + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + } + // Guard bit sticky bit F32_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS +1] == 1) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 -: F32_M_BITS +1] == 1) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; @@ -92,7 +221,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F32_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F32_M_BITS +1] == 0) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 -: F32_M_BITS +1] == 0) { type_option.weight = 0; bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; @@ -101,7 +230,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F64_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS +1] == 1) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 -: F64_M_BITS +1] == 1) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; @@ -110,7 +239,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F64_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F64_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F64_M_BITS +1] == 0) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 -: F64_M_BITS +1] == 0) { type_option.weight = 0; bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; @@ -119,7 +248,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F128_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS +1] == 1) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 -: F128_M_BITS +1] == 1) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; @@ -128,7 +257,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F128_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F128_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F128_M_BITS +1] == 0) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 -: F128_M_BITS +1] == 0) { type_option.weight = 0; bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; @@ -137,7 +266,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F16_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS +1] == 1) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 -: F16_M_BITS +1] == 1) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; @@ -146,7 +275,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit F16_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F16_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: F16_M_BITS +1] == 0) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 -: F16_M_BITS +1] == 0) { type_option.weight = 0; bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; @@ -155,7 +284,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit BF16_minSubNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS +1] == 1) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 -: BF16_M_BITS +1] == 1) { type_option.weight = 0; bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; @@ -164,7 +293,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // Guard bit sticky bit BF16_minSubNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - BF16_M_BITS - 2) : 0]} // implicit leading 0 (subnorm) all zeros fraction (except for Guard and sticky) - iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -: BF16_M_BITS +1] == 0) { + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 -: BF16_M_BITS +1] == 0) { type_option.weight = 0; bins minSubNorm_m_3ulp[] = {[2'b01 : 2'b11]}; @@ -172,6 +301,78 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // cases v & vi + // Guard bit sticky bit + int_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_INT)], |CFI.intermM[INTERM_M_BITS - SIZEOF_INT - 1 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_INT +1] == 0) { + type_option.weight = 0; + + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; + } + + // Guard bit sticky bit + uint_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_INT - 1)], |CFI.intermM[INTERM_M_BITS - SIZEOF_INT - 2 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_INT] == 0) { + type_option.weight = 0; + + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; + } + + // Guard bit sticky bit + long_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_LONG)], |CFI.intermM[INTERM_M_BITS - SIZEOF_LONG - 1 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_LONG +1] == 0) { + type_option.weight = 0; + + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; + } + + // Guard bit sticky bit + ulong_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_LONG - 1)], |CFI.intermM[INTERM_M_BITS - SIZEOF_LONG - 2 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX != 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_LONG] == 0) { + type_option.weight = 0; + + bins minNorm_p_3ulp[] = {[2'b00 : 2'b11]}; + } + + // Guard bit sticky bit + int_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_INT)], |CFI.intermM[INTERM_M_BITS - SIZEOF_INT - 1 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_INT +1] == '1) { + type_option.weight = 0; + + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + } + + // Guard bit sticky bit + uint_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_INT - 1)], |CFI.intermM[INTERM_M_BITS - SIZEOF_INT - 2 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_INT] == '1) { + type_option.weight = 0; + + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + } + + // Guard bit sticky bit + long_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_LONG)], |CFI.intermM[INTERM_M_BITS - SIZEOF_LONG - 1 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_LONG +1] == '1) { + type_option.weight = 0; + + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + } + + // Guard bit sticky bit + ulong_minNorm_m_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - SIZEOF_LONG - 1)], |CFI.intermM[INTERM_M_BITS - SIZEOF_LONG - 2 : 0]} + // implicit leading 0 (subnorm) single 1 in LSB (except for Guard and sticky) + iff (CFI.intermX == 0 && CFI.intermM[INTERM_M_BITS -1 : INTERM_M_BITS - SIZEOF_LONG] == '1) { + type_option.weight = 0; + + bins minNorm_m_3ulp[] = {[2'b01 : 2'b11]}; + } + // Guard bit sticky bit F32_minNorm_p_3ulp: coverpoint {CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 1)], |CFI.intermM[(INTERM_M_BITS - F32_M_BITS - 2) : 0]} // implicit leading 1 (norm) all zero fraction (except for Guard and sticky) @@ -264,39 +465,68 @@ covergroup B5_cg (virtual coverfloat_interface CFI); // cases vii & viii + + int_btw_minSubNorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { + type_option.weight = 0; + + // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) + bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - SIZEOF_INT - 1)) - 1)]}; + } + + uint_btw_minSubNorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { + type_option.weight = 0; + + // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) + bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - SIZEOF_INT - 2)) - 1)]}; + } + + long_btw_minSubNorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { + type_option.weight = 0; + + // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) + bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - SIZEOF_LONG - 1)) - 1)]}; + } + + ulong_btw_minSubNorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { + type_option.weight = 0; + + // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) + bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - SIZEOF_LONG - 2)) - 1)]}; + } + F32_btw_minSubNorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { type_option.weight = 0; // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) - bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F32_M_BITS)) - 1)]}; + bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F32_M_BITS - 2)) - 1)]}; } F64_btw_minSubNorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { type_option.weight = 0; // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) - bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F64_M_BITS)) - 1)]}; + bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F64_M_BITS - 2)) - 1)]}; } F128_btw_minSubNorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { type_option.weight = 0; // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) - bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F128_M_BITS)) - 1)]}; + bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F128_M_BITS - 2)) - 1)]}; } F16_btw_minSubNorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { type_option.weight = 0; // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) - bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F16_M_BITS)) - 1)]}; + bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - F16_M_BITS - 2)) - 1)]}; } BF16_btw_minSubNorm_zero: coverpoint CFI.intermM iff (CFI.intermX == 0) { type_option.weight = 0; // shift 1 into the ULP position, subtract one to be in the exclusive range (0 , minSubNorm) - bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - BF16_M_BITS)) - 1)]}; + bins btw_minSubNorm_zero = {[1 : ((INTERM_M_BITS'(1) << (INTERM_M_BITS - BF16_M_BITS - 2)) - 1)]}; } // case ix @@ -524,7 +754,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); } - B5_F32_convert_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F32_btw_minSubNorm_zero, F32_result_fmt { + B5_F32_convert_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F32_btw_minSubNorm_zero, FP_convert_fmt, F32_result_fmt { ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_single); `ifdef COVER_F16 @@ -661,7 +891,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); } - B5_F64_convert_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F64_btw_minSubNorm_zero, F64_result_fmt { + B5_F64_convert_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F64_btw_minSubNorm_zero, FP_convert_fmt, F64_result_fmt { ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_double); `ifdef COVER_F16 @@ -833,7 +1063,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); } - B5_F128_convert_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F128_btw_minSubNorm_zero, F128_result_fmt { + B5_F128_convert_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F128_btw_minSubNorm_zero, FP_convert_fmt, F128_result_fmt { ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_quad); `ifdef COVER_F16 @@ -940,7 +1170,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); } - B5_F16_convert_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F16_btw_minSubNorm_zero, F16_result_fmt { + B5_F16_convert_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, F16_btw_minSubNorm_zero, FP_convert_fmt, F16_result_fmt { ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_half); `ifdef COVER_BF16 @@ -992,7 +1222,7 @@ covergroup B5_cg (virtual coverfloat_interface CFI); ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_bf16); } - B5_BF16_convert_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, BF16_btw_minSubNorm_zero, BF16_result_fmt { + B5_BF16_convert_btw_minSubNorm_zero: cross FP_result_ops, rounding_mode_all, BF16_btw_minSubNorm_zero, FP_convert_fmt, BF16_result_fmt { ignore_bins invalid_convert = binsof(FP_convert_fmt.fmt_bf16); }