diff options
author | Yann Herklotz <git@yannherklotz.com> | 2019-12-03 20:03:17 +0000 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2019-12-03 20:03:17 +0000 |
commit | d29813263852c866f20f88504860120820499411 (patch) | |
tree | 7f224cbfba855f3cd9c94911fcd863824de251fd /src/Verismith/Tool/Yosys.hs | |
parent | c59a9178c701f4a514b980d0b8d66a6bd238fb19 (diff) | |
download | verismith-d29813263852c866f20f88504860120820499411.tar.gz verismith-d29813263852c866f20f88504860120820499411.zip |
Do not run counter example if no rerunner is specified
Diffstat (limited to 'src/Verismith/Tool/Yosys.hs')
-rw-r--r-- | src/Verismith/Tool/Yosys.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Verismith/Tool/Yosys.hs b/src/Verismith/Tool/Yosys.hs index 67f8536..3507ac2 100644 --- a/src/Verismith/Tool/Yosys.hs +++ b/src/Verismith/Tool/Yosys.hs @@ -105,8 +105,8 @@ runEquivYosys yosys sim1 sim2 srcInfo = do where checkFile = S.fromText [st|test.#{toText sim1}.#{toText sim2}.ys|] runEquiv - :: (Synthesiser a, Synthesiser b) => FilePath -> a -> b -> SourceInfo -> ResultSh () -runEquiv datadir sim1 sim2 srcInfo = do + :: (Synthesiser a, Synthesiser b) => Maybe Text -> FilePath -> a -> b -> SourceInfo -> ResultSh () +runEquiv mt datadir sim1 sim2 srcInfo = do dir <- liftSh S.pwd liftSh $ do S.writefile "top.v" @@ -117,14 +117,16 @@ runEquiv datadir sim1 sim2 srcInfo = do ^. mainModule replaceMods (synthOutput sim1) "_1" srcInfo replaceMods (synthOutput sim2) "_2" srcInfo - S.writefile "proof.sby" $ sbyConfig datadir sim1 sim2 srcInfo + S.writefile "proof.sby" $ sbyConfig mt datadir sim1 sim2 srcInfo e <- liftSh $ do exe dir "symbiyosys" "sby" ["-f", "proof.sby"] S.lastExitCode case e of 0 -> ResultT . return $ Pass () - 2 -> ResultT $ Fail . EquivFail . fromRight mempty - . parseCounterEg <$> readfile "proof/engine_0/trace.smtc" + 2 -> case mt of + Nothing -> ResultT . return . Fail $ EquivFail Nothing + Just _ -> ResultT $ Fail . EquivFail . Just . fromRight mempty + . parseCounterEg <$> readfile "proof/engine_0/trace.smtc" 124 -> ResultT . return $ Fail TimeoutError _ -> ResultT . return $ Fail EquivError where |