Fix casting etc of typedef'ed doubles.
This commit is contained in:
parent
27ad648c16
commit
11cfa61f80
|
|
@ -34,7 +34,7 @@ int AstNode::widthInstrs() const {
|
||||||
return (!dtypep() ? 1 : (dtypep()->isWide() ? dtypep()->widthWords() : 1));
|
return (!dtypep() ? 1 : (dtypep()->isWide() ? dtypep()->widthWords() : 1));
|
||||||
}
|
}
|
||||||
bool AstNode::isDouble() const VL_MT_STABLE {
|
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 {
|
bool AstNode::isString() const VL_MT_STABLE {
|
||||||
return dtypep() && dtypep()->basicp() && dtypep()->basicp()->isString();
|
return dtypep() && dtypep()->basicp() && dtypep()->basicp()->isString();
|
||||||
|
|
|
||||||
|
|
@ -408,7 +408,7 @@ public:
|
||||||
if (bit < 0) return false;
|
if (bit < 0) return false;
|
||||||
if (bit >= m_data.width()) return !bitIsXZ(m_data.width() - 1);
|
if (bit >= m_data.width()) return !bitIsXZ(m_data.width() - 1);
|
||||||
const ValueAndX v = m_data.num()[bit / 32];
|
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 {
|
bool bitIs1(int bit) const VL_MT_SAFE {
|
||||||
if (!isNumber()) return false;
|
if (!isNumber()) return false;
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,10 @@ module t (/*AUTOARG*/);
|
||||||
if (qi.getSum() != 14) $stop;
|
if (qi.getSum() != 14) $stop;
|
||||||
Sum#(int)::add(arr[0]);
|
Sum#(int)::add(arr[0]);
|
||||||
if (Sum#(int)::sum != 16) $stop;
|
if (Sum#(int)::sum != 16) $stop;
|
||||||
|
|
||||||
if (Sum#(real)::sum != 0) $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::x != 1) $stop;
|
||||||
if (ClsParam#(ClsStatic)::param_t::get_2() != 2) $stop;
|
if (ClsParam#(ClsStatic)::param_t::get_2() != 2) $stop;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
000019 input clk;
|
000019 input clk;
|
||||||
input real check_real; // Check issue #2741
|
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
|
input string check_string; // Check issue #2766
|
||||||
|
|
||||||
typedef struct packed {
|
typedef struct packed {
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,7 @@
|
||||||
000019 input clk;
|
000019 input clk;
|
||||||
+000019 point: comment=clk hier=top.t
|
+000019 point: comment=clk hier=top.t
|
||||||
input real check_real; // Check issue #2741
|
input real check_real; // Check issue #2741
|
||||||
000021 input real check_array_real [1:0];
|
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 string check_string; // Check issue #2766
|
input string check_string; // Check issue #2766
|
||||||
|
|
||||||
typedef struct packed {
|
typedef struct packed {
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,22 @@ dpii_int_u3:
|
||||||
%Warning: DPI svOpenArrayHandle function index 1 out of bounds; 10 outside [2:-2].
|
%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.
|
%Warning: DPI svOpenArrayHandle function called on 3 dimensional array using 1 dimensional function.
|
||||||
dpii_real_u1:
|
dpii_real_u1:
|
||||||
%Warning: DPI svOpenArrayHandle function unsupported datatype (5).
|
%Warning: DPI svOpenArrayHandle function unsupported datatype (8).
|
||||||
%Warning: DPI svOpenArrayHandle function unsupported datatype (5).
|
%Warning: DPI svOpenArrayHandle function unsupported datatype (8).
|
||||||
%Warning: DPI svOpenArrayHandle function unsupported datatype (5).
|
%Warning: DPI svOpenArrayHandle function unsupported datatype (8).
|
||||||
%Warning: DPI svOpenArrayHandle function unsupported datatype (5).
|
%Warning: DPI svOpenArrayHandle function unsupported datatype (8).
|
||||||
%Warning: DPI svOpenArrayHandle function unsupported datatype (5).
|
%Warning: DPI svOpenArrayHandle function unsupported datatype (8).
|
||||||
%Warning: DPI svOpenArrayHandle function unsupported datatype (5).
|
%Warning: DPI svOpenArrayHandle function unsupported datatype (8).
|
||||||
%Warning: DPI svOpenArrayHandle function unsupported datatype (5).
|
%Warning: DPI svOpenArrayHandle function unsupported datatype (8).
|
||||||
%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).
|
||||||
dpii_bit_u6:
|
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.
|
||||||
%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.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue