Skip to content

Commit

Permalink
aiger2: Describe supported cells in help
Browse files Browse the repository at this point in the history
  • Loading branch information
povik committed Sep 17, 2024
1 parent e4b24e8 commit dbc937b
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion backends/aiger2/aiger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// - gracefully handling inout ports (an error message probably)

#include "kernel/register.h"
#include "kernel/celltypes.h"

USING_YOSYS_NAMESPACE
PRIVATE_NAMESPACE_BEGIN
Expand Down Expand Up @@ -641,7 +642,51 @@ struct Aiger2Backend : Backend {
experimental();
}

void execute(std::ostream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design) override
void help() override
{
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
log("\n");
log(" write_aiger2 [options] [filename]\n");
log("\n");
log("Write the current design to an AIGER file.\n");
log("\n");
log("This command is able to ingest all combinational cells except for:\n");
log("\n");
pool<IdString> supported = {KNOWN_OPS};
CellTypes ct;
ct.setup_internals_eval();
log(" ");
int col = 0;
for (auto pair : ct.cell_types)
if (!supported.count(pair.first)) {
if (col + pair.first.size() + 2 > 72) {
log("\n ");
col = 0;
}
col += pair.first.size() + 2;
log("%s, ", log_id(pair.first));
}
log("\n");
log("\n");
log("And all combinational gates except for:\n");
log("\n");
CellTypes ct2;
ct2.setup_stdcells();
log(" ");
col = 0;
for (auto pair : ct2.cell_types)
if (!supported.count(pair.first)) {
if (col + pair.first.size() + 2 > 72) {
log("\n ");
col = 0;
}
col += pair.first.size() + 2;
log("%s, ", log_id(pair.first));
}
log("\n");
}

void execute(std::ostream *&f, std::string filename, std::vector<std::string> args, Design *design) override
{
log_header(design, "Executing AIGER2 backend.\n");

Expand Down

0 comments on commit dbc937b

Please sign in to comment.