opt_expr - perform const folding and simple expression rewriting#
- yosys> help opt_expr#
opt_expr [options] [selection]
This pass performs const folding on internal cell types with constant inputs. It also performs some simple expression rewriting.
-mux_undefremove 'undef' inputs from $mux, $pmux and $_MUX_ cells
-mux_boolreplace $mux cells with inverters or buffers when possible
-undrivenreplace undriven nets with undef (x) constants
-noclkinvdo not optimize clock inverters by changing FF types
-fineperform fine-grain optimizations
-fullalias for -mux_undef -mux_bool -undriven -fine
-keepdcsome optimizations change the behavior of the circuit with respect to don't-care bits. for example in 'a+0' a single x-bit in 'a' will cause all result bits to be set to x. this behavior changes when 'a+0' is replaced by 'a'. the -keepdc option disables all such optimizations.