Commit 487685e0 by Zachary Snow

remove ternary operators from wildcard conversion

parent 5d02b918
...@@ -31,18 +31,18 @@ convert = ...@@ -31,18 +31,18 @@ convert =
convertExpr :: Expr -> Expr convertExpr :: Expr -> Expr
convertExpr (BinOp WEq l r) = convertExpr (BinOp WEq l r) =
Mux noteq (Number "1'b0") $ BinOp BitAnd couldMatch $
Mux badxs (Number "1'bx") BinOp BitOr noExtraXZs $
(Number "1'b1") Number "1'bx"
where where
lxl = BinOp BitXor l l lxl = BinOp BitXor l l
rxr = BinOp BitXor r r rxr = BinOp BitXor r r
-- Step #1: definitive mismatch -- Step #1: definitive mismatch
noteq = BinOp TNe rxlxl lxrxr couldMatch = BinOp TEq rxlxl lxrxr
rxlxl = BinOp BitXor r lxl rxlxl = BinOp BitXor r lxl
lxrxr = BinOp BitXor l rxr lxrxr = BinOp BitXor l rxr
-- Step #2: extra X or Z -- Step #2: extra X or Z
badxs = BinOp TNe lxlxrxr rxr noExtraXZs = BinOp TEq lxlxrxr rxr
lxlxrxr = BinOp BitXor lxl rxr lxlxrxr = BinOp BitXor lxl rxr
convertExpr (BinOp WNe l r) = convertExpr (BinOp WNe l r) =
UniOp LogNot $ UniOp LogNot $
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment