opt_expr: Propagate constants to port connections.
authorMarcelina Kościelnicka <mwk@0x04.net>
Tue, 27 Jul 2021 13:24:48 +0000 (15:24 +0200)
committerMarcelina Kościelnicka <mwk@0x04.net>
Tue, 27 Jul 2021 18:44:26 +0000 (20:44 +0200)
commit436d42c00c2bf1b2eaf84ada388d8aaab65da086
treeddef55a459277faab091276d37726cc94c0e46f0
parent9600f20be887b707f6d5d3f74dec58b336e2464e
opt_expr: Propagate constants to port connections.

This adds one simple piece of functionality to opt_expr: when a cell
port is connected to a fully-constant signal (as determined by sigmap),
the port is reconnected directly to the constant value.  This is just
enough optimization to fix the "non-constant $meminit input" problem
without requiring a full opt_clean or a separate pass.
passes/opt/opt_expr.cc
tests/opt/opt_expr_constconn.v [new file with mode: 0644]
tests/opt/opt_expr_constconn.ys [new file with mode: 0644]