aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2018-12-31 10:15:32 +0100
committerYann Herklotz <ymherklotz@gmail.com>2018-12-31 10:15:32 +0100
commit83f5512402a25cc011814f74c086e045bdcb9d1c (patch)
tree0a7e6cddb7b2ae1f24585955535c1f602d91e43a /app
parent038649c8f9495691d0b6938a8d4abc68ada22f5c (diff)
downloadverismith-83f5512402a25cc011814f74c086e045bdcb9d1c.tar.gz
verismith-83f5512402a25cc011814f74c086e045bdcb9d1c.zip
Fix dot generation
Diffstat (limited to 'app')
-rw-r--r--app/Main.hs10
1 files changed, 6 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