diff options
author | Peter Gadfort <peter.gadfort@gmail.com> | 2023-01-02 12:46:41 -0500 |
---|---|---|
committer | Peter Gadfort <peter.gadfort@gmail.com> | 2023-01-02 12:46:41 -0500 |
commit | 7971154e727cc4d7c4b8c62ad43a28645bb66795 (patch) | |
tree | ea4632f116b272bc15940cc59f45a73eef008566 /kernel | |
parent | 58cca9592d64178a097c6345a576b1df022cd50c (diff) | |
parent | 583ab81670847bc0084708bab04c64cb43bc3a51 (diff) | |
download | yosys-7971154e727cc4d7c4b8c62ad43a28645bb66795.tar.gz yosys-7971154e727cc4d7c4b8c62ad43a28645bb66795.tar.bz2 yosys-7971154e727cc4d7c4b8c62ad43a28645bb66795.zip |
Merge branch 'master' into stat-json-area
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/driver.cc | 2 | ||||
-rw-r--r-- | kernel/register.cc | 92 |
2 files changed, 1 insertions, 93 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc index a89c790d9..ef8e77924 100644 --- a/kernel/driver.cc +++ b/kernel/driver.cc @@ -297,7 +297,7 @@ int main(int argc, char **argv) #endif printf("\n"); printf(" -p command\n"); - printf(" execute the commands\n"); + printf(" execute the commands (to chain commands, separate them with semicolon + whitespace: 'cmd1; cmd2')\n"); printf("\n"); printf(" -m module_file\n"); printf(" load the specified module (aka plugin)\n"); diff --git a/kernel/register.cc b/kernel/register.cc index 9449890b1..ab391b10d 100644 --- a/kernel/register.cc +++ b/kernel/register.cc @@ -765,63 +765,6 @@ struct HelpPass : public Pass { log(" help <celltype>+ .... print verilog code for given cell type\n"); log("\n"); } - void escape_tex(std::string &tex) - { - for (size_t pos = 0; (pos = tex.find('_', pos)) != std::string::npos; pos += 2) - tex.replace(pos, 1, "\\_"); - for (size_t pos = 0; (pos = tex.find('$', pos)) != std::string::npos; pos += 2) - tex.replace(pos, 1, "\\$"); - } - void write_tex(FILE *f, std::string cmd, std::string title, std::string text) - { - size_t begin = text.find_first_not_of("\n"), end = text.find_last_not_of("\n"); - if (begin != std::string::npos && end != std::string::npos && begin < end) - text = text.substr(begin, end-begin+1); - std::string cmd_unescaped = cmd; - escape_tex(cmd); - escape_tex(title); - fprintf(f, "\\section{%s -- %s}\n", cmd.c_str(), title.c_str()); - fprintf(f, "\\label{cmd:%s}\n", cmd_unescaped.c_str()); - fprintf(f, "\\begin{lstlisting}[numbers=left,frame=single]\n"); - fprintf(f, "%s\n\\end{lstlisting}\n\n", text.c_str()); - } - void escape_html(std::string &html) - { - size_t pos = 0; - while ((pos = html.find_first_of("<>&", pos)) != std::string::npos) - switch (html[pos]) { - case '<': - html.replace(pos, 1, "<"); - pos += 4; - break; - case '>': - html.replace(pos, 1, ">"); - pos += 4; - break; - case '&': - html.replace(pos, 1, "&"); - pos += 5; - break; - } - } - void write_html(FILE *idxf, std::string cmd, std::string title, std::string text) - { - FILE *f = fopen(stringf("cmd_%s.in", cmd.c_str()).c_str(), "wt"); - fprintf(idxf, "<li><a href=\"cmd_%s.html\"> ", cmd.c_str()); - - escape_html(cmd); - escape_html(title); - escape_html(text); - - fprintf(idxf, "%s</a> <span>%s</span></a>\n", cmd.c_str(), title.c_str()); - - fprintf(f, "@cmd_header %s@\n", cmd.c_str()); - fprintf(f, "<h1>%s - %s</h1>\n", cmd.c_str(), title.c_str()); - fprintf(f, "<pre>%s</pre>\n", text.c_str()); - fprintf(f, "@footer@\n"); - - fclose(f); - } void write_rst(std::string cmd, std::string title, std::string text) { FILE *f = fopen(stringf("docs/source/cmd/%s.rst", cmd.c_str()).c_str(), "wt"); @@ -958,24 +901,6 @@ struct HelpPass : public Pass { return; } // this option is undocumented as it is for internal use only - else if (args[1] == "-write-tex-command-reference-manual") { - FILE *f = fopen("command-reference-manual.tex", "wt"); - fprintf(f, "%% Generated using the yosys 'help -write-tex-command-reference-manual' command.\n\n"); - for (auto &it : pass_register) { - std::ostringstream buf; - log_streams.push_back(&buf); - it.second->help(); - if (it.second->experimental_flag) { - log("\n"); - log("WARNING: THE '%s' COMMAND IS EXPERIMENTAL.\n", it.first.c_str()); - log("\n"); - } - log_streams.pop_back(); - write_tex(f, it.first, it.second->short_help, buf.str()); - } - fclose(f); - } - // this option is undocumented as it is for internal use only else if (args[1] == "-write-rst-command-reference-manual") { for (auto &it : pass_register) { std::ostringstream buf; @@ -990,23 +915,6 @@ struct HelpPass : public Pass { write_rst(it.first, it.second->short_help, buf.str()); } } - // this option is undocumented as it is for internal use only - else if (args[1] == "-write-web-command-reference-manual") { - FILE *f = fopen("templates/cmd_index.in", "wt"); - for (auto &it : pass_register) { - std::ostringstream buf; - log_streams.push_back(&buf); - it.second->help(); - if (it.second->experimental_flag) { - log("\n"); - log("WARNING: THE '%s' COMMAND IS EXPERIMENTAL.\n", it.first.c_str()); - log("\n"); - } - log_streams.pop_back(); - write_html(f, it.first, it.second->short_help, buf.str()); - } - fclose(f); - } else if (pass_register.count(args[1])) { pass_register.at(args[1])->help(); if (pass_register.at(args[1])->experimental_flag) { |