From 0b07679ff21f2ef0418a4604d69df2579c4360f7 Mon Sep 17 00:00:00 2001 From: Kamil Rakoczy Date: Wed, 21 Sep 2022 11:54:23 +0200 Subject: [PATCH 1/2] v3errorEnd: look for instance only when warning is not ignored (#3632) This approach reduced total time of V3Undriven stage from 34,2s to 2,5s in design containing almost 400 000 unused variables. Signed-off-by: Kamil Rakoczy --- src/V3Ast.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/V3Ast.cpp b/src/V3Ast.cpp index 24c4d0e12..9b406f816 100644 --- a/src/V3Ast.cpp +++ b/src/V3Ast.cpp @@ -1212,7 +1212,11 @@ void AstNode::v3errorEnd(std::ostringstream& str) const { const_cast(this)->dump(nsstr); nsstr << endl; } - m_fileline->v3errorEnd(nsstr, instanceStr()); + // Don't look for instance name when warning is disabled. + // In case of large number of warnings, this can + // take significant amount of time + m_fileline->v3errorEnd(nsstr, + m_fileline->warnIsOff(V3Error::errorCode()) ? "" : instanceStr()); } } From 0a8cfb8d2c52d8b5faf51870fb89dc749347272f Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Wed, 21 Sep 2022 11:35:03 +0100 Subject: [PATCH 2/2] Put dump file in TEST_OBJ_DIR --- test_regress/t/t_trace_open_wrong_order.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_regress/t/t_trace_open_wrong_order.cpp b/test_regress/t/t_trace_open_wrong_order.cpp index 4faa6dd5b..56dae22c3 100644 --- a/test_regress/t/t_trace_open_wrong_order.cpp +++ b/test_regress/t/t_trace_open_wrong_order.cpp @@ -17,7 +17,7 @@ int main(int argc, char** argv) { VerilatedVcdC tfp; Vt_trace_open_wrong_order dut; ctx.traceEverOn(true); - tfp.open("dump.vcd"); // Error! shall put to the next line! + tfp.open(VL_STRINGIFY(TEST_OBJ_DIR) "/dump.vcd"); // Error! shall put to the next line! dut.trace(&tfp, 99); // Error! tfp.dump(0); tfp.close();