aboutsummaryrefslogtreecommitdiffstats
path: root/src/VeriFuzz/Reduce.hs
blob: 35eea4b361efd1d38a7aa1d1915c213682fa5828 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{-|
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

halve :: [a] -> ([a], [a])
halve l = splitAt (length l `div` 2) l

removeUninitWires :: [ModItem] -> [ModItem]
removeUninitWires ms = ms
    where ids = ms ^.. traverse . modContAssign . contAssignNetLVal

halveModDecl :: ModDecl -> (ModDecl, ModDecl)
halveModDecl m = (m & modItems %~ fst . halve, m & modItems %~ snd . halve)