fix looping simplification on unfolded based literals

This commit is contained in:
Zachary Snow 2021-07-22 12:45:53 -04:00
parent b2b6f8f8f2
commit 1e6fa7b858
2 changed files with 7 additions and 0 deletions

View File

@ -66,6 +66,10 @@ simplifyStep (Call (Ident "$clog2") (Args [Dec k] [])) =
clog2 :: Integer -> Integer
clog2 n = if n < 2 then 0 else clog2Help 1 n
-- TODO: add full constant evaluation for all number literals to avoid the
-- anti-loop hack below
simplifyStep e@(BinOp _ (BinOp _ Number{} Number{}) Number{}) = e
simplifyStep (BinOp op e1 e2) = simplifyBinOp op e1 e2
simplifyStep other = other

View File

@ -0,0 +1,3 @@
module top;
initial $display("%b", (12'hb03 - 12'hb07) + 12'hb10);
endmodule