mirror of
https://github.com/verilator/verilator.git
synced 2026-10-02 16:13:34 +02:00
Fix CVTREAL not being able to be disabled in e.g. primitive terminals.
This commit is contained in:
+5
-5
@@ -7675,11 +7675,11 @@ class WidthVisitor final : public VNVisitor {
|
||||
// SIGNED/DOUBLE METHODS
|
||||
|
||||
AstNodeExpr* checkCvtUS(AstNodeExpr* nodep) {
|
||||
if (nodep && nodep->isDouble()) {
|
||||
nodep->v3error("Expected integral (non-" << nodep->dtypep()->prettyDTypeNameQ()
|
||||
<< ") input to "
|
||||
<< nodep->backp()->prettyTypeName());
|
||||
nodep = spliceCvtS(nodep, true, 32);
|
||||
if (nodep && nodep->dtypep()->skipRefp()->isDouble()) {
|
||||
nodep->v3warn(REALCVT,
|
||||
"Implicit conversion of real to integer; expected integral input to "
|
||||
<< nodep->backp()->prettyTypeName());
|
||||
nodep = spliceCvtS(nodep, false, 32);
|
||||
}
|
||||
return nodep;
|
||||
}
|
||||
|
||||
@@ -15,11 +15,8 @@
|
||||
: ... note: In instance 't'
|
||||
46 | d_real[0] = 1'b1;
|
||||
| ^
|
||||
%Error: t/t_var_types_bad.v:46:7: Expected integral (non-'real') input to SEL
|
||||
: ... note: In instance 't'
|
||||
46 | d_real[0] = 1'b1;
|
||||
| ^~~~~~
|
||||
%Warning-REALCVT: t/t_var_types_bad.v:46:7: Implicit conversion of real to integer
|
||||
%Warning-REALCVT: t/t_var_types_bad.v:46:7: Implicit conversion of real to integer; expected integral input to SEL
|
||||
: ... note: In instance 't'
|
||||
46 | d_real[0] = 1'b1;
|
||||
| ^~~~~~
|
||||
... For warning description see https://verilator.org/warn/REALCVT?v=latest
|
||||
@@ -28,11 +25,8 @@
|
||||
: ... note: In instance 't'
|
||||
47 | d_realtime[0] = 1'b1;
|
||||
| ^
|
||||
%Error: t/t_var_types_bad.v:47:7: Expected integral (non-'real') input to SEL
|
||||
: ... note: In instance 't'
|
||||
47 | d_realtime[0] = 1'b1;
|
||||
| ^~~~~~~~~~
|
||||
%Warning-REALCVT: t/t_var_types_bad.v:47:7: Implicit conversion of real to integer
|
||||
%Warning-REALCVT: t/t_var_types_bad.v:47:7: Implicit conversion of real to integer; expected integral input to SEL
|
||||
: ... note: In instance 't'
|
||||
47 | d_realtime[0] = 1'b1;
|
||||
| ^~~~~~~~~~
|
||||
%Error: Exiting due to
|
||||
|
||||
Reference in New Issue
Block a user