verilog: fix case expression sign and width handling
authorZachary Snow <zach@zachjs.com>
Thu, 25 Mar 2021 18:06:05 +0000 (14:06 -0400)
committerZachary Snow <zachary.j.snow@gmail.com>
Tue, 25 May 2021 20:16:46 +0000 (16:16 -0400)
commit0795b3ec076d8d2c0aa0d954b707271bd2f064bf
tree5b6c7eaef762a9dc76bb0507c76d0addcbdbb736
parent15f35d6754af619accdf63030e0a5ad3085cec16
verilog: fix case expression sign and width handling

- The case expression and case item expressions are extended to the
  maximum width among them, and are only interpreted as signed if all of
  them are signed
- Add overall width and sign detection for AST_CASE
- Add sign argument to genWidthRTLIL helper
- Coverage for both const and non-const case statements
frontends/ast/ast.h
frontends/ast/genrtlil.cc
frontends/ast/simplify.cc
tests/simple/case_expr_const.v [new file with mode: 0644]
tests/simple/case_expr_non_const.v [new file with mode: 0644]