Fix conversion of integers in $display %e (#4528).

This commit is contained in:
Wilson Snyder 2023-10-01 13:00:16 -04:00
parent 33787c6add
commit 732d03f4e5
4 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,7 @@ Verilator 5.017 devel
* Add trace() API even when Verilated without --trace (#4462). [phelter]
* Add warning on interface instantiation without parens (#4094). [Gökçe Aydos]
* Fix constification of $realtobits, $bitstoreal (#4522). [Andrew Nolte]
* Fix conversion of integers in $display '%e' (#4528). [muzafferkal]
* Support randc (#4349).
* Support resizing function call inout arguments (#4467).

View File

@ -4893,6 +4893,7 @@ private:
}
break;
}
case 'e': // FALLTHRU
case 'f': // FALLTHRU
case 'g': {
if (argp) {

View File

@ -20,4 +20,6 @@
r8= 3 n1=1 n2=0.1
n1=1 n2=0.1 r8= 3
iconst=0.000000e+00 0.000000 0
*-* All Finished *-*

View File

@ -11,6 +11,7 @@ module t;
real n3; initial n3 = 1.2345e-15;
real n4; initial n4 = 2.579e+15;
reg [7:0] r8; initial r8 = 3;
integer iconst = 0;
initial begin
// Display formatting
@ -36,6 +37,8 @@ module t;
$display;
$display("r8=%d n1=%g n2=%g", r8, n1, n2);
$display("n1=%g n2=%g r8=%d", n1, n2, r8);
$display;
$display("iconst=%e %f %g", iconst, iconst, iconst);
$write("*-* All Finished *-*\n");
$finish;
end