mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Fix display with no % printing assoc array (#4376).
This commit is contained in:
parent
4636a7f14b
commit
cad2780219
1
Changes
1
Changes
@ -23,6 +23,7 @@ Verilator 5.019 devel
|
||||
* Remove deprecated options (#4663). [Geza Lore]
|
||||
* Optimize timing-delayed queue (#4584). [qrqiuren]
|
||||
* Fix VPI TOP level variable iteration (#3919) (#4618). [Marlon James]
|
||||
* Fix display with no % printing assoc array (#4376). [Alex Solomatnikov]
|
||||
* Fix scheduling of external force signals (#4577) (#4668). [Geza Lore]
|
||||
* Fix a memory leak in V3Fork (#4628). [Krzysztof Boroński]
|
||||
* Fix linking parameterized hierarchical blocks and recursive hierarchical blocks (#4654). [Anthony Donlon]
|
||||
|
@ -4843,6 +4843,21 @@ private:
|
||||
} else if (inPct) {
|
||||
inPct = false;
|
||||
bool added = false;
|
||||
const AstNodeDType* const dtypep = argp ? argp->dtypep()->skipRefp() : nullptr;
|
||||
const AstBasicDType* const basicp = dtypep ? dtypep->basicp() : nullptr;
|
||||
if (ch == '?') { // Unspecified by user, guess
|
||||
if (argp && argp->isDouble()) {
|
||||
ch = 'g';
|
||||
} else if (argp && argp->isString()) {
|
||||
ch = '@';
|
||||
} else if (nodep->missingArgChar() == 'd' && argp->isSigned()) {
|
||||
ch = '~';
|
||||
} else if (basicp) {
|
||||
ch = nodep->missingArgChar();
|
||||
} else {
|
||||
ch = 'p';
|
||||
}
|
||||
}
|
||||
switch (std::tolower(ch)) {
|
||||
case '%': break; // %% - just output a %
|
||||
case 'm': break; // %m - auto insert "name"
|
||||
@ -4871,8 +4886,6 @@ private:
|
||||
break;
|
||||
}
|
||||
case 'p': { // Pattern
|
||||
const AstNodeDType* const dtypep = argp ? argp->dtypep()->skipRefp() : nullptr;
|
||||
const AstBasicDType* const basicp = dtypep ? dtypep->basicp() : nullptr;
|
||||
if (basicp && basicp->isString()) {
|
||||
added = true;
|
||||
newFormat += "\"%@\"";
|
||||
@ -4944,19 +4957,6 @@ private:
|
||||
}
|
||||
break;
|
||||
}
|
||||
case '?': { // Unspecified by user, guess
|
||||
if (argp && argp->isDouble()) {
|
||||
ch = 'g';
|
||||
} else if (argp && argp->isString()) {
|
||||
ch = '@';
|
||||
} else if (nodep->missingArgChar() == 'd' && argp->isSigned()) {
|
||||
ch = '~';
|
||||
} else {
|
||||
ch = nodep->missingArgChar();
|
||||
}
|
||||
if (argp) argp = VN_AS(argp->nextp(), NodeExpr);
|
||||
break;
|
||||
}
|
||||
default: { // Most operators, just move to next argument
|
||||
if (argp) argp = VN_AS(argp->nextp(), NodeExpr);
|
||||
break;
|
||||
|
@ -61,6 +61,7 @@ b: 000001100 000001100
|
||||
4294967294
|
||||
2863311530
|
||||
2863311530
|
||||
assoc_c='{}
|
||||
[0] hello, from a very long string. Percent %s are literally substituted in.
|
||||
hello, from a concatenated string.
|
||||
hello, from a concatenated format string [0].
|
||||
|
@ -19,6 +19,8 @@ module t;
|
||||
string svs = "sv-str";
|
||||
reg [31:0] regstr = "meep";
|
||||
|
||||
reg [5:0] assoc_c[int];
|
||||
|
||||
sub sub ();
|
||||
sub2 sub2 ();
|
||||
sub3 sub3 ();
|
||||
@ -156,6 +158,7 @@ module t;
|
||||
$display($unsigned(-2)); // 4294967294
|
||||
$display("%d", 32'haaaaaaaa); // 2863311530
|
||||
$display(32'haaaaaaaa); // 2863311530
|
||||
$display("assoc_c=", assoc_c); // Default to %p
|
||||
|
||||
$display("[%0t] %s%s%s", $time,
|
||||
"hel", "lo, fr", "om a very long string. Percent %s are literally substituted in.");
|
||||
|
Loading…
Reference in New Issue
Block a user