From 6349e76abd9a73220fafd70e343d52a0a9408107 Mon Sep 17 00:00:00 2001 From: Larry Doolittle Date: Sun, 27 Nov 2022 17:24:22 -0800 Subject: [PATCH] Remove $date from .vcd files (#3779) --- include/verilated_vcd_c.cpp | 19 +++++++------------ include/verilatedos.h | 6 ------ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/include/verilated_vcd_c.cpp b/include/verilated_vcd_c.cpp index 69e7b0654..66ccea3ba 100644 --- a/include/verilated_vcd_c.cpp +++ b/include/verilated_vcd_c.cpp @@ -29,7 +29,6 @@ #include #include -#include #include #if defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) @@ -362,17 +361,13 @@ void VerilatedVcd::printIndent(int level_change) { void VerilatedVcd::dumpHeader() { printStr("$version Generated by VerilatedVcd $end\n"); - printStr("$date "); - { - const time_t tick = time(nullptr); - tm ticktm; - VL_LOCALTIME_R(&tick, &ticktm); - constexpr size_t LEN_BUF = 50; - char buf[LEN_BUF]; - std::strftime(buf, LEN_BUF, "%c", &ticktm); - printStr(buf); - } - printStr(" $end\n"); + + // Verilator used to put in a $date here. Although $date is shown in + // IEEE examples, and it is common in VCD writers, VCD readers don't + // seem to care about it. Thus, we omit the $date so artifacts are + // more likely to be reproducible. If use cases show up that require + // the $date command to be present, it could be re-added with support + // for the SOURCE_DATE_EPOCH hook. printStr("$timescale "); printStr(timeResStr().c_str()); // lintok-begin-on-ref diff --git a/include/verilatedos.h b/include/verilatedos.h index eff312137..5d6f220a5 100644 --- a/include/verilatedos.h +++ b/include/verilatedos.h @@ -502,12 +502,6 @@ using ssize_t = uint32_t; ///< signed size_t; returned from read() # define VL_STRCASECMP strcasecmp #endif -#if defined(__MINGW32__) || defined(_MSC_VER) -# define VL_LOCALTIME_R(timep, tmp) localtime_s((tmp), (timep)) -#else -# define VL_LOCALTIME_R(timep, tmp) localtime_r((timep), (tmp)) -#endif - //========================================================================= // Macros controlling target specific optimizations