error on size cast with non-integer size

This commit is contained in:
Zachary Snow 2021-07-09 10:25:18 -04:00
parent 1f03c64e9f
commit 789afd1bb2
2 changed files with 6 additions and 1 deletions

View File

@ -181,7 +181,8 @@ castFnName size signed =
Number n ->
case numberToInteger n of
Just v -> show v
_ -> shortHash size
_ -> error $ "size cast width " ++ show n
++ " is not an integer"
_ -> shortHash size
suffix = if signed then "_signed" else ""

View File

@ -0,0 +1,4 @@
// pattern: size cast width 1'bx is not an integer
module top;
initial $display((1'bx)'(2));
endmodule