}
int opt;
- while ((opt = getopt(argc, argv, "VSm:f:b:o:p:l:qts:c:")) != -1)
+ while ((opt = getopt(argc, argv, "VSm:f:b:o:p:l:qv:ts:c:")) != -1)
{
switch (opt)
{
passes_commands.push_back("proc");
passes_commands.push_back("opt");
passes_commands.push_back("memory");
+ passes_commands.push_back("opt");
passes_commands.push_back("techmap");
passes_commands.push_back("opt");
break;
case 'q':
log_errfile = stderr;
break;
+ case 'v':
+ log_errfile = stderr;
+ log_verbose_level = atoi(optarg);
+ break;
case 't':
log_time = true;
break;
break;
default:
fprintf(stderr, "\n");
- fprintf(stderr, "Usage: %s [-V] [-S] [-q] [-t] [-l logfile] [-o <outfile>] [-f <frontend>] [{-s|-c} <scriptfile>]\n", argv[0]);
- fprintf(stderr, " %*s[-p <pass> [-p ..]] [-b <backend>] [-m <module_file>] [<infile> [..]]\n", int(strlen(argv[0])+1), "");
+ fprintf(stderr, "Usage: %s [-V] [-S] [-q] [-v <level>[-t] [-l <logfile>] [-o <outfile>] [-f <frontend>]\n", argv[0]);
+ fprintf(stderr, " %*s[{-s|-c} <scriptfile>] [-p <pass> [-p ..]] [-b <backend>] [-m <module_file>] [<infile> [..]]\n", int(strlen(argv[0])+1), "");
fprintf(stderr, "\n");
fprintf(stderr, " -q\n");
fprintf(stderr, " quiet operation. only write error messages to console\n");
fprintf(stderr, "\n");
+ fprintf(stderr, " -v <level>\n");
+ fprintf(stderr, " print log headers up to level <level> to the console. (implies -q)\n");
+ fprintf(stderr, "\n");
fprintf(stderr, " -t\n");
fprintf(stderr, " annotate all log messages with a time stamp\n");
fprintf(stderr, "\n");
fprintf(stderr, "transformation of the input to a gate-level netlist. This can be helpful when\n");
fprintf(stderr, "e.g. using yosys as a pre-processor for a tool that can't understand full verilog.\n");
fprintf(stderr, "\n");
- fprintf(stderr, " -b 'verilog -noattr' -p hierarchy -p proc -p opt -p memory -p techmap -p opt\n");
+ fprintf(stderr, " -b 'verilog -noattr' -p hierarchy -p proc -p opt -p memory -p opt -p techmap -p opt\n");
fprintf(stderr, "\n");
fprintf(stderr, "For more complex synthesis jobs it is recommended to use the read_* and write_*\n");
fprintf(stderr, "commands in a script file instead of specifying input and output files on the\n");
fprintf(stderr, "command line.\n");
fprintf(stderr, "\n");
- fprintf(stderr, "When no commands, script files and input files are specified on the command\n");
+ fprintf(stderr, "When no commands, script files or input files are specified on the command\n");
fprintf(stderr, "line, yosys automatically enters the interactive command mode. Use the 'help'\n");
fprintf(stderr, "command to get information on the individual commands.\n");
fprintf(stderr, "\n");
FILE *log_errfile = NULL;
bool log_time = false;
bool log_cmd_error_throw = false;
+int log_verbose_level;
std::vector<int> header_count;
std::list<std::string> string_buf;
log(" ");
logv(format, ap);
log_flush();
+
+ if (int(header_count.size()) <= log_verbose_level && log_errfile != NULL) {
+ for (int c : header_count)
+ fprintf(log_errfile, "%d.", c);
+ fprintf(log_errfile, " ");
+ vfprintf(log_errfile, format, ap);
+ fflush(log_errfile);
+ }
}
void logv_error(const char *format, va_list ap)