Refactor common parts of SAT-using optimizations into a helper.
authorMarcelina Kościelnicka <mwk@0x04.net>
Tue, 3 Aug 2021 22:02:16 +0000 (00:02 +0200)
committerMarcelina Kościelnicka <mwk@0x04.net>
Mon, 9 Aug 2021 14:54:35 +0000 (16:54 +0200)
commitd25b9088c83ba68b938ef9f0d97793a08001a9fe
tree850d768b062d231f0ff7d9fbc3bab8d642a861c6
parentd8fcf1ab2568ae88aa3a2c9548578b899cc4d383
Refactor common parts of SAT-using optimizations into a helper.

This also aligns the functionality:

- in all cases, the onehot attribute is used to create appropriate
  constraints (previously, opt_dff didn't do it at all, and share
  created one-hot constraints based on $pmux presence alone, which
  is unsound)
- in all cases, shift and mul/div/pow cells are now skipped when
  importing the SAT problem (previously only memory_share did this)
  — this avoids creating clauses for hard cells that are unlikely
  to help with proving the UNSATness needed for optimization
Makefile
kernel/modtools.h
kernel/qcsat.cc [new file with mode: 0644]
kernel/qcsat.h [new file with mode: 0644]
passes/memory/memory_share.cc
passes/opt/opt_dff.cc
passes/opt/share.cc