aboutsummaryrefslogtreecommitdiffstats
path: root/src/Verismith.hs
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-04-06 23:03:46 +0100
committerYann Herklotz <git@yannherklotz.com>2020-04-06 23:03:46 +0100
commit2b00c249a29236af734c1e5b717b859a2a54a5dc (patch)
tree070cf697a962f3b09e673b2fee9be541e3e90788 /src/Verismith.hs
parentd31472164e711a330e9f0a5b0a486b12abb69daf (diff)
parent472aedf5daeb1cb0d095a63eacf259b798f56586 (diff)
downloadverismith-2b00c249a29236af734c1e5b717b859a2a54a5dc.tar.gz
verismith-2b00c249a29236af734c1e5b717b859a2a54a5dc.zip
Merge branch 'develop' of github.com:ymherklotz/verismith into develop
Diffstat (limited to 'src/Verismith.hs')
-rw-r--r--src/Verismith.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Verismith.hs b/src/Verismith.hs
index 76ce303..3aa6d81 100644
--- a/src/Verismith.hs
+++ b/src/Verismith.hs
@@ -98,7 +98,7 @@ getConfig :: Maybe FilePath -> IO Config
getConfig s =
maybe (return defaultConfig) parseConfigFile $ T.unpack . toTextIgnore <$> s
-getGenerator :: Config -> Text -> Maybe FilePath -> IO (Gen SourceInfo)
+getGenerator :: Config -> Text -> Maybe FilePath -> IO (Gen (SourceInfo ann))
getGenerator config top s =
maybe (return $ proceduralSrc top config) (fmap return . parseSourceInfoFile top)
$ toTextIgnore <$> s
@@ -231,7 +231,7 @@ defaultMain = do
optsparsed <- execParser opts
handleOpts optsparsed
-makeSrcInfo :: ModDecl -> SourceInfo
+makeSrcInfo :: (ModDecl ann) -> (SourceInfo ann)
makeSrcInfo m = SourceInfo (getIdentifier $ m ^. modId) (Verilog [m])
-- | Draw a randomly generated DAG to a dot file and compile it to a png so it
@@ -280,7 +280,7 @@ onFailure t _ = do
chdir ".." $ cp_r (fromText t) $ fromText (t <> "_failed")
return $ Fail EmptyFail
-checkEquivalence :: SourceInfo -> Text -> IO Bool
+checkEquivalence :: (SourceInfo ann) -> Text -> IO Bool
checkEquivalence src dir = shellyFailDir $ do
mkdir_p (fromText dir)
curr <- toTextIgnore <$> pwd
@@ -330,6 +330,6 @@ runEquivalence seed gm t d k i = do
when (i < 5 && isNothing seed) (runEquivalence seed gm t d k $ i + 1)
where n = t <> "_" <> T.pack (show i)
-runReduce :: SourceInfo -> IO SourceInfo
+runReduce :: (SourceInfo ann) -> IO (SourceInfo ann)
runReduce s =
shelly $ reduce "reduce.v" (\s' -> not <$> liftIO (checkEquivalence s' "reduce")) s