aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2019-05-21 20:51:30 +0100
committerYann Herklotz <git@yannherklotz.com>2019-05-21 20:58:21 +0100
commitfca2988da194d41b04321ad46d7dd3b905613c15 (patch)
tree4f47ca03e2dedea9ff9f99bb45956ad8ddd5c96c
parente8915d759c1f6da2a1f3e8328708f40c2d203022 (diff)
downloadverismith-fca2988da194d41b04321ad46d7dd3b905613c15.tar.gz
verismith-fca2988da194d41b04321ad46d7dd3b905613c15.zip
Add choice for hat sampling in config
-rw-r--r--src/VeriFuzz/Config.hs20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/VeriFuzz/Config.hs b/src/VeriFuzz/Config.hs
index 9295f71..375c739 100644
--- a/src/VeriFuzz/Config.hs
+++ b/src/VeriFuzz/Config.hs
@@ -61,6 +61,8 @@ module VeriFuzz.Config
, probStmntNonBlock
, probStmntCond
, probStmntFor
+ , propSampleSize
+ , propSampleMethod
, propSize
, propSeed
, propStmntDepth
@@ -189,11 +191,13 @@ data Probability = Probability { _probModItem :: {-# UNPACK #-} !ProbModItem
}
deriving (Eq, Show)
-data ConfProperty = ConfProperty { _propSize :: {-# UNPACK #-} !Int
- , _propSeed :: !(Maybe Seed)
- , _propStmntDepth :: {-# UNPACK #-} !Int
- , _propModDepth :: {-# UNPACK #-} !Int
- , _propMaxModules :: {-# UNPACK #-} !Int
+data ConfProperty = ConfProperty { _propSize :: {-# UNPACK #-} !Int
+ , _propSeed :: !(Maybe Seed)
+ , _propStmntDepth :: {-# UNPACK #-} !Int
+ , _propModDepth :: {-# UNPACK #-} !Int
+ , _propMaxModules :: {-# UNPACK #-} !Int
+ , _propSampleMethod :: !Text
+ , _propSampleSize :: {-# UNPACK #-} !Int
}
deriving (Eq, Show)
@@ -261,7 +265,7 @@ defaultConfig :: Config
defaultConfig = Config
(Info (pack $(gitHash)) (pack $ showVersion version))
(Probability defModItem defStmnt defExpr)
- (ConfProperty 20 Nothing 3 2 5)
+ (ConfProperty 20 Nothing 3 2 5 "random" 10)
[]
[fromYosys defaultYosys, fromVivado defaultVivado]
where
@@ -374,6 +378,10 @@ propCodec =
.= _propModDepth
<*> defaultValue (defProp propMaxModules) (int "module" "max")
.= _propMaxModules
+ <*> defaultValue (defProp propSampleMethod) (Toml.text (twoKey "sample" "method"))
+ .= _propSampleMethod
+ <*> defaultValue (defProp propSampleSize) (int "sample" "size")
+ .= _propSampleSize
where defProp i = defaultConfig ^. configProperty . i
simulator :: TomlCodec SimDescription