mirror of https://github.com/zachjs/sv2v.git
remove ternary operators from wildcard conversion
This commit is contained in:
parent
5d02b918c3
commit
487685e0f0
|
|
@ -31,18 +31,18 @@ convert =
|
|||
|
||||
convertExpr :: Expr -> Expr
|
||||
convertExpr (BinOp WEq l r) =
|
||||
Mux noteq (Number "1'b0") $
|
||||
Mux badxs (Number "1'bx")
|
||||
(Number "1'b1")
|
||||
BinOp BitAnd couldMatch $
|
||||
BinOp BitOr noExtraXZs $
|
||||
Number "1'bx"
|
||||
where
|
||||
lxl = BinOp BitXor l l
|
||||
rxr = BinOp BitXor r r
|
||||
-- Step #1: definitive mismatch
|
||||
noteq = BinOp TNe rxlxl lxrxr
|
||||
couldMatch = BinOp TEq rxlxl lxrxr
|
||||
rxlxl = BinOp BitXor r lxl
|
||||
lxrxr = BinOp BitXor l rxr
|
||||
-- Step #2: extra X or Z
|
||||
badxs = BinOp TNe lxlxrxr rxr
|
||||
noExtraXZs = BinOp TEq lxlxrxr rxr
|
||||
lxlxrxr = BinOp BitXor lxl rxr
|
||||
convertExpr (BinOp WNe l r) =
|
||||
UniOp LogNot $
|
||||
|
|
|
|||
Loading…
Reference in New Issue