36 log(
"Print the given string to the screen and/or the log file. This is useful for TCL\n");
37 log(
"scripts, because the TCL command \"puts\" only goes to stdout but not to\n");
41 log(
" Print the output to stdout too. This is useful when all Yosys is executed\n");
42 log(
" with a script and the -q (quiet operation) argument to notify the user.\n");
45 log(
" Print the output to stderr too.\n");
48 log(
" Don't use the internal log() command. Use either -stdout or -stderr,\n");
49 log(
" otherwise no output will be generated at all.\n");
52 log(
" do not append a newline\n");
58 bool to_stdout =
false;
59 bool to_stderr =
false;
64 for (argidx = 1; argidx < args.size(); argidx++)
66 if (args[argidx] ==
"-stdout") to_stdout =
true;
67 else if (args[argidx] ==
"-stderr") to_stderr =
true;
68 else if (args[argidx] ==
"-nolog") to_log =
false;
69 else if (args[argidx] ==
"-n") newline =
false;
72 for (; argidx < args.size(); argidx++)
73 text += args[argidx] +
' ';
74 if (!text.empty()) text.resize(text.size()-1);
76 if (to_stdout) fprintf(stdout, (newline ?
"%s\n" :
"%s"), text.c_str());
77 if (to_stderr) fprintf(stderr, (newline ?
"%s\n" :
"%s"), text.c_str());
78 if (to_log)
log ( (newline ?
"%s\n" :
"%s"), text.c_str());
virtual void execute(std::vector< std::string > args, RTLIL::Design *)
#define PRIVATE_NAMESPACE_BEGIN
#define PRIVATE_NAMESPACE_END
#define USING_YOSYS_NAMESPACE
void log(const char *format,...)