-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
write_aig: Normalize symmetry in multiplication
This bumps the `aig` submodule to bring in the changes from GaloisInc/aig#14, which changes how `aig` performs multiplication to swap the order of arguments if the first argument is a constant. This is because the algorithm that `mul` uses to compute multiplication is biased in its order of arguments, and having the second argument be a constant produces a network with more full adders, which is generally more beneficial. I have added a test case to check to see if the test case from #1828 now produces identical AIGs regardless of the order of arguments. Fixes #1828.
- Loading branch information
1 parent
9d66afc
commit c0bf31e
Showing
4 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
left.aig | ||
right.aig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
write_aig "left.aig" {{ \x -> x * 0x12345678 }}; | ||
write_aig "right.aig" {{ \x -> 0x12345678 * x }}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
set -e | ||
|
||
# This test case uses `write_aiger` to produce AIG files for two nearly | ||
# identical functions, where the only difference is the order of arguments (one | ||
# symbolic and one concrete) in a bitvector multiplication. If the `aig` library | ||
# does its job correctly, these should produce identical AIG files, so check | ||
# this using `diff`. | ||
$SAW test.saw | ||
diff -ru left.aig right.aig |