diff options
author | Yann Herklotz <git@ymhg.org> | 2019-05-09 23:18:10 +0100 |
---|---|---|
committer | Yann Herklotz <git@ymhg.org> | 2019-05-09 23:18:10 +0100 |
commit | 77702d5492ba19b6e3e0dda9e9460a8bb67a8e3f (patch) | |
tree | 1fb623c5b94aab30c7ab74d34942390827cb0a5d /src/VeriFuzz/Config.hs | |
parent | 76ce30d979686307babe8ebb6269072338f24910 (diff) | |
download | verismith-77702d5492ba19b6e3e0dda9e9460a8bb67a8e3f.tar.gz verismith-77702d5492ba19b6e3e0dda9e9460a8bb67a8e3f.zip |
Add new pretty printer with indentation
Diffstat (limited to 'src/VeriFuzz/Config.hs')
-rw-r--r-- | src/VeriFuzz/Config.hs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/VeriFuzz/Config.hs b/src/VeriFuzz/Config.hs index 46cc721..1ce7b11 100644 --- a/src/VeriFuzz/Config.hs +++ b/src/VeriFuzz/Config.hs @@ -25,8 +25,8 @@ module VeriFuzz.Config , ProbModItem(..) -- *** Statement , ProbStatement(..) - -- ** Property - , Property(..) + -- ** ConfProperty + , ConfProperty(..) -- ** Simulator Description , SimDescription(..) -- ** Synthesiser Description @@ -189,11 +189,11 @@ data Probability = Probability { _probModItem :: {-# UNPACK #-} !ProbModItem } deriving (Eq, Show) -data Property = Property { _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 } deriving (Eq, Show) @@ -214,7 +214,7 @@ data SynthDescription = SynthDescription { synthName :: {-# UNPACK #-} !Text data Config = Config { _configInfo :: Info , _configProbability :: {-# UNPACK #-} !Probability - , _configProperty :: {-# UNPACK #-} !Property + , _configProperty :: {-# UNPACK #-} !ConfProperty , _configSimulators :: [SimDescription] , _configSynthesisers :: [SynthDescription] } @@ -224,7 +224,7 @@ $(makeLenses ''ProbExpr) $(makeLenses ''ProbModItem) $(makeLenses ''ProbStatement) $(makeLenses ''Probability) -$(makeLenses ''Property) +$(makeLenses ''ConfProperty) $(makeLenses ''Info) $(makeLenses ''Config) @@ -270,7 +270,7 @@ fromQuartus (Quartus a b c) = defaultConfig :: Config defaultConfig = Config (Info (pack $(gitHash)) (pack $ showVersion version)) (Probability defModItem defStmnt defExpr) - (Property 20 Nothing 3 2 5) + (ConfProperty 20 Nothing 3 2 5) [] [fromYosys defaultYosys, fromVivado defaultVivado] where @@ -370,9 +370,9 @@ probCodec = .= _probExpr where defProb i = defaultConfig ^. configProbability . i -propCodec :: TomlCodec Property +propCodec :: TomlCodec ConfProperty propCodec = - Property + ConfProperty <$> defaultValue (defProp propSize) (Toml.int "size") .= _propSize <*> Toml.dioptional (Toml.read "seed") |