mirror of https://github.com/zachjs/sv2v.git
fix looping simplification on unfolded based literals
This commit is contained in:
parent
b2b6f8f8f2
commit
1e6fa7b858
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
module top;
|
||||
initial $display("%b", (12'hb03 - 12'hb07) + 12'hb10);
|
||||
endmodule
|
||||
Loading…
Reference in New Issue