diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 03ab99ef8..c51266700 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -2096,7 +2096,7 @@ private: if (m_vup->prelim()) { userIterateAndNext(nodep->searchp(), WidthVP(SELF,BOTH).p()); userIterateAndNext(nodep->outp(), WidthVP(SELF,BOTH).p()); - nodep->dtypeSetSigned32(); // Spec says integer return + nodep->dtypeChgWidthSigned(32,1,AstNumeric::SIGNED); // Spec says integer return } } virtual void visit(AstUCStmt* nodep) { diff --git a/test_regress/t/t_sys_plusargs.v b/test_regress/t/t_sys_plusargs.v index 8c280f951..f0956f3fb 100644 --- a/test_regress/t/t_sys_plusargs.v +++ b/test_regress/t/t_sys_plusargs.v @@ -22,13 +22,17 @@ module t; if ($value$plusargs("NOTTHERE%d", p_i)!==0) $stop; if (p_i !== 10) $stop; + p_i = 0; if ($value$plusargs("INT=%d", p_i)!==1) $stop; if (p_i !== 32'd1234) $stop; + p_i = 0; if ($value$plusargs("INT=%H", p_i)!==1) $stop; // tests uppercase % also if (p_i !== 32'h1234) $stop; - if ($value$plusargs("INT=%o", p_i)!==1) $stop; + p_i = 0; + // Check octal and WIDTH + if (!$value$plusargs("INT=%o", p_i)) $stop; if (p_i !== 32'o1234) $stop; p_str = "none";