diff options
author | Miodrag Milanović <mmicko@gmail.com> | 2022-03-11 19:02:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-11 19:02:57 +0100 |
commit | cbece4af0caebc7f04382f61492e61c84b6acbfd (patch) | |
tree | 9de25b1d39b2e2bc0c54dde23db1b0a95ff9ad29 /passes | |
parent | 532343dcfa3af45c1f4fe6fbda483e9fdf822b33 (diff) | |
parent | 37de369ba78dd15e40b7fa11b13cea3d2c2ed8d0 (diff) | |
download | yosys-cbece4af0caebc7f04382f61492e61c84b6acbfd.tar.gz yosys-cbece4af0caebc7f04382f61492e61c84b6acbfd.tar.bz2 yosys-cbece4af0caebc7f04382f61492e61c84b6acbfd.zip |
Merge pull request #3229 from YosysHQ/micko/sim_date
Add date parameter to enable full date/time and version info
Diffstat (limited to 'passes')
-rw-r--r-- | passes/sat/sim.cc | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/passes/sat/sim.cc b/passes/sat/sim.cc index 9d32cc9b3..5b69dd3bf 100644 --- a/passes/sat/sim.cc +++ b/passes/sat/sim.cc @@ -90,6 +90,7 @@ struct SimShared std::vector<std::unique_ptr<OutputWriter>> outputfiles; std::vector<std::pair<int,std::map<int,Const>>> output_data; bool ignore_x = false; + bool date = false; }; void zinit(State &v) @@ -1337,12 +1338,14 @@ struct VCDWriter : public OutputWriter void write(std::map<int, bool> &use_signal) override { if (!vcdfile.is_open()) return; - vcdfile << stringf("$version %s $end\n", yosys_version_str); + vcdfile << stringf("$version %s $end\n", worker->date ? yosys_version_str : "Yosys"); - std::time_t t = std::time(nullptr); - char mbstr[255]; - if (std::strftime(mbstr, sizeof(mbstr), "%c", std::localtime(&t))) { - vcdfile << stringf("$date ") << mbstr << stringf(" $end\n"); + if (worker->date) { + std::time_t t = std::time(nullptr); + char mbstr[255]; + if (std::strftime(mbstr, sizeof(mbstr), "%c", std::localtime(&t))) { + vcdfile << stringf("$date ") << mbstr << stringf(" $end\n"); + } } if (!worker->timescale.empty()) @@ -1395,8 +1398,11 @@ struct FSTWriter : public OutputWriter { if (!fstfile) return; std::time_t t = std::time(nullptr); - fstWriterSetDate(fstfile, asctime(std::localtime(&t))); - fstWriterSetVersion(fstfile, yosys_version_str); + fstWriterSetVersion(fstfile, worker->date ? yosys_version_str : "Yosys"); + if (worker->date) + fstWriterSetDate(fstfile, asctime(std::localtime(&t))); + else + fstWriterSetDate(fstfile, ""); if (!worker->timescale.empty()) fstWriterSetTimescaleFromString(fstfile, worker->timescale.c_str()); @@ -1567,6 +1573,9 @@ struct SimPass : public Pass { log(" -x\n"); log(" ignore constant x outputs in simulation file.\n"); log("\n"); + log(" -date\n"); + log(" include date and full version info in output.\n"); + log("\n"); log(" -clock <portname>\n"); log(" name of top-level clock input\n"); log("\n"); @@ -1770,6 +1779,10 @@ struct SimPass : public Pass { worker.ignore_x = true; continue; } + if (args[argidx] == "-date") { + worker.date = true; + continue; + } break; } extra_args(args, argidx, design); |