diff options
Diffstat (limited to 'src/Verismith/OptParser.hs')
-rw-r--r-- | src/Verismith/OptParser.hs | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/Verismith/OptParser.hs b/src/Verismith/OptParser.hs index c2b31fe..1692985 100644 --- a/src/Verismith/OptParser.hs +++ b/src/Verismith/OptParser.hs @@ -46,6 +46,16 @@ data Opts fuzzCrossCheck :: !Bool, fuzzChecker :: !(Maybe Text) } + | EMIOpts + { emiOutput :: Text, + emiConfigFile :: !(Maybe FilePath), + emiForced :: !Bool, + emiKeepAll :: !Bool, + emiNum :: {-# UNPACK #-} !Int, + emiNoSim :: !Bool, + emiNoEquiv :: !Bool, + emiNoReduction :: !Bool + } | Generate { generateFilename :: !(Maybe FilePath), generateConfigFile :: !(Maybe FilePath) @@ -182,6 +192,58 @@ fuzzOpts = <> Opt.help "Define the checker to use." ) +emiOpts :: Parser Opts +emiOpts = + EMIOpts + <$> textOption + ( Opt.long "output" + <> Opt.short 'o' + <> Opt.metavar "DIR" + <> Opt.help "Output directory that the fuzz run takes place in." + <> Opt.showDefault + <> 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.switch $ + Opt.long "force" <> Opt.short 'f' + <> Opt.help + "Overwrite the specified directory." + ) + <*> ( Opt.switch $ + Opt.long "keep" <> Opt.short 'k' + <> Opt.help + "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.switch $ + Opt.long "no-sim" + <> Opt.help + "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." + ) + <*> ( Opt.switch $ + Opt.long "no-reduction" + <> Opt.help + "Do not run reduction on a failed testcase." + ) + genOpts :: Parser Opts genOpts = Generate @@ -313,6 +375,17 @@ argparse = <> Opt.metavar "fuzz" ) <|> Opt.hsubparser + ( Opt.command + "emi" + ( Opt.info + emiOpts + ( Opt.progDesc + "EMI testing using generated inputs, or existing Verilog designs." + ) + ) + <> Opt.metavar "emi" + ) + <|> Opt.hsubparser ( Opt.command "generate" ( Opt.info |