From 44a250b5d5828146f13fecdb5bfdfcb2d5ecca78 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Mon, 28 Oct 2019 10:59:12 +0000 Subject: Add --no-reduction --- src/Verismith.hs | 5 +++-- src/Verismith/OptParser.hs | 38 +++++++++++++++++--------------------- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/Verismith.hs b/src/Verismith.hs index bde3e2a..6a2bc72 100644 --- a/src/Verismith.hs +++ b/src/Verismith.hs @@ -122,10 +122,11 @@ randomise config@(Config a _ c d e) = do ce = config ^. configProbability . probExpr handleOpts :: Opts -> IO () -handleOpts (Fuzz o configF f k n nosim noequiv) = do +handleOpts (Fuzz o configF f k n nosim noequiv noreduction) = do config <- getConfig configF _ <- runFuzz - (FuzzOpts (Just $ fromText o) f k n nosim noequiv config) + (FuzzOpts (Just $ fromText o) + f k n nosim noequiv noreduction config) defaultYosys (fuzzMultiple (proceduralSrc "top" config)) return () diff --git a/src/Verismith/OptParser.hs b/src/Verismith/OptParser.hs index 1db0d52..a475e9a 100644 --- a/src/Verismith/OptParser.hs +++ b/src/Verismith/OptParser.hs @@ -24,13 +24,14 @@ instance Show OptTool where show TXST = "xst" show TIcarus = "icarus" -data Opts = Fuzz { fuzzOutput :: {-# UNPACK #-} !Text - , fuzzConfigFile :: !(Maybe FilePath) - , fuzzForced :: !Bool - , fuzzKeepAll :: !Bool - , fuzzNum :: {-# UNPACK #-} !Int - , fuzzNoSim :: !Bool - , fuzzNoEquiv :: !Bool +data Opts = Fuzz { fuzzOutput :: {-# UNPACK #-} !Text + , fuzzConfigFile :: !(Maybe FilePath) + , fuzzForced :: !Bool + , fuzzKeepAll :: !Bool + , fuzzNum :: {-# UNPACK #-} !Int + , fuzzNoSim :: !Bool + , fuzzNoEquiv :: !Bool + , fuzzNoReduction :: !Bool } | Generate { generateFilename :: !(Maybe FilePath) , generateConfigFile :: !(Maybe FilePath) @@ -85,35 +86,30 @@ fuzzOpts = <> Opt.metavar "DIR" <> Opt.help "Output directory that the fuzz run takes place in." <> Opt.showDefault - <> Opt.value "output" - ) + <> Opt.value "output") <*> ( Opt.optional . Opt.strOption $ Opt.long "config" <> Opt.short 'c' <> Opt.metavar "FILE" - <> Opt.help "Config file for the current fuzz run." - ) + <> Opt.help "Config file for the current fuzz run.") <*> (Opt.switch $ Opt.long "force" <> Opt.short 'f' <> Opt.help - "Overwrite the specified directory." - ) + "Overwrite the specified directory.") <*> (Opt.switch $ Opt.long "keep" <> Opt.short 'k' <> Opt.help - "Keep all the directories." - ) + "Keep all the directories.") <*> ( Opt.option Opt.auto $ Opt.long "num" <> Opt.short 'n' <> Opt.help "The number of fuzz runs that should be performed." <> Opt.showDefault <> Opt.value 1 - <> Opt.metavar "INT" - ) + <> Opt.metavar "INT") <*> (Opt.switch $ Opt.long "no-sim" <> Opt.help - "Do not run simulation on the output netlist." - ) + "Do not run simulation on the output netlist.") <*> (Opt.switch $ Opt.long "no-equiv" <> Opt.help - "Do not run an equivalence check on the output netlist." - ) + "Do not run an equivalence check on the output netlist.") + <*> (Opt.switch $ Opt.long "no-reduction" <> Opt.help + "Do not run reduction on a failed testcase.") genOpts :: Parser Opts genOpts = -- cgit