diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2018-12-31 10:15:32 +0100 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2018-12-31 10:15:32 +0100 |
commit | 83f5512402a25cc011814f74c086e045bdcb9d1c (patch) | |
tree | 0a7e6cddb7b2ae1f24585955535c1f602d91e43a | |
parent | 038649c8f9495691d0b6938a8d4abc68ada22f5c (diff) | |
download | verismith-83f5512402a25cc011814f74c086e045bdcb9d1c.tar.gz verismith-83f5512402a25cc011814f74c086e045bdcb9d1c.zip |
Fix dot generation
-rw-r--r-- | app/Main.hs | 10 | ||||
-rw-r--r-- | verifuzz.cabal | 1 |
2 files changed, 7 insertions, 4 deletions
diff --git a/app/Main.hs b/app/Main.hs index 2154760..b79484a 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -2,9 +2,11 @@ module Main where import qualified Data.Graph.Inductive as G import qualified Data.Graph.Inductive.Arbitrary as G +import qualified Data.Graph.Inductive.Dot as G import qualified Data.Graph.Inductive.PatriciaTree as G import qualified Data.Text.IO as T import qualified Data.Text.Lazy as T +import Shelly import qualified Test.QuickCheck as QC import Test.VeriFuzz import qualified Test.VeriFuzz.Graph.RandomAlt as V @@ -12,11 +14,11 @@ import qualified Test.VeriFuzz.Graph.RandomAlt as V main :: IO () --main = sample (arbitrary :: Gen (Circuit Input)) main = do - gr <- QC.generate $ rDups <$> QC.resize 15 (randomDAG :: QC.Gen (G.Gr Gate ())) - -- let dot = Gviz.graphToDot Gviz.nonClusteredParams . G.emap (const "") $ gr - -- _ <- Gviz.runGraphviz dot Gviz.Png "output.png" + gr <- QC.generate $ rDups <$> QC.resize 30 (randomDAG :: QC.Gen (G.Gr Gate ())) + let dot = G.showDot . G.fglToDotString $ G.nemap (\x -> show x) (\_ -> "") gr + writeFile "file.dot" dot + shelly $ run_ "dot" ["-Tpng", "-o", "file.png", "file.dot"] -- T.putStrLn $ generate gr -- g <- QC.generate (QC.resize 5 (QC.arbitrary :: QC.Gen VerilogSrc)) render . genVerilogSrc . addTestBench . nestUpTo 5 . generateAST $ Circuit gr - -- render . genVerilogSrc . addTestBench $ g diff --git a/verifuzz.cabal b/verifuzz.cabal index 837a613..ca4ac0b 100644 --- a/verifuzz.cabal +++ b/verifuzz.cabal @@ -69,6 +69,7 @@ executable verifuzz , text , QuickCheck , bytestring + , shelly default-extensions: OverloadedStrings test-suite verifuzz-test |