aboutsummaryrefslogtreecommitdiffstats
path: root/src/VeriFuzz/Simulator.hs
blob: a84cd5f9eff727e312c27563ceabee2e3eb4fd9a (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{-|
Module      : VeriFuzz.Simulator
Description : Simulator module.
Copyright   : (c) 2018-2019, Yann Herklotz Grave
License     : BSD-3
Maintainer  : ymherklotz [at] gmail [dot] com
Stability   : experimental
Portability : POSIX

Simulator module.
-}

module VeriFuzz.Simulator
  ( SimMatrix
  , module VeriFuzz.Simulator.General
  , module VeriFuzz.Simulator.Yosys
  , module VeriFuzz.Simulator.Xst
  , module VeriFuzz.Simulator.Icarus
  )
where

import           Control.Monad.Trans.Reader
import           Prelude                    hiding (FilePath)
import           Shelly
import           VeriFuzz.Simulator.General
import           VeriFuzz.Simulator.Icarus
import           VeriFuzz.Simulator.Xst
import           VeriFuzz.Simulator.Yosys

-- | Environment used to run the main
data SimMatrix = SimMatrix { yosys  :: Yosys
                           , xst    :: Maybe Xst
                           , icarus :: Maybe Icarus
                           }

type SimEnv = ReaderT SimMatrix IO

runAll :: SimEnv ()
runAll = do
  val <- asks xst
  shelly $ run_ "echo" ["Hello World"]