From dbdea9bc47513b3643c981043c806647fdcf89b4 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Tue, 5 Nov 2019 10:17:31 +0000 Subject: Add reduction pass to remove constants from concat --- src/Verismith/OptParser.hs | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'src/Verismith/OptParser.hs') diff --git a/src/Verismith/OptParser.hs b/src/Verismith/OptParser.hs index 57ad2bd..2ccfe31 100644 --- a/src/Verismith/OptParser.hs +++ b/src/Verismith/OptParser.hs @@ -38,7 +38,10 @@ data Opts = Fuzz { fuzzOutput :: {-# UNPACK #-} !Text | Generate { generateFilename :: !(Maybe FilePath) , generateConfigFile :: !(Maybe FilePath) } - | Parse { parseFilename :: {-# UNPACK #-} !FilePath + | Parse { parseFilename :: {-# UNPACK #-} !FilePath + , parseTop :: {-# UNPACK #-} !Text + , parseOutput :: !(Maybe FilePath) + , parseRemoveConstInConcat :: !Bool } | Reduce { reduceFilename :: {-# UNPACK #-} !FilePath , reduceTop :: {-# UNPACK #-} !Text @@ -145,8 +148,24 @@ genOpts = ) parseOpts :: Parser Opts -parseOpts = Parse . fromText . T.pack <$> Opt.strArgument - (Opt.metavar "FILE" <> Opt.help "Verilog input file.") +parseOpts = Parse + <$> (fromText . T.pack <$> Opt.strArgument + (Opt.metavar "FILE" <> Opt.help "Verilog input file.")) + <*> textOption ( Opt.short 't' + <> Opt.long "top" + <> Opt.metavar "TOP" + <> Opt.help "Name of top level module." + <> Opt.showDefault + <> Opt.value "top" + ) + <*> ( Opt.optional + . Opt.strOption + $ Opt.long "output" + <> Opt.short 'o' + <> Opt.metavar "FILE" + <> Opt.help "Output file to write the parsed file to.") + <*> (Opt.switch $ Opt.long "remove-const-in-concat" <> Opt.help + "Remove constants in concatenation to simplify the Verilog.") reduceOpts :: Parser Opts reduceOpts = -- cgit