diff options
author | Yann Herklotz <git@yannherklotz.com> | 2019-12-26 01:34:52 +0100 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2019-12-26 01:34:52 +0100 |
commit | ff5065834a9dc8fe8a2c30feb3fd7a327f8536f6 (patch) | |
tree | 9d223809ca349d9d58fbb3d5616aa095406f3f23 /src/Verismith/Fuzz.hs | |
parent | 37023ee30b7e3663c227dd56a6f4b4f0e004f7cb (diff) | |
download | verismith-ff5065834a9dc8fe8a2c30feb3fd7a327f8536f6.tar.gz verismith-ff5065834a9dc8fe8a2c30feb3fd7a327f8536f6.zip |
Add configuration for default Yosys location
Diffstat (limited to 'src/Verismith/Fuzz.hs')
-rw-r--r-- | src/Verismith/Fuzz.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Verismith/Fuzz.hs b/src/Verismith/Fuzz.hs index ff55011..50d6ae7 100644 --- a/src/Verismith/Fuzz.hs +++ b/src/Verismith/Fuzz.hs @@ -50,8 +50,8 @@ import Hedgehog.Internal.Seed (Seed) import qualified Hedgehog.Internal.Seed as Hog import qualified Hedgehog.Internal.Tree as Hog import Prelude hiding (FilePath) -import Shelly hiding (get) -import Shelly.Lifted (MonadSh, liftSh) +import Shelly hiding (get, sub) +import Shelly.Lifted (MonadSh, liftSh, sub) import System.FilePath.Posix (takeBaseName) import Verismith.Config import Verismith.CounterEg (CounterEg (..)) @@ -273,16 +273,17 @@ equivalence src = do datadir <- fmap _fuzzDataDir askOpts checker <- fmap _fuzzOptsChecker askOpts synth <- passedSynthesis + conf <- fmap _fuzzOptsConfig askOpts let synthComb = if doCrossCheck then nubBy tupEq . filter (uncurry (/=)) $ combinations synth synth else nubBy tupEq . filter (uncurry (/=)) $ (,) defaultIdentitySynth <$> synth - resTimes <- liftSh $ mapM (uncurry (equiv checker datadir)) synthComb + resTimes <- liftSh $ mapM (uncurry (equiv (conf ^. configProperty . propDefaultYosys) checker datadir)) synthComb fuzzSynthResults .= toSynthResult synthComb resTimes liftSh $ inspect resTimes where tupEq (a, b) (a', b') = (a == a' && b == b') || (a == b' && b == a') - equiv checker datadir a b = + equiv yosysloc checker datadir a b = toolRun ("equivalence check for " <> toText a <> " and " <> toText b) . runResultT $ do make dir @@ -297,7 +298,9 @@ equivalence src = do </> synthOutput b ) $ synthOutput b writefile "rtl.v" $ genSource src - runEquiv checker datadir a b src + sub $ do + maybe (return ()) (liftSh . prependToPath . fromText) yosysloc + runEquiv checker datadir a b src where dir = fromText $ "equiv_" <> toText a <> "_" <> toText b simulation :: (MonadIO m, MonadSh m) => SourceInfo -> Fuzz m () |