aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/Main.hs10
-rw-r--r--verifuzz.cabal1
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