From: Clifford Wolf Date: Thu, 28 Feb 2013 12:13:56 +0000 (+0100) Subject: Added help for command line options X-Git-Tag: yosys-0.2.0~777 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ac41b2bb1d41328eb91c2622d8f70cb43a60f0f;p=yosys.git Added help for command line options --- diff --git a/Makefile b/Makefile index 18daca64c..7be911fb7 100644 --- a/Makefile +++ b/Makefile @@ -52,10 +52,6 @@ test: yosys cd tests/hana && bash run-test.sh cd tests/asicworld && bash run-test.sh -help: - @find -name '*.cc' | xargs egrep -h '(Pass|Frontend|Backend)\(".*"\)' | \ - sed 's,.*: ,,; s, .*,,;' | sort | tr '\n' '\t' | expand -t25 | fmt - install: yosys install yosys /usr/local/bin/yosys diff --git a/kernel/driver.cc b/kernel/driver.cc index bfbf21050..105e4647d 100644 --- a/kernel/driver.cc +++ b/kernel/driver.cc @@ -171,7 +171,16 @@ static void shell(RTLIL::Design *design) } struct ShellPass : public Pass { - ShellPass() : Pass("shell") { } + ShellPass() : Pass("shell", "enter interactive command mode") { } + virtual void help() { + log("\n"); + log(" shell\n"); + log("\n"); + log("This command enters the interactive command mode. This can be useful\n"); + log("in a script to interrupt the script at a certain point and allow for\n"); + log("interactive inspection or manual synthesis of the design at this point.\n"); + log("\n"); + } virtual void execute(std::vector, RTLIL::Design *design) { shell(design); } @@ -227,7 +236,42 @@ int main(int argc, char **argv) scriptfile = optarg; break; default: - fprintf(stderr, "Usage: %s [-q] [-t] [-l logfile] [-o ] [-f ] [-s ] [-p [-p ..]] [-b ] [ [..]]\n", argv[0]); + fprintf(stderr, "\n"); + fprintf(stderr, "Usage: %s [-q] [-t] [-l logfile] [-o ] [-f ] [-s ]\n", argv[0]); + fprintf(stderr, " %*s[-p [-p ..]] [-b ] [ [..]]\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, " -t\n"); + fprintf(stderr, " annotate all log messages with a time stamp\n"); + fprintf(stderr, "\n"); + fprintf(stderr, " -l logfile\n"); + fprintf(stderr, " write log messages to the specified file\n"); + fprintf(stderr, "\n"); + fprintf(stderr, " -o outfile\n"); + fprintf(stderr, " write the design to the specified file on exit\n"); + fprintf(stderr, "\n"); + fprintf(stderr, " -b backend\n"); + fprintf(stderr, " use this backend for the output file specified on the command line\n"); + fprintf(stderr, "\n"); + fprintf(stderr, " -f backend\n"); + fprintf(stderr, " use the specified front for the input files on the command line\n"); + fprintf(stderr, "\n"); + fprintf(stderr, " -s scriptfile\n"); + fprintf(stderr, " execute the commands in the script file\n"); + fprintf(stderr, "\n"); + fprintf(stderr, " -p command\n"); + fprintf(stderr, " execute the commands\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, "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"); exit(1); } } @@ -235,6 +279,28 @@ int main(int argc, char **argv) if (log_errfile == NULL) log_files.push_back(stderr); + log("\n"); + log(" /-----------------------------------------------------------------------------\\\n"); + log(" | |\n"); + log(" | yosys -- Yosys Open SYnthesis Suite |\n"); + log(" | |\n"); + log(" | Copyright (C) 2012 Clifford Wolf |\n"); + log(" | |\n"); + log(" | Permission to use, copy, modify, and/or distribute this software for any |\n"); + log(" | purpose with or without fee is hereby granted, provided that the above |\n"); + log(" | copyright notice and this permission notice appear in all copies. |\n"); + log(" | |\n"); + log(" | THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |\n"); + log(" | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |\n"); + log(" | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |\n"); + log(" | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |\n"); + log(" | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |\n"); + log(" | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |\n"); + log(" | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |\n"); + log(" | |\n"); + log(" \\-----------------------------------------------------------------------------/\n"); + log("\n"); + if (optind == argc && passes_commands.size() == 0 && scriptfile.empty()) { if (!got_output_filename) backend_command = ""; diff --git a/passes/abc/abc.cc b/passes/abc/abc.cc index ba3494d1d..2fd3334c4 100644 --- a/passes/abc/abc.cc +++ b/passes/abc/abc.cc @@ -614,7 +614,7 @@ struct AbcPass : public Pass { log("\n"); log(" -nocleanup\n"); log(" when this option is used, the tempprary files created be this pass\n"); - log(" are not removed. this is usefull for debugging.\n"); + log(" are not removed. this is useful for debugging.\n"); log("\n"); log("This pass does not operate on modules with uprocessed processes in it.\n"); log("(I.e. the 'proc' pass should be used first to convert processes to netlists.)\n");