mirror of
https://github.com/YosysHQ/yosys
synced 2025-05-16 20:24:46 +00:00
parent
a32e4dd8f8
commit
22c99a2b2e
3 changed files with 32 additions and 9 deletions
|
@ -344,6 +344,9 @@ struct MuxpackPass : public Pass {
|
|||
log(" -splitfanout\n");
|
||||
log(" run splitfanout pass first\n");
|
||||
log("\n");
|
||||
log(" -fanoutlimit\n");
|
||||
log(" fanout limit for splitfanout, beyond which no split (default: 10)\n");
|
||||
log("\n");
|
||||
log(" -assume_excl\n");
|
||||
log(" assume mutually exclusive constraint when packing (may result in inequivalence)\n");
|
||||
log("\n");
|
||||
|
@ -352,6 +355,7 @@ struct MuxpackPass : public Pass {
|
|||
{
|
||||
bool splitfanout = false;
|
||||
bool assume_excl = false;
|
||||
int fanoutlimit = 10;
|
||||
|
||||
log_header(design, "Executing MUXPACK pass ($mux cell cascades to $pmux).\n");
|
||||
|
||||
|
@ -362,6 +366,10 @@ struct MuxpackPass : public Pass {
|
|||
splitfanout = true;
|
||||
continue;
|
||||
}
|
||||
if ((args[argidx] == "-fanoutlimit") && ((argidx + 1) < args.size())) {
|
||||
fanoutlimit = std::stoi(args[++argidx]);
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-assume_excl") {
|
||||
assume_excl = true;
|
||||
continue;
|
||||
|
@ -371,7 +379,7 @@ struct MuxpackPass : public Pass {
|
|||
extra_args(args, argidx, design);
|
||||
|
||||
if (splitfanout)
|
||||
Pass::call(design, "splitfanout t:$mux t:$pmux");
|
||||
Pass::call(design, stringf("splitfanout -fanoutlimit %d t:$mux t:$pmux", fanoutlimit));
|
||||
|
||||
int mux_count = 0;
|
||||
int pmux_count = 0;
|
||||
|
|
|
@ -314,9 +314,13 @@ struct OptBalanceTreePass : public Pass {
|
|||
log(" -splitfanout\n");
|
||||
log(" run splitfanout pass first\n");
|
||||
log("\n");
|
||||
log(" -fanoutlimit\n");
|
||||
log(" fanout limit for splitfanout, beyond which no split (default: 10)\n");
|
||||
log("\n");
|
||||
}
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *design) override {
|
||||
bool splitfanout = false;
|
||||
int fanoutlimit = 10;
|
||||
|
||||
log_header(design, "Executing OPT_BALANCE_TREE pass (cell cascades to trees).\n");
|
||||
|
||||
|
@ -327,13 +331,17 @@ struct OptBalanceTreePass : public Pass {
|
|||
splitfanout = true;
|
||||
continue;
|
||||
}
|
||||
if ((args[argidx] == "-fanoutlimit") && ((argidx + 1) < args.size())) {
|
||||
fanoutlimit = std::stoi(args[++argidx]);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
extra_args(args, argidx, design);
|
||||
|
||||
// Run splitfanout pass first
|
||||
if (splitfanout)
|
||||
Pass::call(design, "splitfanout t:$and t:$or t:$xor t:$add t:$mul");
|
||||
Pass::call(design, stringf("splitfanout -fanoutlimit %d t:$and t:$or t:$xor t:$add t:$mul", fanoutlimit));
|
||||
|
||||
// Count of all cells that were packed
|
||||
dict<IdString, int> cell_count;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue