forked from github/verilator
Report REALCVT on $display format mistakes.
This commit is contained in:
parent
bd5d4c61c6
commit
926209706f
@ -2843,10 +2843,17 @@ private:
|
||||
case 'm': break; // %m - auto insert "name"
|
||||
case 'l': break; // %m - auto insert "library"
|
||||
case 'd': { // Convert decimal to either 'd' or '#'
|
||||
if (argp && argp->isSigned()) { // Convert it
|
||||
if (argp) {
|
||||
AstNode* nextp = argp->nextp();
|
||||
if (argp->isDouble()) {
|
||||
spliceCvtS(argp, true, 64);
|
||||
ch = '~';
|
||||
}
|
||||
if (argp) argp = argp->nextp();
|
||||
else if (argp->isSigned()) { // Convert it
|
||||
ch = '~';
|
||||
}
|
||||
argp = nextp;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'p': { // Pattern
|
||||
@ -2895,6 +2902,17 @@ private:
|
||||
if (argp) argp = argp->nextp();
|
||||
break;
|
||||
}
|
||||
case 'f': // FALLTHRU
|
||||
case 'g': {
|
||||
if (argp) {
|
||||
AstNode* nextp = argp->nextp();
|
||||
if (!argp->isDouble()) {
|
||||
iterateCheckReal(nodep, "Display argument", argp, BOTH);
|
||||
}
|
||||
argp = nextp;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case '?': { // Unspecified by user, guess
|
||||
if (argp && argp->isDouble()) {
|
||||
ch = 'g';
|
||||
|
@ -171,7 +171,9 @@ multiline", $time);
|
||||
$write("'%-8s'\n", "beep");
|
||||
|
||||
// $itord conversion bug, note a %d instead of proper float
|
||||
// verilator lint_off REALCVT
|
||||
$display("log10(2) = %d", $log10(100));
|
||||
// verilator lint_on REALCVT
|
||||
|
||||
$write("*-* All Finished *-*\n");
|
||||
$finish;
|
||||
|
Loading…
Reference in New Issue
Block a user