verilog: refactored constant function evaluation
authorZachary Snow <zach@zachjs.com>
Wed, 27 Jan 2021 18:21:13 +0000 (13:21 -0500)
committerZachary Snow <zach@zachjs.com>
Thu, 4 Feb 2021 15:18:27 +0000 (10:18 -0500)
commitb93b6f4285243ebbb43ad95769dc2890b6e1e7ab
treef5d807a7d07dfa1d046daa340a1544c1ce39ce7a
parentbaf1875307f1608762169d3037ba005da88b201e
verilog: refactored constant function evaluation

Elaboration now attempts constant evaluation of any function call with
only constant arguments, regardless of the context or contents of the
function. This removes the concept of "recommended constant evaluation"
which previously applied to functions with `for` loops or which were
(sometimes erroneously) identified as recursive. Any function call in a
constant context (e.g., `localparam`) or which contains a constant-only
procedural construct (`while` or `repeat`) in its body will fail as
before if constant evaluation does not succeed.
frontends/ast/ast.h
frontends/ast/simplify.cc
tests/simple/const_fold_func.v [new file with mode: 0644]
tests/simple/const_func_shadow.v [new file with mode: 0644]