@@ -77,6 +77,7 @@ struct OutputWriter
77
77
struct SimShared
78
78
{
79
79
bool debug = false ;
80
+ bool verbose = true ;
80
81
bool hide_internal = true ;
81
82
bool writeback = false ;
82
83
bool zinit = false ;
@@ -181,7 +182,7 @@ struct SimInstance
181
182
if ((shared->fst ) && !(shared->hide_internal && wire->name [0 ] == ' $' )) {
182
183
fstHandle id = shared->fst ->getHandle (scope + " ." + RTLIL::unescape_id (wire->name ));
183
184
if (id==0 && wire->name .isPublic ())
184
- log_warning (" Unable to found wire %s in input file.\n " , (scope + " ." + RTLIL::unescape_id (wire->name )).c_str ());
185
+ log_warning (" Unable to find wire %s in input file.\n " , (scope + " ." + RTLIL::unescape_id (wire->name )).c_str ());
185
186
fst_handles[wire] = id;
186
187
}
187
188
@@ -764,7 +765,7 @@ struct SimInstance
764
765
IdString name = qsig.as_wire ()->name ;
765
766
fstHandle id = shared->fst ->getHandle (scope + " ." + RTLIL::unescape_id (name));
766
767
if (id==0 && name.isPublic ())
767
- log_warning (" Unable to found wire %s in input file.\n " , (scope + " ." + RTLIL::unescape_id (name)).c_str ());
768
+ log_warning (" Unable to find wire %s in input file.\n " , (scope + " ." + RTLIL::unescape_id (name)).c_str ());
768
769
if (id!=0 ) {
769
770
Const fst_val = Const::from_string (shared->fst ->valueOf (id));
770
771
set_state (qsig, fst_val);
@@ -919,7 +920,7 @@ struct SimWorker : SimShared
919
920
920
921
if (debug)
921
922
log (" \n ===== 0 =====\n " );
922
- else
923
+ else if (verbose)
923
924
log (" Simulating cycle 0.\n " );
924
925
925
926
set_inports (reset, State::S1);
@@ -936,7 +937,7 @@ struct SimWorker : SimShared
936
937
{
937
938
if (debug)
938
939
log (" \n ===== %d =====\n " , 10 *cycle + 5 );
939
- else
940
+ else if (verbose)
940
941
log (" Simulating cycle %d.\n " , (cycle*2 )+1 );
941
942
set_inports (clock, State::S0);
942
943
set_inports (clockn, State::S1);
@@ -946,7 +947,7 @@ struct SimWorker : SimShared
946
947
947
948
if (debug)
948
949
log (" \n ===== %d =====\n " , 10 *cycle + 10 );
949
- else
950
+ else if (verbose)
950
951
log (" Simulating cycle %d.\n " , (cycle*2 )+2 );
951
952
952
953
set_inports (clock, State::S1);
@@ -1063,7 +1064,8 @@ struct SimWorker : SimShared
1063
1064
1064
1065
try {
1065
1066
fst->reconstructAllAtTimes (fst_clock, startCount, stopCount, [&](uint64_t time) {
1066
- log (" Co-simulating %s %d [%lu%s].\n " , (all_samples ? " sample" : " cycle" ), cycle, (unsigned long )time, fst->getTimescaleString ());
1067
+ if (verbose)
1068
+ log (" Co-simulating %s %d [%lu%s].\n " , (all_samples ? " sample" : " cycle" ), cycle, (unsigned long )time, fst->getTimescaleString ());
1067
1069
bool did_something = false ;
1068
1070
for (auto &item : inputs) {
1069
1071
std::string v = fst->valueOf (item.second );
@@ -1172,7 +1174,8 @@ struct SimWorker : SimShared
1172
1174
state = 3 ;
1173
1175
break ;
1174
1176
default :
1175
- log (" Simulating cycle %d.\n " , cycle);
1177
+ if (verbose)
1178
+ log (" Simulating cycle %d.\n " , cycle);
1176
1179
top->setState (inputs, line);
1177
1180
if (cycle) {
1178
1181
set_inports (clock, State::S1);
@@ -1253,7 +1256,8 @@ struct SimWorker : SimShared
1253
1256
curr_cycle = -1 ; // force detect change
1254
1257
1255
1258
if (curr_cycle != prev_cycle) {
1256
- log (" Simulating cycle %d.\n " , cycle);
1259
+ if (verbose)
1260
+ log (" Simulating cycle %d.\n " , cycle);
1257
1261
set_inports (clock, State::S1);
1258
1262
set_inports (clockn, State::S0);
1259
1263
update ();
@@ -1623,6 +1627,9 @@ struct SimPass : public Pass {
1623
1627
log (" -sim-gate\n " );
1624
1628
log (" co-simulation, x in FST can match any value in simulation\n " );
1625
1629
log (" \n " );
1630
+ log (" -q\n " );
1631
+ log (" disable per-cycle/sample log message\n " );
1632
+ log (" \n " );
1626
1633
log (" -d\n " );
1627
1634
log (" enable debug output\n " );
1628
1635
log (" \n " );
@@ -1695,6 +1702,10 @@ struct SimPass : public Pass {
1695
1702
worker.hide_internal = false ;
1696
1703
continue ;
1697
1704
}
1705
+ if (args[argidx] == " -q" ) {
1706
+ worker.verbose = false ;
1707
+ continue ;
1708
+ }
1698
1709
if (args[argidx] == " -d" ) {
1699
1710
worker.debug = true ;
1700
1711
continue ;
0 commit comments