mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-09 20:50:51 +00:00
register: Add pass_usages and default help
Experimental new formatting for describing passes that can be rendered into the standard help format, as well as being more amenable to smarter formatting for web documentation.
This commit is contained in:
parent
2c79aeb7ad
commit
28ecb91052
2 changed files with 60 additions and 5 deletions
|
@ -25,10 +25,24 @@
|
|||
|
||||
YOSYS_NAMESPACE_BEGIN
|
||||
|
||||
struct PassOption {
|
||||
string keyword;
|
||||
string description;
|
||||
};
|
||||
|
||||
struct PassUsageBlock {
|
||||
string signature = "";
|
||||
string description = "";
|
||||
vector<PassOption> options = {};
|
||||
string postscript = "";
|
||||
};
|
||||
|
||||
struct Pass
|
||||
{
|
||||
std::string pass_name, short_help;
|
||||
Pass(std::string name, std::string short_help = "** document me **");
|
||||
const vector<PassUsageBlock> pass_usages;
|
||||
Pass(std::string name, std::string short_help = "** document me **",
|
||||
const vector<PassUsageBlock> usages = {});
|
||||
// Prefer overriding 'Pass::on_shutdown()' if possible
|
||||
virtual ~Pass();
|
||||
|
||||
|
@ -44,6 +58,10 @@ struct Pass
|
|||
experimental_flag = true;
|
||||
}
|
||||
|
||||
bool HasUsages() {
|
||||
return !pass_usages.empty();
|
||||
}
|
||||
|
||||
struct pre_post_exec_state_t {
|
||||
Pass *parent_pass;
|
||||
int64_t begin_ns;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue