In the Verilog backend, only sort modules that we're going to emit.
If you have a large design with a lot of modules and you use the Verilog backend to emit modules one at a time to separate files, performance is very low. The problem is that the Verilog backend calls `design->sort()` every time, which sorts the contents of all modules, and this is slow even when everything is already sorted. We can easily fix this by only sorting the contents of modules that we're actually going to emit.
This commit is contained in:
@@ -2612,7 +2612,7 @@ struct VerilogBackend : public Backend {
|
||||
Pass::call(design, "clean_zerowidth");
|
||||
log_pop();
|
||||
|
||||
design->sort();
|
||||
design->sort_modules();
|
||||
|
||||
*f << stringf("/* Generated by %s */\n", yosys_maybe_version());
|
||||
|
||||
@@ -2625,6 +2625,7 @@ struct VerilogBackend : public Backend {
|
||||
continue;
|
||||
}
|
||||
log("Dumping module `%s'.\n", module->name.c_str());
|
||||
module->sort();
|
||||
dump_module(*f, "", module);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user