diff --git a/src/V3AstInlines.h b/src/V3AstInlines.h index cb13fa21a..3542839b1 100644 --- a/src/V3AstInlines.h +++ b/src/V3AstInlines.h @@ -34,7 +34,7 @@ int AstNode::widthInstrs() const { return (!dtypep() ? 1 : (dtypep()->isWide() ? dtypep()->widthWords() : 1)); } bool AstNode::isDouble() const VL_MT_STABLE { - return dtypep() && VN_IS(dtypep(), BasicDType) && VN_AS(dtypep(), BasicDType)->isDouble(); + return dtypep() && dtypep()->basicp() && dtypep()->basicp()->isDouble(); } bool AstNode::isString() const VL_MT_STABLE { return dtypep() && dtypep()->basicp() && dtypep()->basicp()->isString(); diff --git a/src/V3Number.h b/src/V3Number.h index 5b6fa517e..85cd4d150 100644 --- a/src/V3Number.h +++ b/src/V3Number.h @@ -408,7 +408,7 @@ public: if (bit < 0) return false; if (bit >= m_data.width()) return !bitIsXZ(m_data.width() - 1); const ValueAndX v = m_data.num()[bit / 32]; - return ((v.m_value & (1UL << (bit & 31))) == 0 && !(v.m_valueX & (1UL << (bit & 31)))); + return ((v.m_value | v.m_valueX) & (1UL << (bit & 31))) == 0; } bool bitIs1(int bit) const VL_MT_SAFE { if (!isNumber()) return false; diff --git a/test_regress/t/t_class_param.v b/test_regress/t/t_class_param.v index 08dd1f61b..38757c1a9 100644 --- a/test_regress/t/t_class_param.v +++ b/test_regress/t/t_class_param.v @@ -62,7 +62,7 @@ class Sum #(type T); static int sum; static function void add(T element); sum += int'(element); - endfunction + endfunction endclass class IntQueue; @@ -221,8 +221,11 @@ module t (/*AUTOARG*/); qi.q = '{2, 4, 6, 0, 2}; if (qi.getSum() != 14) $stop; Sum#(int)::add(arr[0]); - if(Sum#(int)::sum != 16) $stop; - if(Sum#(real)::sum != 0) $stop; + if (Sum#(int)::sum != 16) $stop; + + if (Sum#(real)::sum != 0) $stop; + Sum#(real)::add(1.9); // rounds + if (Sum#(real)::sum != 2) $stop; if (ClsParam#(ClsStatic)::param_t::x != 1) $stop; if (ClsParam#(ClsStatic)::param_t::get_2() != 2) $stop; @@ -231,7 +234,7 @@ module t (/*AUTOARG*/); if (cls_param_field.get(2) != 7) $stop; dict_op.set("abcd", 1); - if(dict_op.get("abcd") != 1) $stop; + if (dict_op.get("abcd") != 1) $stop; if (getter1.get_1() != 1) $stop; if (Getter1#()::get_1() != 1) $stop; diff --git a/test_regress/t/t_cover_toggle.out b/test_regress/t/t_cover_toggle.out index 065e014a0..5d0010643 100644 --- a/test_regress/t/t_cover_toggle.out +++ b/test_regress/t/t_cover_toggle.out @@ -12,7 +12,7 @@ 000019 input clk; input real check_real; // Check issue #2741 - 000021 input real check_array_real [1:0]; + input real check_array_real [1:0]; input string check_string; // Check issue #2766 typedef struct packed { diff --git a/test_regress/t/t_cover_toggle__points.out b/test_regress/t/t_cover_toggle__points.out index 17279cd14..7e220867b 100644 --- a/test_regress/t/t_cover_toggle__points.out +++ b/test_regress/t/t_cover_toggle__points.out @@ -13,9 +13,7 @@ 000019 input clk; +000019 point: comment=clk hier=top.t input real check_real; // Check issue #2741 - 000021 input real check_array_real [1:0]; -+000021 point: comment=check_array_real[0] hier=top.t -+000021 point: comment=check_array_real[1] hier=top.t + input real check_array_real [1:0]; input string check_string; // Check issue #2766 typedef struct packed { diff --git a/test_regress/t/t_dpi_open_oob_bad.out b/test_regress/t/t_dpi_open_oob_bad.out index a40343874..b89413bf3 100644 --- a/test_regress/t/t_dpi_open_oob_bad.out +++ b/test_regress/t/t_dpi_open_oob_bad.out @@ -5,14 +5,22 @@ dpii_int_u3: %Warning: DPI svOpenArrayHandle function index 1 out of bounds; 10 outside [2:-2]. %Warning: DPI svOpenArrayHandle function called on 3 dimensional array using 1 dimensional function. dpii_real_u1: -%Warning: DPI svOpenArrayHandle function unsupported datatype (5). -%Warning: DPI svOpenArrayHandle function unsupported datatype (5). -%Warning: DPI svOpenArrayHandle function unsupported datatype (5). -%Warning: DPI svOpenArrayHandle function unsupported datatype (5). -%Warning: DPI svOpenArrayHandle function unsupported datatype (5). -%Warning: DPI svOpenArrayHandle function unsupported datatype (5). -%Warning: DPI svOpenArrayHandle function unsupported datatype (5). -%Warning: DPI svOpenArrayHandle function unsupported datatype (5). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). +%Warning: DPI svOpenArrayHandle function unsupported datatype (8). dpii_bit_u6: %Warning: DPI svOpenArrayHandle function called on 6 dimensional array using -1 dimensional function. %Warning: DPI svOpenArrayHandle function called on 6 dimensional array using -1 dimensional function.