verismith-1.1.0: Random verilog generation and simulator testing.
Copyright(c) 2018-2022 Yann Herklotz
LicenseGPL-3
Maintaineryann [at] yannherklotz [dot] com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Verismith

Description

 
Synopsis

Documentation

Types

data Opts Source #

Constructors

Fuzz 
EMIOpts 
Generate 
Parse 
Reduce 
ConfigOpt 
DistanceOpt 
ShuffleOpt 
Equiv 

data SourceInfo a Source #

Top level type which contains all the source code and associated information.

Constructors

SourceInfo 

Fields

Instances

Instances details
Functor SourceInfo Source # 
Instance details

Defined in Verismith.Verilog.AST

Methods

fmap :: (a -> b) -> SourceInfo a -> SourceInfo b #

(<$) :: a -> SourceInfo b -> SourceInfo a #

Annotations SourceInfo Source # 
Instance details

Defined in Verismith.Verilog.AST

Data a => Data (SourceInfo a) Source # 
Instance details

Defined in Verismith.Verilog.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourceInfo a -> c (SourceInfo a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (SourceInfo a) #

toConstr :: SourceInfo a -> Constr #

dataTypeOf :: SourceInfo a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (SourceInfo a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (SourceInfo a)) #

gmapT :: (forall b. Data b => b -> b) -> SourceInfo a -> SourceInfo a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourceInfo a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourceInfo a -> r #

gmapQ :: (forall d. Data d => d -> u) -> SourceInfo a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceInfo a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourceInfo a -> m (SourceInfo a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceInfo a -> m (SourceInfo a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceInfo a -> m (SourceInfo a) #

Monoid (SourceInfo a) Source # 
Instance details

Defined in Verismith.Verilog.AST

Semigroup (SourceInfo a) Source # 
Instance details

Defined in Verismith.Verilog.AST

Generic (SourceInfo a) Source # 
Instance details

Defined in Verismith.Verilog.AST

Associated Types

type Rep (SourceInfo a) 
Instance details

Defined in Verismith.Verilog.AST

type Rep (SourceInfo a) = D1 ('MetaData "SourceInfo" "Verismith.Verilog.AST" "verismith-1.1.0-FUTsgQc3KWmLTdTSx0Se1T" 'False) (C1 ('MetaCons "SourceInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "_infoTop") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "_infoSrc") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Verilog a))))

Methods

from :: SourceInfo a -> Rep (SourceInfo a) x #

to :: Rep (SourceInfo a) x -> SourceInfo a #

Show a => Show (SourceInfo a) Source # 
Instance details

Defined in Verismith.Verilog.AST

NFData a => NFData (SourceInfo a) Source # 
Instance details

Defined in Verismith.Verilog.AST

Methods

rnf :: SourceInfo a -> () #

Eq a => Eq (SourceInfo a) Source # 
Instance details

Defined in Verismith.Verilog.AST

Methods

(==) :: SourceInfo a -> SourceInfo a -> Bool #

(/=) :: SourceInfo a -> SourceInfo a -> Bool #

Ord a => Ord (SourceInfo a) Source # 
Instance details

Defined in Verismith.Verilog.AST

Show ann => Source (SourceInfo ann) Source # 
Instance details

Defined in Verismith.Verilog.CodeGen

Methods

genSource :: SourceInfo ann -> Text Source #

Distance (SourceInfo a) Source # 
Instance details

Defined in Verismith.Verilog.Distance

Mutate (SourceInfo ann) Source # 
Instance details

Defined in Verismith.Verilog.Mutate

Methods

mutExpr :: (Expr -> Expr) -> SourceInfo ann -> SourceInfo ann Source #

type Rep (SourceInfo a) Source # 
Instance details

Defined in Verismith.Verilog.AST

type Rep (SourceInfo a) = D1 ('MetaData "SourceInfo" "Verismith.Verilog.AST" "verismith-1.1.0-FUTsgQc3KWmLTdTSx0Se1T" 'False) (C1 ('MetaCons "SourceInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "_infoTop") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "_infoSrc") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Verilog a))))

Run functions

runEquivalence Source #

Arguments

:: Maybe Seed 
-> Gen (Verilog ())

Generator for the Verilog file.

-> Text

Name of the folder on each thread.

-> Text

Name of the general folder being used.

-> Bool

Keep flag.

-> Int

Used to track the recursion.

-> IO () 

Run a fuzz run and check if all of the simulators passed by checking if the generated Verilog files are equivalent.

runSimulation :: IO () Source #

Run a simulation on a random DAG or a random module.

draw :: IO () Source #

Draw a randomly generated DAG to a dot file and compile it to a png so it can be seen.

Verilog generation functions

procedural :: Text -> Config -> Gen (Verilog ann) Source #

Procedural generation method for random Verilog. Uses internal Reader and State to keep track of the current Verilog code structure.

proceduralIO :: Text -> Config -> IO (Verilog a) Source #

Samples the Gen directly to generate random Verilog using the Text as the name of the main module and the configuration Config to influence the generation.

proceduralSrc :: Text -> Config -> Gen (SourceInfo ann) Source #

Given a Text and a Config will generate a '(SourceInfo ann)' which has the top module set to the right name.

proceduralSrcIO :: Text -> Config -> IO (SourceInfo ann) Source #

Sampled and wrapped into a '(SourceInfo ann)' with the given top module name.

randomMod :: MonadGen m => Int -> Int -> m (ModDecl ann) Source #

Extra modules