mirror of
https://github.com/YosysHQ/yosys
synced 2026-08-10 08:01:14 +00:00
While in signorm mode the module's index already holds a complete SigMap of its alias connectivity; connections_ is only a scratch buffer that restore_connections() materializes that map into on demand. So every `SigMap sigmap(module)` was a round trip: restore_connections() walked the entire union-find emitting (bit, sigmap(bit)) pairs, and SigMap::set() hashed all of them straight back into an identical union-find. Worse, set() iterates connections() twice, so each construction paid for two full materializations. Since restore_connections() emits the representative as the right-hand side and SigMap::add() leaves the right-hand side as the root, the rebuild reproduces exactly the classes and representatives it started from -- so copy the mfp instead. Module::signorm_sigmap() hands it out after merging any pending connections, and returns nullptr outside signorm mode, where the old path stands. The copy also carries entries for bits that map to themselves, which the connection-derived rebuild would omit. That is only observable through SigMap::allbits() or by iterating .database, neither of which has a caller outside sigtools.h. Measured on a 2000-stage pipeline with dead logic (Debug build, `opt`): signorm_restore drops from 0.76s over 22 calls to 0.08s over 12, and the whole run from 7.24s to 6.40s. The sigmap being round-tripped there peaks at 1.29M entries, which is the alias structure of the post-proc netlist. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MQU5XCqDYY8MbivGkNRrDo |
||
|---|---|---|
| .. | ||
| unstable | ||
| binding.cc | ||
| binding.h | ||
| bitpattern.h | ||
| calc.cc | ||
| cellaigs.cc | ||
| cellaigs.h | ||
| celledges.cc | ||
| celledges.h | ||
| cellhelp.py | ||
| celltypes.h | ||
| CMakeLists.txt | ||
| compressor_tree.cc | ||
| compressor_tree.h | ||
| compute_graph.h | ||
| consteval.h | ||
| constids.inc | ||
| cost.cc | ||
| cost.h | ||
| driver.cc | ||
| drivertools.cc | ||
| drivertools.h | ||
| ff.cc | ||
| ff.h | ||
| ffinit.h | ||
| ffmerge.cc | ||
| ffmerge.h | ||
| fmt.cc | ||
| fmt.h | ||
| fstdata.cc | ||
| fstdata.h | ||
| functional.cc | ||
| functional.h | ||
| gzip.cc | ||
| gzip.h | ||
| hashlib.h | ||
| io.cc | ||
| io.h | ||
| json.cc | ||
| json.h | ||
| log.cc | ||
| log.h | ||
| log_compat.cc | ||
| log_help.cc | ||
| log_help.h | ||
| macc.h | ||
| mem.cc | ||
| mem.h | ||
| modtools.h | ||
| newcelltypes.h | ||
| pattern.h | ||
| pmux.h | ||
| qcsat.cc | ||
| qcsat.h | ||
| register.cc | ||
| register.h | ||
| rtlil.cc | ||
| rtlil.h | ||
| rtlil_bufnorm.cc | ||
| satgen.cc | ||
| satgen.h | ||
| scopeinfo.cc | ||
| scopeinfo.h | ||
| sexpr.cc | ||
| sexpr.h | ||
| sigtools.h | ||
| tclapi.cc | ||
| threading.cc | ||
| threading.h | ||
| timinginfo.h | ||
| topo_scc.h | ||
| twine.cc | ||
| twine.h | ||
| utils.h | ||
| version.cc.in | ||
| yosys.cc | ||
| yosys.h | ||
| yosys_common.h | ||
| yosys_config.h.in | ||
| yw.cc | ||
| yw.h | ||