mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-21 13:23:40 +00:00
Rename help_v2 to formatted_help
Also add comments to `help()` and `formatted_help()` to clarify usage.
This commit is contained in:
parent
34c514bf96
commit
68cb02d9f3
3 changed files with 7 additions and 5 deletions
|
@ -118,14 +118,14 @@ void Pass::post_execute(Pass::pre_post_exec_state_t state)
|
||||||
|
|
||||||
void Pass::help()
|
void Pass::help()
|
||||||
{
|
{
|
||||||
if (!help_v2()) {
|
if (!formatted_help()) {
|
||||||
log("\n");
|
log("\n");
|
||||||
log("No help message for command `%s'.\n", pass_name.c_str());
|
log("No help message for command `%s'.\n", pass_name.c_str());
|
||||||
log("\n");
|
log("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Pass::help_v2()
|
bool Pass::formatted_help()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -827,7 +827,7 @@ struct HelpPass : public Pass {
|
||||||
auto experimental_flag = pass->experimental_flag;
|
auto experimental_flag = pass->experimental_flag;
|
||||||
|
|
||||||
auto cmd_help = PrettyHelp(PrettyHelp::Mode::LISTING);
|
auto cmd_help = PrettyHelp(PrettyHelp::Mode::LISTING);
|
||||||
auto has_pretty_help = pass->help_v2();
|
auto has_pretty_help = pass->formatted_help();
|
||||||
|
|
||||||
if (!has_pretty_help) {
|
if (!has_pretty_help) {
|
||||||
enum PassUsageState {
|
enum PassUsageState {
|
||||||
|
|
|
@ -58,8 +58,10 @@ struct Pass
|
||||||
source_location location = source_location::current());
|
source_location location = source_location::current());
|
||||||
virtual ~Pass();
|
virtual ~Pass();
|
||||||
|
|
||||||
|
// Makes calls to log() to generate help message
|
||||||
virtual void help();
|
virtual void help();
|
||||||
virtual bool help_v2();
|
// Uses PrettyHelp::get_current() to produce a more portable formatted help message
|
||||||
|
virtual bool formatted_help();
|
||||||
virtual void clear_flags();
|
virtual void clear_flags();
|
||||||
virtual void execute(std::vector<std::string> args, RTLIL::Design *design) = 0;
|
virtual void execute(std::vector<std::string> args, RTLIL::Design *design) = 0;
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ static bool is_triggered_check_cell(RTLIL::Cell * cell)
|
||||||
struct ChformalPass : public Pass {
|
struct ChformalPass : public Pass {
|
||||||
ChformalPass() : Pass("chformal", "change formal constraints of the design") {}
|
ChformalPass() : Pass("chformal", "change formal constraints of the design") {}
|
||||||
|
|
||||||
bool help_v2() override {
|
bool formatted_help() override {
|
||||||
auto *help = PrettyHelp::get_current();
|
auto *help = PrettyHelp::get_current();
|
||||||
help->set_group("formal");
|
help->set_group("formal");
|
||||||
help->usage("chformal [types] [mode] [options] [selection]");
|
help->usage("chformal [types] [mode] [options] [selection]");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue