mirror of https://github.com/YosysHQ/yosys.git
This commit introduces the negopt pass with pre/post optimization modes for handling negation patterns in arithmetic circuits. Pre-optimization patterns (expose for tree balancing): - manual2sub: (a + ~b) + 1 → a - b - sub2neg: a - b → a + (-b) - negexpand: -(a + b) → (-a) + (-b) [with output width fix] - negneg: -(-a) → a - negmux: -(s ? a : b) → s ? (-a) : (-b) Post-optimization patterns (cleanup/rebuild): - negrebuild: (-a) + (-b) → -(a + b) - muxneg: s ? (-a) : (-b) → -(s ? a : b) - neg2sub: a + (-b) → a - b All patterns use nusers() for fanout checking (standard Yosys style). Comprehensive test coverage with positive/negative cases and formal verification via equiv_opt. |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| Makefile.inc | ||
| activity.cc | ||
| annotate_cell_fanout.cc | ||
| breakreduce.cc | ||
| breaksop.cc | ||
| bus_rebuild.cc | ||
| fanoutbuf.cc | ||
| l2j_frontend.cc | ||
| muxmode.cc | ||
| muxpacker.cc | ||
| negopt.cc | ||
| obs_clean.cc | ||
| opt_expand.cc | ||
| peepopt_expand.pmg | ||
| peepopt_manual2sub.pmg | ||
| peepopt_muxinvprop.pmg | ||
| peepopt_muxmode.pmg | ||
| peepopt_muxneg.pmg | ||
| peepopt_neg2sub.pmg | ||
| peepopt_negexpand.pmg | ||
| peepopt_negmux.pmg | ||
| peepopt_negneg.pmg | ||
| peepopt_negrebuild.pmg | ||
| peepopt_sub2neg.pmg | ||
| reg_rename.cc | ||
| segv.cc | ||
| splitfanout.cc | ||
| splitlarge.cc | ||
| splitnetlist.cc | ||