aboutsummaryrefslogtreecommitdiffstats
path: root/app/Main.hs
blob: b79484a2ee2cb0989c2af7c57ab74705136660f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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

main :: IO ()
 --main = sample (arbitrary :: Gen (Circuit Input))
main = do
  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