From 38ad328956289f0c3b901801dacee6bcc868dca8 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 22 Mar 2024 19:35:42 -0400 Subject: [PATCH] Remove duplicate stop ignored messages --- include/verilated.cpp | 9 ++++++--- test_regress/t/t_runflag_errorlimit_bad.out | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/verilated.cpp b/include/verilated.cpp index 2f9d75a49..65c1af303 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -169,9 +169,12 @@ void vl_stop_maybe(const char* filename, int linenum, const char* hier, bool may Verilated::threadContextp()->errorCountInc(); if (maybe && Verilated::threadContextp()->errorCount() < Verilated::threadContextp()->errorLimit()) { - VL_PRINTF( // Not VL_PRINTF_MT, already on main thread - "-Info: %s:%d: %s\n", filename, linenum, - "Verilog $stop, ignored due to +verilator+error+limit"); + // Do just once when cross error limit + if (Verilated::threadContextp()->errorCount() == 1) { + VL_PRINTF( // Not VL_PRINTF_MT, already on main thread + "-Info: %s:%d: %s\n", filename, linenum, + "Verilog $stop, ignored due to +verilator+error+limit"); + } } else { vl_stop(filename, linenum, hier); } diff --git a/test_regress/t/t_runflag_errorlimit_bad.out b/test_regress/t/t_runflag_errorlimit_bad.out index 7cf555ee9..65980a8b2 100644 --- a/test_regress/t/t_runflag_errorlimit_bad.out +++ b/test_regress/t/t_runflag_errorlimit_bad.out @@ -1,7 +1,6 @@ [0] %Error: t_runflag_errorlimit_bad.v:9: Assertion failed in top.t: One -Info: t/t_runflag_errorlimit_bad.v:9: Verilog $stop, ignored due to +verilator+error+limit [0] %Error: t_runflag_errorlimit_bad.v:10: Assertion failed in top.t: Two --Info: t/t_runflag_errorlimit_bad.v:10: Verilog $stop, ignored due to +verilator+error+limit [0] %Error: t_runflag_errorlimit_bad.v:11: Assertion failed in top.t: Three %Error: t/t_runflag_errorlimit_bad.v:11: Verilog $stop Aborting...