Fix $display with uppercase %M.

This commit is contained in:
Wilson Snyder 2009-09-11 19:25:42 -04:00
parent b19dd49fc9
commit 0b24e62d43
5 changed files with 11 additions and 6 deletions

View File

@ -7,7 +7,9 @@ indicates the contributor was also the author of the fix; Thanks!
*** Improved warning when "do" used as identifier.
**** Fix tracing escaped dotted identifiers.
**** Fix tracing escaped dotted identifiers, bug107.
**** Fix $display with uppercase %M.
* Verilator 3.713 2009/08/04

View File

@ -65,7 +65,9 @@ private:
AstNode* timesp = nodep->exprsp(); if (timesp) timesp->unlinkFrBack();
timesp = timesp->addNext(new AstTime(nodep->fileline()));
nodep->exprsp(timesp);
if (!nodep->scopeNamep() && nodep->name().find("%m") != string::npos) {
if (!nodep->scopeNamep()
&& (nodep->name().find("%m") != string::npos
|| nodep->name().find("%M") != string::npos)) {
nodep->scopeNamep(new AstScopeName(nodep->fileline()));
}
}

View File

@ -361,7 +361,7 @@ private:
inPct = true;
} else if (inPct) {
inPct = false;
switch (ch) {
switch (tolower(ch)) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
inPct = true;
@ -441,7 +441,8 @@ private:
nodep->v3error(nodep->verilogKwd()+" only allowed under a assertion.");
}
if (nodep->displayType().needScopeTracking()
|| nodep->name().find("%m") != string::npos) {
|| nodep->name().find("%m") != string::npos
|| nodep->name().find("%M") != string::npos) {
nodep->scopeNamep(new AstScopeName(nodep->fileline()));
}
}

View File

@ -179,7 +179,7 @@ private:
if (!inPct && ch=='%') {
inPct = true;
} else if (inPct && isdigit(ch)) {
} else if (inPct) {
} else if (tolower(inPct)) {
inPct = false;
switch (tolower(ch)) {
case '%': break; // %% - just output a %

View File

@ -52,7 +52,7 @@ module sub;
begin
$write("[%0t] In %m\n", $time);
begin : subblock
$write("[%0t] In %m\n", $time);
$write("[%0t] In %M\n", $time); // Uppercase %M test
end
end
endtask