aboutsummaryrefslogtreecommitdiffstats
path: root/src/Verismith.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Verismith.hs')
-rw-r--r--src/Verismith.hs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Verismith.hs b/src/Verismith.hs
index 45977fe..19237ae 100644
--- a/src/Verismith.hs
+++ b/src/Verismith.hs
@@ -148,12 +148,19 @@ handleOpts (Generate f c) = do
$ T.unpack
. toTextIgnore
<$> f
-handleOpts (Parse f) = do
+handleOpts (Parse f t o rc) = do
verilogSrc <- T.readFile file
case parseVerilog (T.pack file) verilogSrc of
Left l -> print l
- Right v -> print $ GenVerilog v
- where file = T.unpack . toTextIgnore $ f
+ Right v ->
+ case (o, GenVerilog
+ . mapply rc (takeReplace . removeConstInConcat)
+ $ SourceInfo t v) of
+ (Nothing, a) -> print a
+ (Just o', a) -> writeFile (T.unpack $ toTextIgnore o') $ show a
+ where
+ file = T.unpack . toTextIgnore $ f
+ mapply i f = if i then f else id
handleOpts (Reduce f t _ ls' False) = do
src <- parseSourceInfoFile t (toTextIgnore f)
datadir <- getDataDir