Remove $date from .vcd files (#3779)

This commit is contained in:
Larry Doolittle 2022-11-27 17:24:22 -08:00 committed by GitHub
parent f4be3d5d2b
commit 6349e76abd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 18 deletions

View File

@ -29,7 +29,6 @@
#include <algorithm> #include <algorithm>
#include <cerrno> #include <cerrno>
#include <ctime>
#include <fcntl.h> #include <fcntl.h>
#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
@ -362,17 +361,13 @@ void VerilatedVcd::printIndent(int level_change) {
void VerilatedVcd::dumpHeader() { void VerilatedVcd::dumpHeader() {
printStr("$version Generated by VerilatedVcd $end\n"); printStr("$version Generated by VerilatedVcd $end\n");
printStr("$date ");
{ // Verilator used to put in a $date here. Although $date is shown in
const time_t tick = time(nullptr); // IEEE examples, and it is common in VCD writers, VCD readers don't
tm ticktm; // seem to care about it. Thus, we omit the $date so artifacts are
VL_LOCALTIME_R(&tick, &ticktm); // more likely to be reproducible. If use cases show up that require
constexpr size_t LEN_BUF = 50; // the $date command to be present, it could be re-added with support
char buf[LEN_BUF]; // for the SOURCE_DATE_EPOCH hook.
std::strftime(buf, LEN_BUF, "%c", &ticktm);
printStr(buf);
}
printStr(" $end\n");
printStr("$timescale "); printStr("$timescale ");
printStr(timeResStr().c_str()); // lintok-begin-on-ref printStr(timeResStr().c_str()); // lintok-begin-on-ref

View File

@ -502,12 +502,6 @@ using ssize_t = uint32_t; ///< signed size_t; returned from read()
# define VL_STRCASECMP strcasecmp # define VL_STRCASECMP strcasecmp
#endif #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 // Macros controlling target specific optimizations