verismith-0.6.0.1: Random verilog generation and simulator testing.

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

Verismith.Verilog.BitVec

Description

Unsigned BitVec implementation.

Synopsis

Documentation

data BitVecF a Source #

Bit Vector that stores the bits in an arbitrary container together with the size.

Constructors

BitVec 

Fields

Instances
Functor BitVecF Source # 
Instance details

Defined in Verismith.Verilog.BitVec

Methods

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

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

Foldable BitVecF Source # 
Instance details

Defined in Verismith.Verilog.BitVec

Methods

fold :: Monoid m => BitVecF m -> m #

foldMap :: Monoid m => (a -> m) -> BitVecF a -> m #

foldr :: (a -> b -> b) -> b -> BitVecF a -> b #

foldr' :: (a -> b -> b) -> b -> BitVecF a -> b #

foldl :: (b -> a -> b) -> b -> BitVecF a -> b #

foldl' :: (b -> a -> b) -> b -> BitVecF a -> b #

foldr1 :: (a -> a -> a) -> BitVecF a -> a #

foldl1 :: (a -> a -> a) -> BitVecF a -> a #

toList :: BitVecF a -> [a] #

null :: BitVecF a -> Bool #

length :: BitVecF a -> Int #

elem :: Eq a => a -> BitVecF a -> Bool #

maximum :: Ord a => BitVecF a -> a #

minimum :: Ord a => BitVecF a -> a #

sum :: Num a => BitVecF a -> a #

product :: Num a => BitVecF a -> a #

Traversable BitVecF Source # 
Instance details

Defined in Verismith.Verilog.BitVec

Methods

traverse :: Applicative f => (a -> f b) -> BitVecF a -> f (BitVecF b) #

sequenceA :: Applicative f => BitVecF (f a) -> f (BitVecF a) #

mapM :: Monad m => (a -> m b) -> BitVecF a -> m (BitVecF b) #

sequence :: Monad m => BitVecF (m a) -> m (BitVecF a) #

Enum a => Enum (BitVecF a) Source # 
Instance details

Defined in Verismith.Verilog.BitVec

Methods

succ :: BitVecF a -> BitVecF a #

pred :: BitVecF a -> BitVecF a #

toEnum :: Int -> BitVecF a #

fromEnum :: BitVecF a -> Int #

enumFrom :: BitVecF a -> [BitVecF a] #

enumFromThen :: BitVecF a -> BitVecF a -> [BitVecF a] #

enumFromTo :: BitVecF a -> BitVecF a -> [BitVecF a] #

enumFromThenTo :: BitVecF a -> BitVecF a -> BitVecF a -> [BitVecF a] #

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

Defined in Verismith.Verilog.BitVec

Methods

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

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

(Integral a, Bits a) => Integral (BitVecF a) Source # 
Instance details

Defined in Verismith.Verilog.BitVec

Methods

quot :: BitVecF a -> BitVecF a -> BitVecF a #

rem :: BitVecF a -> BitVecF a -> BitVecF a #

div :: BitVecF a -> BitVecF a -> BitVecF a #

mod :: BitVecF a -> BitVecF a -> BitVecF a #

quotRem :: BitVecF a -> BitVecF a -> (BitVecF a, BitVecF a) #

divMod :: BitVecF a -> BitVecF a -> (BitVecF a, BitVecF a) #

toInteger :: BitVecF a -> Integer #

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

Defined in Verismith.Verilog.BitVec

Methods

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

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

toConstr :: BitVecF a -> Constr #

dataTypeOf :: BitVecF a -> DataType #

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

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

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

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

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

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

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

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

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

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

(Num a, Bits a) => Num (BitVecF a) Source # 
Instance details

Defined in Verismith.Verilog.BitVec

Methods

(+) :: BitVecF a -> BitVecF a -> BitVecF a #

(-) :: BitVecF a -> BitVecF a -> BitVecF a #

(*) :: BitVecF a -> BitVecF a -> BitVecF a #

negate :: BitVecF a -> BitVecF a #

abs :: BitVecF a -> BitVecF a #

signum :: BitVecF a -> BitVecF a #

fromInteger :: Integer -> BitVecF a #

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

Defined in Verismith.Verilog.BitVec

Methods

compare :: BitVecF a -> BitVecF a -> Ordering #

(<) :: BitVecF a -> BitVecF a -> Bool #

(<=) :: BitVecF a -> BitVecF a -> Bool #

(>) :: BitVecF a -> BitVecF a -> Bool #

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

max :: BitVecF a -> BitVecF a -> BitVecF a #

min :: BitVecF a -> BitVecF a -> BitVecF a #

(Integral a, Bits a) => Real (BitVecF a) Source # 
Instance details

Defined in Verismith.Verilog.BitVec

Methods

toRational :: BitVecF a -> Rational #

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

Defined in Verismith.Verilog.BitVec

Methods

showsPrec :: Int -> BitVecF a -> ShowS #

show :: BitVecF a -> String #

showList :: [BitVecF a] -> ShowS #

Generic (BitVecF a) Source # 
Instance details

Defined in Verismith.Verilog.BitVec

Associated Types

type Rep (BitVecF a) :: Type -> Type #

Methods

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

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

Bits a => Semigroup (BitVecF a) Source # 
Instance details

Defined in Verismith.Verilog.BitVec

Methods

(<>) :: BitVecF a -> BitVecF a -> BitVecF a #

sconcat :: NonEmpty (BitVecF a) -> BitVecF a #

stimes :: Integral b => b -> BitVecF a -> BitVecF a #

Bits a => Monoid (BitVecF a) Source # 
Instance details

Defined in Verismith.Verilog.BitVec

Methods

mempty :: BitVecF a #

mappend :: BitVecF a -> BitVecF a -> BitVecF a #

mconcat :: [BitVecF a] -> BitVecF a #

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

Defined in Verismith.Verilog.BitVec

Methods

rnf :: BitVecF a -> () #

(Num a, Bits a) => Bits (BitVecF a) Source # 
Instance details

Defined in Verismith.Verilog.BitVec

(Num a, Bits a) => FiniteBits (BitVecF a) Source # 
Instance details

Defined in Verismith.Verilog.BitVec

type Rep (BitVecF a) Source # 
Instance details

Defined in Verismith.Verilog.BitVec

type Rep (BitVecF a) = D1 (MetaData "BitVecF" "Verismith.Verilog.BitVec" "verismith-0.6.0.1-inplace" False) (C1 (MetaCons "BitVec" PrefixI True) (S1 (MetaSel (Just "width") SourceUnpack SourceStrict DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "value") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a)))

type BitVec = BitVecF Integer Source #

Specialisation of the above with Integer, so that infinitely large bit vectors can be stored.

bitVec :: (Num a, Bits a) => Int -> a -> BitVecF a Source #

BitVecF construction, given width and value.

select :: (Integral a, Bits a, Integral b, Bits b) => BitVecF a -> (BitVecF b, BitVecF b) -> BitVecF a Source #

Bit selection. LSB is 0.