Added help for command line options
authorClifford Wolf <clifford@clifford.at>
Thu, 28 Feb 2013 12:13:56 +0000 (13:13 +0100)
committerClifford Wolf <clifford@clifford.at>
Thu, 28 Feb 2013 12:13:56 +0000 (13:13 +0100)
Makefile
kernel/driver.cc
passes/abc/abc.cc

index 18daca64c0018821b5127818d3ec4eb36fd04906..7be911fb768fe54992b6b045077a83e006414b16 100644 (file)
--- 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
 
index bfbf21050febe87183eaf189594f544ad9e690bd..105e4647d2aa39f5b3e28a1f5852cfe1f187d30b 100644 (file)
@@ -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<std::string>, 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 <outfile>] [-f <frontend>] [-s <scriptfile>] [-p <pass> [-p ..]] [-b <backend>] [<infile> [..]]\n", argv[0]);
+                       fprintf(stderr, "\n");
+                       fprintf(stderr, "Usage: %s [-q] [-t] [-l logfile] [-o <outfile>] [-f <frontend>] [-s <scriptfile>]\n", argv[0]);
+                       fprintf(stderr, "       %*s[-p <pass> [-p ..]] [-b <backend>] [<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, "    -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 <clifford@clifford.at>                   |\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 = "";
index ba3494d1ddd85e0b5e3072521e7811ddc3622d0b..2fd3334c432162c4b1024c0331c86a61a5f9e635 100644 (file)
@@ -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");