verilog: fix sizing of constant args for tasks/functions
authorZachary Snow <zach@zachjs.com>
Sun, 21 Feb 2021 19:45:21 +0000 (14:45 -0500)
committerZachary Snow <zach@zachjs.com>
Sun, 21 Feb 2021 20:44:43 +0000 (15:44 -0500)
commitb6af90fe20bc92631061c48c328f3c6e4760e4df
tree9c8fb14f37ae5c4339fd550b7c8322e70c4cf940
parent127484e675538fbaeca1f6e53ba264a1f02e9cf6
verilog: fix sizing of constant args for tasks/functions

- Simplify synthetic localparams for normal calls to update their width
    - This step was inadvertently removed alongside `added_mod_children`
- Support redeclaration of constant function arguments
    - `eval_const_function` never correctly handled this, but the issue
      was not exposed in the existing tests until the recent change to
      always attempt constant function evaluation when all-const args
      are used
- Check asserts in const_arg_loop and const_func tests
- Add coverage for width mismatch error cases
12 files changed:
frontends/ast/ast.h
frontends/ast/simplify.cc
tests/various/const_arg_loop.sv [new file with mode: 0644]
tests/various/const_arg_loop.v [deleted file]
tests/various/const_arg_loop.ys
tests/various/const_func.sv [new file with mode: 0644]
tests/various/const_func.v [deleted file]
tests/various/const_func.ys
tests/verilog/func_arg_mismatch_1.ys [new file with mode: 0644]
tests/verilog/func_arg_mismatch_2.ys [new file with mode: 0644]
tests/verilog/func_arg_mismatch_3.ys [new file with mode: 0644]
tests/verilog/func_arg_mismatch_4.ys [new file with mode: 0644]