verismith-0.4.0.1: Random verilog generation and simulator testing.

Copyright(c) 2019 Yann Herklotz
LicenseGPL-3
Maintaineryann [at] yannherklotz [dot] com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Verismith.Config

Contents

Description

TOML Configuration file format and parser.

Synopsis

TOML Configuration

Verismith supports a TOML configuration file that can be passed using the -c flag or using the parseConfig and encodeConfig functions. The configuration can then be manipulated using the lenses that are also provided in this module.

The configuration file can be used to tweak the random Verilog generation by passing different probabilities to each of the syntax nodes in the AST. It can also be used to specify which simulators to fuzz with which options. A seed for the run can also be set, to replay a previous run using the same exact generation. A default value is associated with each key in the configuration file, which means that only the options that need overriding can be added to the configuration. The defaults can be observed in defaultConfig or when running verismith config.

Configuration Sections

There are four main configuration sections in the TOML file:

probability
The probability section defines the probabilities at every node in the AST.
property
Controls different properties of the generation, such as adding a seed or the depth of the statements.
simulator
This is an array of tables containing descriptions of the different simulators that should be used. It currently only supports Icarus Verilog.
synthesiser
This is also an array of tables containing descriptions of the different synthesisers that should be used. The synthesisers that are currently supported are:

data Config Source #

Instances
Eq Config Source # 
Instance details

Defined in Verismith.Config

Methods

(==) :: Config -> Config -> Bool #

(/=) :: Config -> Config -> Bool #

Show Config Source # 
Instance details

Defined in Verismith.Config

Probabilities

Expression

data ProbExpr Source #

Probability of different expressions nodes.

Constructors

ProbExpr 

Fields

  • _probExprNum :: !Int

    Probability of generation a number like 4'ha. This should never be set to 0, as it is used as a fallback in case there are no viable identifiers, such as none being in scope.

  • _probExprId :: !Int

    Probability of generating an identifier that is in scope and of the right type.

  • _probExprRangeSelect :: !Int

    Probability of generating a range selection from a port.

  • _probExprUnOp :: !Int

    Probability of generating a unary operator.

  • _probExprBinOp :: !Int

    Probability of generation a binary operator.

  • _probExprCond :: !Int

    probability of generating a conditional ternary operator.

  • _probExprConcat :: !Int

    Probability of generating a concatenation.

  • _probExprStr :: !Int

    Probability of generating a string. This is not fully supported therefore currently cannot be set.

  • _probExprSigned :: !Int

    Probability of generating a signed function $signed(...).

  • _probExprUnsigned :: !Int

    Probability of generating an unsigned function $unsigned(...).

Instances
Eq ProbExpr Source # 
Instance details

Defined in Verismith.Config

Show ProbExpr Source # 
Instance details

Defined in Verismith.Config

Module Item

data ProbModItem Source #

Probability of generating different nodes inside a module declaration.

Constructors

ProbModItem 

Fields

Instances
Eq ProbModItem Source # 
Instance details

Defined in Verismith.Config

Show ProbModItem Source # 
Instance details

Defined in Verismith.Config

Statement

ConfProperty

data ConfProperty Source #

Constructors

ConfProperty 

Fields

Instances
Eq ConfProperty Source # 
Instance details

Defined in Verismith.Config

Show ConfProperty Source # 
Instance details

Defined in Verismith.Config

Simulator Description

Synthesiser Description

Useful Lenses