3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-20 07:36:39 +00:00

celltypes: Add help -celltypes

Like `help -cells` but instead of printing the cell's ports, prints its flags.
This commit is contained in:
Krystine Sherwin 2025-03-01 10:52:29 +13:00
parent d1f6d67d85
commit 82ae46dfeb
No known key found for this signature in database

View file

@ -1074,6 +1074,36 @@ struct HelpPass : public Pass {
log("\n");
return;
}
else if (args[1] == "-celltypes") {
log("\n");
for (auto &it : cell_help_messages.cell_help) {
SimHelper help_cell = it.second;
auto *ct = yosys_celltypes.get_cell(it.first);
char ct_flags[8] = "";
if (ct != nullptr && ct->is_internal) {
ct_flags[0] = ct->is_evaluable ? 'E' : '-';
ct_flags[1] = ct->is_combinatorial ? 'C' : '-';
ct_flags[2] = ct->is_synthesizable ? 'S' : '-';
ct_flags[3] = ct->is_builtin_ff ? 'M' : '-';
ct_flags[4] = ct->is_formal ? 'F' : '-';
ct_flags[5] = ct->is_metainfo ? 'I' : '-';
ct_flags[6] = ct->has_effects ? 'X' : '-';
ct_flags[7] = 0;
}
log(" %-15s %s\n", help_cell.name.c_str(), ct_flags);
}
log("\n");
log("Legend:\n");
log(" E = evaluable\n");
log(" C = combinatorial\n");
log(" S = synthesizable\n");
log(" M = builtin_ff\n");
log(" F = formal\n");
log(" I = metainfo\n");
log(" X = effects\n");
log("\n");
return;
}
// 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) {