From 186ded15cfbc9eb4cd82b9f8c261ea6fd9ba63e1 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Mon, 27 May 2024 12:47:47 +1200 Subject: [PATCH] cellref: Move default help message to register.cc Drop the default help message from rst while still displaying it on the command line. Fix command line formatting for older style help messages. --- kernel/register.cc | 10 ++++++---- techlibs/common/cellhelp.py | 4 +--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/register.cc b/kernel/register.cc index bc49f4cb914..ce6eb8018b2 100644 --- a/kernel/register.cc +++ b/kernel/register.cc @@ -1111,18 +1111,20 @@ struct HelpPass : public Pass { log("\n"); log("%s\n", help_cell.code.c_str()); } else { + log("\n %s %s\n\n", help_cell.name.c_str(), help_cell.ports.c_str()); if (help_cell.ver == "2" || help_cell.ver == "2a") { - log("\n %s %s\n\n", help_cell.name.c_str(), help_cell.ports.c_str()); - if (help_cell.title != "") log("%s\n", help_cell.title.c_str()); + if (help_cell.title != "") log("%s:\n", help_cell.title.c_str()); std::stringstream ss; ss << help_cell.desc; for (std::string line; std::getline(ss, line, '\n');) { if (line != "::") log("%s\n", line.c_str()); } - } else { + } else if (help_cell.desc.length()) { log("%s\n", help_cell.desc.c_str()); + } else { + log("No help message for this cell type found.\n"); } - log("Run 'help %s+' to display the Verilog model for this cell type.\n", args[1].c_str()); + log("\nRun 'help %s+' to display the Verilog model for this cell type.\n", args[1].c_str()); log("\n"); } } diff --git a/techlibs/common/cellhelp.py b/techlibs/common/cellhelp.py index 299b7affd73..9aa3def93cc 100644 --- a/techlibs/common/cellhelp.py +++ b/techlibs/common/cellhelp.py @@ -84,9 +84,7 @@ def simcells_reparse(cell: SimHelper): simcells_reparse(simHelper) # check help - if not simHelper.desc: - simHelper.desc.append("No help message for this cell type found.\n") - elif simHelper.ver == "1" and short_filename == "simlib.v" and simHelper.desc[1].startswith(' '): + if simHelper.desc and simHelper.ver == "1" and short_filename == "simlib.v" and simHelper.desc[1].startswith(' '): simHelper.desc.pop(1) # check group