From efbcb094ca6fd066fdc0d0008b434ef33f0c9e45 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 4 Oct 2020 07:47:25 -0400 Subject: [PATCH] Fix flushCall for backward compatibility (#2580). --- Changes | 2 ++ include/verilated.h | 1 + test_regress/t/t_scope_map.cpp | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/Changes b/Changes index e4ec72663..27898f4ab 100644 --- a/Changes +++ b/Changes @@ -17,6 +17,8 @@ The contributors that suggested a given feature are shown in []. Thanks! **** Fix class wide member display (#2567). [Nandu Raj P] +**** Fix flushCall for backward compatibility (#2580). [chenguokai] + * Verilator 4.100 2020-09-07 diff --git a/include/verilated.h b/include/verilated.h index 4f25248bd..9d339d8db 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -499,6 +499,7 @@ public: static void addFlushCb(VoidPCb cb, void* datap) VL_MT_SAFE; static void removeFlushCb(VoidPCb cb, void* datap) VL_MT_SAFE; static void runFlushCallbacks() VL_MT_SAFE; + static void flushCall() VL_MT_SAFE { runFlushCallbacks(); } // Deprecated /// Callbacks to run prior to termination static void addExitCb(VoidPCb cb, void* datap) VL_MT_SAFE; static void removeExitCb(VoidPCb cb, void* datap) VL_MT_SAFE; diff --git a/test_regress/t/t_scope_map.cpp b/test_regress/t/t_scope_map.cpp index 90fd2c63f..39d28c3d0 100644 --- a/test_regress/t/t_scope_map.cpp +++ b/test_regress/t/t_scope_map.cpp @@ -115,6 +115,9 @@ int main(int argc, char** argv, char** env) { tfp->dump((unsigned int)(main_time)); ++main_time; + // Code coverage of historical flush function + Verilated::flushCall(); + for (VerilatedScopeNameMap::const_iterator it = scopeMapp->begin(); it != scopeMapp->end(); ++it) { VerilatedVarNameMap* varNameMap = it->second->varsp(); @@ -159,5 +162,6 @@ int main(int argc, char** argv, char** env) { tfp->close(); top->final(); VL_PRINTF("*-* All Finished *-*\n"); + return 0; }