diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2019-02-08 15:48:19 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2019-02-08 15:48:19 +0000 |
commit | f6b7e771fd8e7bb89a3981886c93603363dd9ed2 (patch) | |
tree | a9022646668a243324386b76911c3bc3c8d981c9 /src/VeriFuzz | |
parent | e58c77ee12be243d487b1dccbee9c457dbbe0a20 (diff) | |
download | verismith-f6b7e771fd8e7bb89a3981886c93603363dd9ed2.tar.gz verismith-f6b7e771fd8e7bb89a3981886c93603363dd9ed2.zip |
Add Reduce which will contain the test reduction
Diffstat (limited to 'src/VeriFuzz')
-rw-r--r-- | src/VeriFuzz/Reduce.hs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/VeriFuzz/Reduce.hs b/src/VeriFuzz/Reduce.hs new file mode 100644 index 0000000..4900a67 --- /dev/null +++ b/src/VeriFuzz/Reduce.hs @@ -0,0 +1,29 @@ +{-| +Module : VeriFuzz.Reduce +Description : Test case reducer implementation. +Copyright : (c) 2019, Yann Herklotz Grave +License : GPL-3 +Maintainer : ymherklotz [at] gmail [dot] com +Stability : experimental +Portability : POSIX + +Test case reducer implementation. +-} + +module VeriFuzz.Reduce where + +import Control.Lens +import VeriFuzz.AST +import VeriFuzz.Mutate + +halve :: [a] -> ([a], [a]) +halve l = splitAt (length l `div` 2) l + +removeUninitWires :: [ModItem] -> [ModItem] +removeUninitWires ms = transformOf traverseModItem trans <$> ms + where + ids = ms ^.. traverse . modContAssign . contAssignNetLVal + +halveModDecl :: ModDecl -> (ModDecl, ModDecl) +halveModDecl m = + (m & modItems %~ fst . halve, m & modItems %~ snd . halve) |