blarney-0.1.0.0
Copyright(c) Matthew Naylor 2019
(c) Alexandre Joannou 2019
LicenseMIT
Maintainermattfn@gmail.com
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageGHC2021

Blarney.Core.Common

Description

 
Synopsis

Documentation

tree1 :: (a -> a -> a) -> [a] -> a Source #

Parallel reduce for a commutative and associative operator. Input list must be non-empty.

treeM1 :: Monad m => (a -> a -> m a) -> [a] -> m a Source #

Monadic version of tree1

tree :: (a -> a -> a) -> a -> [a] -> a Source #

Like tree1, but input list may be empty, in which case the zero element is returned

orList :: Bits a => [a] -> a Source #

Tree of bitwise-or

andList :: Bits a => [a] -> a Source #

Tree of bitwise-and

sumList :: Num a => [a] -> a Source #

Adder tree

select :: Bits a => [(Bit 1, a)] -> a Source #

One-hot select

selectList :: Bits a => [(Bit 1, [a])] -> [a] Source #

Variant of select where right-hand-side is a list

listIndex :: (KnownNat n, Bits a) => Bit n -> [a] -> a Source #

Index a list

(?) :: Bits a => Bit 1 -> (a, a) -> a infixl 3 Source #

Ternary conditional operator (generic multiplexer)

(===) :: Bits a => a -> a -> Bit 1 infix 4 Source #

Generic equality

(=!=) :: Bits a => a -> a -> Bit 1 infix 4 Source #

Generic disequality

zero :: forall a. Bits a => a Source #

All 0's

ones :: forall a. Bits a => a Source #

All 1's

dontCare :: forall a. Bits a => a Source #

Don't care

delay :: Bits a => a -> a -> a Source #

Generic register

buffer :: Bits a => a -> a Source #

Generic register with don't care initialiser

old :: Bits a => a -> a Source #

Generic register with don't care initialiser

delayEn :: Bits a => a -> Bit 1 -> a -> a Source #

Generic register with enable

binaryEncode :: Bit (2 ^ n) -> Bit n Source #

One-hot to binary encoder

binaryDecode :: Bit n -> Bit (2 ^ n) Source #

Binary to one-hot decoder

firstHot :: KnownNat n => Bit n -> Bit n Source #

Isolate first hot bit in a bit vector

mergeWrites :: forall a. Bits a => MergeStrategy -> [(Bit 1, a)] -> a Source #

fairScheduler :: KnownNat n => (Bit n, Bit n) -> (Bit n, Bit n) Source #

Function for fair scheduling of n clients

var :: forall a. Bits a => String -> a Source #

Orphan instances

HasField "_0" (a, b) a # 
Instance details

Methods

getField :: (a, b) -> a #

HasField "_1" (a, b) b # 
Instance details

Methods

getField :: (a, b) -> b #

HasField "fst" (a, b) a # 
Instance details

Methods

getField :: (a, b) -> a #

HasField "snd" (a, b) b # 
Instance details

Methods

getField :: (a, b) -> b #

HasField "_0" (a, b, c) a # 
Instance details

Methods

getField :: (a, b, c) -> a #

HasField "_1" (a, b, c) b # 
Instance details

Methods

getField :: (a, b, c) -> b #

HasField "_2" (a, b, c) c # 
Instance details

Methods

getField :: (a, b, c) -> c #

HasField "_0" (a, b, c, d) a # 
Instance details

Methods

getField :: (a, b, c, d) -> a #

HasField "_1" (a, b, c, d) b # 
Instance details

Methods

getField :: (a, b, c, d) -> b #

HasField "_2" (a, b, c, d) c # 
Instance details

Methods

getField :: (a, b, c, d) -> c #

HasField "_3" (a, b, c, d) d # 
Instance details

Methods

getField :: (a, b, c, d) -> d #

Bits a => IfThenElse (Bit 1) a #

Overloaded if-then-else

Instance details

Methods

ifThenElse :: Bit 1 -> a -> a -> a Source #