Skip to content

Commit 5dea68f

Browse files
committed
driver: categorize options into help groups
1 parent 3c692ef commit 5dea68f

File tree

1 file changed

+37
-33
lines changed

1 file changed

+37
-33
lines changed

kernel/driver.cc

+37-33
Original file line numberDiff line numberDiff line change
@@ -206,29 +206,11 @@ int main(int argc, char **argv)
206206

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

209-
options.add_options()
210-
("Q", "suppress printing of banner (copyright, disclaimer, version)")
211-
("T", "suppress printing of footer (log hash, version, timing statistics)")
212-
("q,quiet", "quiet operation. Only write warnings and error messages to console. " \
213-
"Use this option twice to also quiet warning messages")
214-
("v,verbose", "print log headers up to <level> to the console. " \
215-
"Implies -q for everything except the 'End of script.' message.",
216-
cxxopts::value<int>(), "<level>")
217-
("t,timestamp", "annotate all log messages with a time stamp")
218-
("d,detailed-timing", "print more detailed timing stats at exit")
219-
("l,logfile", "write log messages to <logfile>",
220-
cxxopts::value<std::vector<std::string>>(), "<logfile>")
221-
("L,line-buffered-logfile", "like -l but open <logfile> in line buffered mode",
222-
cxxopts::value<std::vector<std::string>>(), "<logfile>")
223-
("o,outfile", "write the design to <outfile> on exit",
224-
cxxopts::value<std::string>(), "<outfile>")
209+
options.add_options("functional")
225210
("b,backend", "use <backend> for the output file specified on the command line",
226211
cxxopts::value<std::string>(), "<backend>")
227212
("f,frontend", "use <frontend> for the input files on the command line",
228213
cxxopts::value<std::string>(), "<frontend>")
229-
("H", "print the command list")
230-
("h,help", "print this help message. If given, print help for <command>.",
231-
cxxopts::value<std::string>(), "[<command>]")
232214
("s,scriptfile", "execute the commands in <scriptfile>",
233215
cxxopts::value<std::string>(), "<scriptfile>")
234216
("c,tcl-scriptfile", "execute the commands in the TCL <tcl_scriptfile> (see 'help tcl' for details)",
@@ -238,13 +220,35 @@ int main(int argc, char **argv)
238220
cxxopts::value<std::vector<std::string>>(), "<commands>")
239221
("m,plugin", "load the specified <plugin> module",
240222
cxxopts::value<std::vector<std::string>>(), "<plugin>")
241-
("X,trace", "enable tracing of core data structure changes. for debugging")
242-
("M,randomize-pointers", "will slightly randomize allocated pointer addresses. for debugging")
243-
("A,abort", "will call abort() at the end of the script. for debugging")
244-
("r,top", "elaborate the specified HDL <top> module",
245-
cxxopts::value<std::string>(), "<top>")
246223
("D,define", "set the specified Verilog define to <value> if supplied via command \"read -define\"",
247224
cxxopts::value<std::vector<std::string>>(), "<define>[=<value>]")
225+
("S,synth", "shortcut for calling the \"synth\" command, a default script for transforming " \
226+
"the Verilog input to a gate-level netlist. For example: " \
227+
"yosys -o output.blif -S input.v " \
228+
"For more complex synthesis jobs it is recommended to use the read_* and write_* " \
229+
"commands in a script file instead of specifying input and output files on the " \
230+
"command line.")
231+
("infile", "input files", cxxopts::value<std::vector<std::string>>())
232+
;
233+
options.add_options("logging")
234+
("H", "print the command list")
235+
("h,help", "print this help message. If given, print help for <command>.",
236+
cxxopts::value<std::string>(), "[<command>]")
237+
("Q", "suppress printing of banner (copyright, disclaimer, version)")
238+
("T", "suppress printing of footer (log hash, version, timing statistics)")
239+
("q,quiet", "quiet operation. Only write warnings and error messages to console. " \
240+
"Use this option twice to also quiet warning messages")
241+
("v,verbose", "print log headers up to <level> to the console. " \
242+
"Implies -q for everything except the 'End of script.' message.",
243+
cxxopts::value<int>(), "<level>")
244+
("t,timestamp", "annotate all log messages with a time stamp")
245+
("d,detailed-timing", "print more detailed timing stats at exit")
246+
("l,logfile", "write log messages to <logfile>",
247+
cxxopts::value<std::vector<std::string>>(), "<logfile>")
248+
("L,line-buffered-logfile", "like -l but open <logfile> in line buffered mode",
249+
cxxopts::value<std::vector<std::string>>(), "<logfile>")
250+
("o,outfile", "write the design to <outfile> on exit",
251+
cxxopts::value<std::string>(), "<outfile>")
248252
("P,dump-design", "dump the design when printing the specified log header to a file. " \
249253
"yosys_dump_<header_id>.il is used as filename if none is specified. " \
250254
"Use 'ALL' as <header_id> to dump at every header.",
@@ -257,19 +261,19 @@ int main(int argc, char **argv)
257261
cxxopts::value<std::vector<std::string>>(), "<regex>")
258262
("E,deps-file", "write a Makefile dependencies file <depsfile> with input and output file names",
259263
cxxopts::value<std::string>(), "<depsfile>")
264+
("V,version", "print version information and exit")
265+
;
266+
options.add_options("developer")
267+
("X,trace", "enable tracing of core data structure changes. for debugging")
268+
("M,randomize-pointers", "will slightly randomize allocated pointer addresses. for debugging")
269+
("A,abort", "will call abort() at the end of the script. for debugging")
270+
("r,top", "elaborate the specified HDL <top> module",
271+
cxxopts::value<std::string>(), "<top>")
260272
("x,experimental", "do not print warnings for the experimental <feature>",
261273
cxxopts::value<std::vector<std::string>>(), "<feature>")
262274
("g,debug", "globally enable debug log messages")
263-
("V,version", "print version information and exit")
264-
("S,synth", "shortcut for calling the \"synth\" command, a default script for transforming " \
265-
"the Verilog input to a gate-level netlist. For example: " \
266-
"yosys -o output.blif -S input.v " \
267-
"For more complex synthesis jobs it is recommended to use the read_* and write_* " \
268-
"commands in a script file instead of specifying input and output files on the " \
269-
"command line.")
270275
("perffile", "write a JSON performance log to <perffile>", cxxopts::value<std::string>(), "<perffile>")
271-
("infile", "input files", cxxopts::value<std::vector<std::string>>())
272-
;
276+
;
273277

274278
options.parse_positional({"infile"});
275279
options.positional_help("[<infile> [..]]");

0 commit comments

Comments
 (0)