aboutsummaryrefslogtreecommitdiffstats
path: root/app/Main.hs
blob: 321b5368742e95239b419c5457b3c6c121c6ee8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module Main where

import qualified Data.Graph.Inductive              as G
import qualified Data.GraphViz                     as Gviz
import qualified Data.GraphViz.Attributes.Complete as Gviz
import qualified Data.Text.IO                      as T
import qualified Data.Text.Lazy                    as T
import qualified Test.QuickCheck                   as QC
import           Test.VeriFuzz

instance Gviz.Labellable Gate where
  toLabelValue gate = Gviz.StrLabel . T.pack $ show gate

main :: IO ()
--main = sample (arbitrary :: Gen (Circuit Input))
main = do
  --gr <- genRandomDAG 100 :: IO (G.Gr Gate ())
--  _ <- runGraphviz (graphToDot quickParams $ emap (const "") gr) Png "output.png",
--  T.putStrLn $ generate gr
  g <- QC.generate (QC.arbitrary :: QC.Gen VerilogSrc)
  --render . genVerilogSrc . addTestBench . nestUpTo 20 . generateAST $ Circuit gr

  render . genVerilogSrc . addTestBench $ g