aboutsummaryrefslogtreecommitdiffstats
path: root/src/VeriFuzz/Config.hs
diff options
context:
space:
mode:
authorYann Herklotz <git@ymhg.org>2019-05-06 18:59:08 +0100
committerYann Herklotz <git@ymhg.org>2019-05-06 18:59:08 +0100
commit1e4798b9bfe090ac68c2edd036637b6bfac5c06b (patch)
tree680f75c00e9e6ee7f49560a8f4509b74b08730ed /src/VeriFuzz/Config.hs
parent4cdbcd7570009187954afe0c0308fa1eb4460c55 (diff)
downloadverismith-1e4798b9bfe090ac68c2edd036637b6bfac5c06b.tar.gz
verismith-1e4798b9bfe090ac68c2edd036637b6bfac5c06b.zip
Support multiple reg assigns in if statements
Diffstat (limited to 'src/VeriFuzz/Config.hs')
-rw-r--r--src/VeriFuzz/Config.hs50
1 files changed, 35 insertions, 15 deletions
diff --git a/src/VeriFuzz/Config.hs b/src/VeriFuzz/Config.hs
index fa06e46..6c0d058 100644
--- a/src/VeriFuzz/Config.hs
+++ b/src/VeriFuzz/Config.hs
@@ -74,14 +74,13 @@ module VeriFuzz.Config
)
where
-import Control.Applicative (Alternative, (<|>))
+import Control.Applicative (Alternative)
import Control.Lens hiding ((.=))
import Data.List.NonEmpty (NonEmpty (..))
import Data.Maybe (fromMaybe)
import Data.Text (Text)
import qualified Data.Text.IO as T
import Hedgehog.Internal.Seed (Seed)
-import qualified Hedgehog.Internal.Seed as Seed
import Toml (TomlCodec, (.=))
import qualified Toml
@@ -129,25 +128,26 @@ import qualified Toml
-- >>> T.putStrLn $ encodeConfig defaultConfig
-- <BLANKLINE>
-- [probability]
--- eventlist.all = 1
+-- eventlist.all = 0
-- eventlist.clk = 1
-- eventlist.var = 1
--- expr.binary = 1
--- expr.concatenation = 1
+-- expr.binary = 5
+-- expr.concatenation = 3
-- expr.number = 1
--- expr.signed = 1
+-- expr.rangeselect = 5
+-- expr.signed = 5
-- expr.string = 0
--- expr.ternary = 1
--- expr.unary = 1
--- expr.unsigned = 1
--- expr.variable = 1
+-- expr.ternary = 5
+-- expr.unary = 5
+-- expr.unsigned = 5
+-- expr.variable = 5
-- moditem.always = 1
-- moditem.assign = 5
-- moditem.instantiation = 1
-- statement.blocking = 0
-- statement.conditional = 1
-- statement.forloop = 1
--- statement.nonblocking = 15
+-- statement.nonblocking = 3
-- <BLANKLINE>
-- [property]
-- module.depth = 2
@@ -268,10 +268,30 @@ defaultConfig = Config
[]
[SynthDescription "yosys", SynthDescription "vivado"]
where
- defModItem = ProbModItem 5 1 1
- defStmnt = ProbStatement 0 15 1 1
- defExpr = ProbExpr 1 1 1 1 1 1 1 0 1 1
- defEvent = ProbEventList 1 1 1
+ defModItem =
+ ProbModItem 5 -- Assign
+ 1 -- Always
+ 1 -- Instantiation
+ defStmnt =
+ ProbStatement 0 -- Blocking assignment
+ 3 -- Non-blocking assignment
+ 1 -- Conditional
+ 1 -- For loop
+ defExpr =
+ ProbExpr 1 -- Number
+ 5 -- Identifier
+ 5 -- Range selection
+ 5 -- Unary operator
+ 5 -- Binary operator
+ 5 -- Ternary conditional
+ 3 -- Concatenation
+ 0 -- String
+ 5 -- Signed function
+ 5 -- Unsigned funtion
+ defEvent =
+ ProbEventList 0 -- All
+ 1 -- Clk
+ 0 -- Var
twoKey :: Toml.Piece -> Toml.Piece -> Toml.Key
twoKey a b = Toml.Key (a :| [b])