3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-08-10 08:01:14 +00:00
yosys/kernel
Emil J. Tywoniak 7617dae629 sigmap: take the signorm index's map directly instead of via connections()
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
2026-07-21 12:53:38 +02:00
..
unstable patch: fix signorm commit broken by twine rename 2026-07-20 15:01:30 +02:00
binding.cc
binding.h
bitpattern.h Fix covers_nothing. 2026-07-06 13:26:00 +02:00
calc.cc End of file fix 2026-06-23 07:23:41 +02:00
cellaigs.cc WIP 2026-07-20 12:27:17 +02:00
cellaigs.h WIP 2026-07-20 12:27:17 +02:00
celledges.cc WIP 2026-07-20 12:27:17 +02:00
celledges.h WIP 2026-07-20 12:27:17 +02:00
cellhelp.py Remove trailing whitespaces 2026-06-23 07:24:59 +02:00
celltypes.h WIP 2026-07-20 12:27:17 +02:00
CMakeLists.txt twine 2026-07-20 12:26:39 +02:00
compressor_tree.cc twines phase-3 build fix: post-fork main files broken by twine migration 2026-07-20 15:01:30 +02:00
compressor_tree.h End of file fix 2026-06-23 07:23:41 +02:00
compute_graph.h
consteval.h WIP 2026-07-20 12:27:17 +02:00
constids.inc twines phase-3 build fix: post-fork main files broken by twine migration 2026-07-20 15:01:30 +02:00
cost.cc prevent IdString construction when looking up module from instance type 2026-07-20 12:27:17 +02:00
cost.h WIP 2026-07-20 12:27:17 +02:00
driver.cc WIP migration to twine 2026-07-20 12:27:18 +02:00
drivertools.cc WIP 2026-07-20 12:27:17 +02:00
drivertools.h WIP 2026-07-20 12:27:17 +02:00
ff.cc ff: fix src_twine 2026-07-20 15:01:30 +02:00
ff.h twine: fix replayability, reduce TwineSearch usage 2026-07-20 13:57:10 +02:00
ffinit.h
ffmerge.cc WIP 2026-07-20 12:27:17 +02:00
ffmerge.h
fmt.cc WIP 2026-07-20 12:27:17 +02:00
fmt.h
fstdata.cc Migrate build system to CMake 2026-06-03 08:58:10 +00:00
fstdata.h
functional.cc functinoal: twines 2026-07-20 15:01:30 +02:00
functional.h functinoal: twines 2026-07-20 15:01:30 +02:00
gzip.cc
gzip.h
hashlib.h hashlib: error on unused containers 2026-05-12 12:51:41 +02:00
io.cc Fix Windows portability issues that break MSVC build. 2026-06-03 08:58:11 +00:00
io.h Remove trailing whitespaces 2026-06-23 07:24:59 +02:00
json.cc End of file fix 2026-06-23 07:23:41 +02:00
json.h
log.cc rtlil: options for dumping twines 2026-07-20 15:01:30 +02:00
log.h WIP 2026-07-20 12:27:17 +02:00
log_compat.cc Add one more compatibility logger used in patches for some time 2026-06-12 14:44:26 +02:00
log_help.cc Fixup help contents source_file 2026-07-09 16:05:15 +12:00
log_help.h Fixup help contents source_file 2026-07-09 16:05:15 +12:00
macc.h WIP 2026-07-20 12:27:17 +02:00
mem.cc twine: fix replayability, reduce TwineSearch usage 2026-07-20 13:57:10 +02:00
mem.h
modtools.h WIP 2026-07-20 12:27:17 +02:00
newcelltypes.h newcelltypes: twines 2026-07-20 12:27:18 +02:00
pattern.h
pmux.h WIP 2026-07-20 12:27:17 +02:00
qcsat.cc WIP 2026-07-20 12:27:17 +02:00
qcsat.h
register.cc WIP migration to twine 2026-07-20 12:27:18 +02:00
register.h Drop YOSYS_ENABLE_HELP_SOURCE since C++20 is required. 2026-06-03 08:58:11 +00:00
rtlil.cc rtlil: sort twines by string, not by ID, in sort methods 2026-07-20 15:01:30 +02:00
rtlil.h sigmap: take the signorm index's map directly instead of via connections() 2026-07-21 12:53:38 +02:00
rtlil_bufnorm.cc sigmap: take the signorm index's map directly instead of via connections() 2026-07-21 12:53:38 +02:00
satgen.cc WIP 2026-07-20 12:27:17 +02:00
satgen.h WIP 2026-07-20 12:27:17 +02:00
scopeinfo.cc WIP 2026-07-20 12:27:17 +02:00
scopeinfo.h Refactored uses of log_id() 2026-05-08 20:59:24 -07:00
sexpr.cc
sexpr.h
sigtools.h sigmap: take the signorm index's map directly instead of via connections() 2026-07-21 12:53:38 +02:00
tclapi.cc twine: avoid TwinePool::lookup 2026-07-20 12:27:18 +02:00
threading.cc threading: whitespace 2026-05-18 16:26:14 +02:00
threading.h Migrate build system to CMake 2026-06-03 08:58:10 +00:00
timinginfo.h WIP 2026-07-20 12:27:17 +02:00
topo_scc.h Remove trailing whitespaces 2026-06-23 07:24:59 +02:00
twine.cc twine: fix replayability, reduce TwineSearch usage 2026-07-20 13:57:10 +02:00
twine.h twine: fix replayability, reduce TwineSearch usage 2026-07-20 13:57:10 +02:00
utils.h twine: fix replayability, reduce TwineSearch usage 2026-07-20 13:57:10 +02:00
version.cc.in Include build datetime in scl cache hash. 2026-07-10 12:44:34 +02:00
yosys.cc WIP 2026-07-20 12:27:17 +02:00
yosys.h Include build datetime in scl cache hash. 2026-07-10 12:44:34 +02:00
yosys_common.h twine: fix replayability, reduce TwineSearch usage 2026-07-20 13:57:10 +02:00
yosys_config.h.in Drop YOSYS_ENABLE_HELP_SOURCE since C++20 is required. 2026-06-03 08:58:11 +00:00
yw.cc
yw.h prevent IdString construction when looking up module from instance type 2026-07-20 12:27:17 +02:00