mirror of
https://github.com/YosysHQ/yosys
synced 2025-07-22 20:32:07 +00:00
cxxrtl: use one delta cycle for immediately converging netlists.
If it is statically known that eval() will converge in one delta cycle (that is, the second commit() will always return `false`) because the design contains no feedback or buffered wires, then there is no need to run the second delta cycle at all. After this commit, the case where eval() always converges immediately is detected and the second delta cycle is omitted. As a result, Minerva SRAM SoC runs ~25% faster.
This commit is contained in:
parent
7f5313e6c3
commit
4aa0f450f5
2 changed files with 21 additions and 11 deletions
|
@ -717,15 +717,16 @@ struct module {
|
|||
module(const module &) = delete;
|
||||
module &operator=(const module &) = delete;
|
||||
|
||||
virtual void eval() = 0;
|
||||
virtual bool eval() = 0;
|
||||
virtual bool commit() = 0;
|
||||
|
||||
size_t step() {
|
||||
size_t deltas = 0;
|
||||
bool converged = false;
|
||||
do {
|
||||
eval();
|
||||
converged = eval();
|
||||
deltas++;
|
||||
} while (commit());
|
||||
} while (commit() && !converged);
|
||||
return deltas;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue