@@ -89,6 +89,7 @@ struct SimShared
89
89
std::vector<std::unique_ptr<OutputWriter>> outputfiles;
90
90
std::vector<std::pair<int ,std::map<int ,Const>>> output_data;
91
91
bool ignore_x = false ;
92
+ bool date = false ;
92
93
};
93
94
94
95
void zinit (State &v)
@@ -1333,12 +1334,14 @@ struct VCDWriter : public OutputWriter
1333
1334
void write (std::map<int , bool > &use_signal) override
1334
1335
{
1335
1336
if (!vcdfile.is_open ()) return ;
1336
- vcdfile << stringf (" $version %s $end\n " , yosys_version_str);
1337
+ vcdfile << stringf (" $version %s $end\n " , worker-> date ? yosys_version_str : " Yosys " );
1337
1338
1338
- std::time_t t = std::time (nullptr );
1339
- char mbstr[255 ];
1340
- if (std::strftime (mbstr, sizeof (mbstr), " %c" , std::localtime (&t))) {
1341
- vcdfile << stringf (" $date " ) << mbstr << stringf (" $end\n " );
1339
+ if (worker->date ) {
1340
+ std::time_t t = std::time (nullptr );
1341
+ char mbstr[255 ];
1342
+ if (std::strftime (mbstr, sizeof (mbstr), " %c" , std::localtime (&t))) {
1343
+ vcdfile << stringf (" $date " ) << mbstr << stringf (" $end\n " );
1344
+ }
1342
1345
}
1343
1346
1344
1347
if (!worker->timescale .empty ())
@@ -1391,8 +1394,11 @@ struct FSTWriter : public OutputWriter
1391
1394
{
1392
1395
if (!fstfile) return ;
1393
1396
std::time_t t = std::time (nullptr );
1394
- fstWriterSetDate (fstfile, asctime (std::localtime (&t)));
1395
- fstWriterSetVersion (fstfile, yosys_version_str);
1397
+ fstWriterSetVersion (fstfile, worker->date ? yosys_version_str : " Yosys" );
1398
+ if (worker->date )
1399
+ fstWriterSetDate (fstfile, asctime (std::localtime (&t)));
1400
+ else
1401
+ fstWriterSetDate (fstfile, " " );
1396
1402
if (!worker->timescale .empty ())
1397
1403
fstWriterSetTimescaleFromString (fstfile, worker->timescale .c_str ());
1398
1404
@@ -1563,6 +1569,9 @@ struct SimPass : public Pass {
1563
1569
log (" -x\n " );
1564
1570
log (" ignore constant x outputs in simulation file.\n " );
1565
1571
log (" \n " );
1572
+ log (" -date\n " );
1573
+ log (" include date and full version info in output.\n " );
1574
+ log (" \n " );
1566
1575
log (" -clock <portname>\n " );
1567
1576
log (" name of top-level clock input\n " );
1568
1577
log (" \n " );
@@ -1759,6 +1768,10 @@ struct SimPass : public Pass {
1759
1768
worker.ignore_x = true ;
1760
1769
continue ;
1761
1770
}
1771
+ if (args[argidx] == " -date" ) {
1772
+ worker.date = true ;
1773
+ continue ;
1774
+ }
1762
1775
break ;
1763
1776
}
1764
1777
extra_args (args, argidx, design);
0 commit comments