Skip to content

Commit

Permalink
driver: categorize options into help groups
Browse files Browse the repository at this point in the history
  • Loading branch information
widlarizer committed Sep 26, 2024
1 parent 3c692ef commit 5dea68f
Showing 1 changed file with 37 additions and 33 deletions.
70 changes: 37 additions & 33 deletions kernel/driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,29 +206,11 @@ int main(int argc, char **argv)

cxxopts::Options options(argv[0], "Yosys Open SYnthesis Suite");

options.add_options()
("Q", "suppress printing of banner (copyright, disclaimer, version)")
("T", "suppress printing of footer (log hash, version, timing statistics)")
("q,quiet", "quiet operation. Only write warnings and error messages to console. " \
"Use this option twice to also quiet warning messages")
("v,verbose", "print log headers up to <level> to the console. " \
"Implies -q for everything except the 'End of script.' message.",
cxxopts::value<int>(), "<level>")
("t,timestamp", "annotate all log messages with a time stamp")
("d,detailed-timing", "print more detailed timing stats at exit")
("l,logfile", "write log messages to <logfile>",
cxxopts::value<std::vector<std::string>>(), "<logfile>")
("L,line-buffered-logfile", "like -l but open <logfile> in line buffered mode",
cxxopts::value<std::vector<std::string>>(), "<logfile>")
("o,outfile", "write the design to <outfile> on exit",
cxxopts::value<std::string>(), "<outfile>")
options.add_options("functional")
("b,backend", "use <backend> for the output file specified on the command line",
cxxopts::value<std::string>(), "<backend>")
("f,frontend", "use <frontend> for the input files on the command line",
cxxopts::value<std::string>(), "<frontend>")
("H", "print the command list")
("h,help", "print this help message. If given, print help for <command>.",
cxxopts::value<std::string>(), "[<command>]")
("s,scriptfile", "execute the commands in <scriptfile>",
cxxopts::value<std::string>(), "<scriptfile>")
("c,tcl-scriptfile", "execute the commands in the TCL <tcl_scriptfile> (see 'help tcl' for details)",
Expand All @@ -238,13 +220,35 @@ int main(int argc, char **argv)
cxxopts::value<std::vector<std::string>>(), "<commands>")
("m,plugin", "load the specified <plugin> module",
cxxopts::value<std::vector<std::string>>(), "<plugin>")
("X,trace", "enable tracing of core data structure changes. for debugging")
("M,randomize-pointers", "will slightly randomize allocated pointer addresses. for debugging")
("A,abort", "will call abort() at the end of the script. for debugging")
("r,top", "elaborate the specified HDL <top> module",
cxxopts::value<std::string>(), "<top>")
("D,define", "set the specified Verilog define to <value> if supplied via command \"read -define\"",
cxxopts::value<std::vector<std::string>>(), "<define>[=<value>]")
("S,synth", "shortcut for calling the \"synth\" command, a default script for transforming " \
"the Verilog input to a gate-level netlist. For example: " \
"yosys -o output.blif -S input.v " \
"For more complex synthesis jobs it is recommended to use the read_* and write_* " \
"commands in a script file instead of specifying input and output files on the " \
"command line.")
("infile", "input files", cxxopts::value<std::vector<std::string>>())
;
options.add_options("logging")
("H", "print the command list")
("h,help", "print this help message. If given, print help for <command>.",
cxxopts::value<std::string>(), "[<command>]")
("Q", "suppress printing of banner (copyright, disclaimer, version)")
("T", "suppress printing of footer (log hash, version, timing statistics)")
("q,quiet", "quiet operation. Only write warnings and error messages to console. " \
"Use this option twice to also quiet warning messages")
("v,verbose", "print log headers up to <level> to the console. " \
"Implies -q for everything except the 'End of script.' message.",
cxxopts::value<int>(), "<level>")
("t,timestamp", "annotate all log messages with a time stamp")
("d,detailed-timing", "print more detailed timing stats at exit")
("l,logfile", "write log messages to <logfile>",
cxxopts::value<std::vector<std::string>>(), "<logfile>")
("L,line-buffered-logfile", "like -l but open <logfile> in line buffered mode",
cxxopts::value<std::vector<std::string>>(), "<logfile>")
("o,outfile", "write the design to <outfile> on exit",
cxxopts::value<std::string>(), "<outfile>")
("P,dump-design", "dump the design when printing the specified log header to a file. " \
"yosys_dump_<header_id>.il is used as filename if none is specified. " \
"Use 'ALL' as <header_id> to dump at every header.",
Expand All @@ -257,19 +261,19 @@ int main(int argc, char **argv)
cxxopts::value<std::vector<std::string>>(), "<regex>")
("E,deps-file", "write a Makefile dependencies file <depsfile> with input and output file names",
cxxopts::value<std::string>(), "<depsfile>")
("V,version", "print version information and exit")
;
options.add_options("developer")
("X,trace", "enable tracing of core data structure changes. for debugging")
("M,randomize-pointers", "will slightly randomize allocated pointer addresses. for debugging")
("A,abort", "will call abort() at the end of the script. for debugging")
("r,top", "elaborate the specified HDL <top> module",
cxxopts::value<std::string>(), "<top>")
("x,experimental", "do not print warnings for the experimental <feature>",
cxxopts::value<std::vector<std::string>>(), "<feature>")
("g,debug", "globally enable debug log messages")
("V,version", "print version information and exit")
("S,synth", "shortcut for calling the \"synth\" command, a default script for transforming " \
"the Verilog input to a gate-level netlist. For example: " \
"yosys -o output.blif -S input.v " \
"For more complex synthesis jobs it is recommended to use the read_* and write_* " \
"commands in a script file instead of specifying input and output files on the " \
"command line.")
("perffile", "write a JSON performance log to <perffile>", cxxopts::value<std::string>(), "<perffile>")
("infile", "input files", cxxopts::value<std::vector<std::string>>())
;
;

options.parse_positional({"infile"});
options.positional_help("[<infile> [..]]");
Expand Down

0 comments on commit 5dea68f

Please sign in to comment.