diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index e92aee501..f42e159d9 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -3570,10 +3570,11 @@ public: addNOp1p(exprsp); addNOp2p(NULL); } - AstSFormatF(FileLine* fl, NoFormat, AstNode* exprsp, char missingArgChar = 'd') + AstSFormatF(FileLine* fl, NoFormat, AstNode* exprsp, char missingArgChar = 'd', + bool hidden = true) : ASTGEN_SUPER(fl) , m_text("") - , m_hidden(true) + , m_hidden(hidden) , m_hasFormat(false) , m_missingArgChar(missingArgChar) { dtypeSetString(); diff --git a/src/verilog.y b/src/verilog.y index 5f840c407..a3d819f44 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -3642,7 +3642,7 @@ system_f_call_or_t: // IEEE: part of system_tf_call (can be task or func) | yD_RIGHT '(' exprOrDataType ',' expr ')' { $$ = new AstAttrOf($1,AstAttrType::DIM_RIGHT,$3,$5); } | yD_RTOI '(' expr ')' { $$ = new AstRToIS($1,$3); } | yD_SAMPLED '(' expr ')' { $$ = new AstSampled($1, $3); } - | yD_SFORMATF '(' str commaEListE ')' { $$ = new AstSFormatF($1,*$3,false,$4); } + | yD_SFORMATF '(' exprDispList ')' { $$ = new AstSFormatF($1, AstSFormatF::NoFormat(), $3, 'd', false); } | yD_SHORTREALTOBITS '(' expr ')' { $$ = new AstRealToBits($1,$3); UNSUPREAL($1); } | yD_SIGNED '(' expr ')' { $$ = new AstSigned($1,$3); } | yD_SIN '(' expr ')' { $$ = new AstSinD($1,$3); } @@ -4313,11 +4313,6 @@ exprDispList: // exprList for within $display { $$ = $1; $1->addNext(new AstConst($2, AstConst::VerilogStringLiteral(), " ")); } ; -commaEListE: - /* empty */ { $$ = NULL; } - | ',' exprList { $$ = $2; } - ; - vrdList: idClassSel { $$ = $1; } | vrdList ',' idClassSel { $$ = $1;$1->addNext($3); } diff --git a/test_regress/t/t_sys_sformat.v b/test_regress/t/t_sys_sformat.v index 96bf9f389..d4da7ac54 100644 --- a/test_regress/t/t_sys_sformat.v +++ b/test_regress/t/t_sys_sformat.v @@ -62,11 +62,11 @@ module t; if (str2 !== "lib=t") $stop; str3 = $sformatf("u=%u", {"a","b","c","d"}); // Value selected so is printable -`ifdef TEST_VERBOSE $display("chku %s %s",str3,str3); `endif +`ifdef TEST_VERBOSE $display("chku %s", str3); `endif if (str3 !== "u=dcba") $stop; str3 = $sformatf("v=%v", {"a","b","c","d"}); // Value selected so is printable -`ifdef TEST_VERBOSE $display("chkv %s %s",str3,str3); `endif +`ifdef TEST_VERBOSE $display("chkv %s", str3); `endif $sformat(ochar,"%s","c"); if (ochar != "c") $stop;