aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2019-06-02 12:55:19 +0100
committerYann Herklotz <git@yannherklotz.com>2019-06-02 12:55:19 +0100
commit58eb1aea52fb57666f2f4e620e3ac9a8dd05522c (patch)
tree96ad46284a27663d28e13298595f31531bfb68f1
parent12a74a1841ffb5842af029ffcce77c3e765e00f8 (diff)
downloadverismith-58eb1aea52fb57666f2f4e620e3ac9a8dd05522c.tar.gz
verismith-58eb1aea52fb57666f2f4e620e3ac9a8dd05522c.zip
Add XOR to the output
-rw-r--r--src/VeriFuzz/Verilog/Gen.hs2
-rw-r--r--src/VeriFuzz/Verilog/Mutate.hs3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/VeriFuzz/Verilog/Gen.hs b/src/VeriFuzz/Verilog/Gen.hs
index bc40de5..828224f 100644
--- a/src/VeriFuzz/Verilog/Gen.hs
+++ b/src/VeriFuzz/Verilog/Gen.hs
@@ -464,7 +464,7 @@ moduleDef top = do
^.. traverse
. portSize
let clock = Port Wire False 1 "clk"
- let yport = Port Wire False size "y"
+ let yport = Port Wire False 1 "y"
let comb = combineAssigns_ yport local
return
. declareMod local
diff --git a/src/VeriFuzz/Verilog/Mutate.hs b/src/VeriFuzz/Verilog/Mutate.hs
index 66f3c37..8af0182 100644
--- a/src/VeriFuzz/Verilog/Mutate.hs
+++ b/src/VeriFuzz/Verilog/Mutate.hs
@@ -377,13 +377,14 @@ removeId i = transform trans
combineAssigns :: Port -> [ModItem] -> [ModItem]
combineAssigns p a =
- a <> [ModCA . ContAssign (p ^. portName) . fold $ Id <$> assigns]
+ a <> [ModCA . ContAssign (p ^. portName) . UnOp UnXor . fold $ Id <$> assigns]
where assigns = a ^.. traverse . modContAssign . contAssignNetLVal
combineAssigns_ :: Port -> [Port] -> ModItem
combineAssigns_ p ps =
ModCA
. ContAssign (p ^. portName)
+ . UnOp UnXor
. fold
$ Id
<$> ps