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.
remove 'undef' inputs from $mux, $pmux and $_MUX_ cells
replace $mux cells with inverters or buffers when possible
replace undriven nets with undef (x) constants
do not optimize clock inverters by changing FF types
perform fine-grain optimizations
alias for -mux_undef -mux_bool -undriven -fine
some 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.