Copyright | (C) 2013-2016, University of Twente |
---|---|
License | BSD2 (see the file LICENSE) |
Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com> |
Safe Haskell | Unsafe |
Language | Haskell2010 |
Extensions |
|
- data Clock = Clk Symbol Nat
- data SClock clk where
- data Signal' clk a = a :- (Signal' clk a)
- register# :: SClock clk -> a -> Signal' clk a -> Signal' clk a
- regEn# :: SClock clk -> a -> Signal' clk Bool -> Signal' clk a -> Signal' clk a
- mux :: Applicative f => f Bool -> f a -> f a -> f a
- signal :: Applicative f => a -> f a
- (.&&.) :: Applicative f => f Bool -> f Bool -> f Bool
- (.||.) :: Applicative f => f Bool -> f Bool -> f Bool
- not1 :: Functor f => f Bool -> f Bool
- simulate :: (Signal' clk1 a -> Signal' clk2 b) -> [a] -> [b]
- simulate_strict :: (NFData a, NFData b) => (Signal' clk1 a -> Signal' clk2 b) -> [a] -> [b]
- sample :: Foldable f => f a -> [a]
- sampleN :: Foldable f => Int -> f a -> [a]
- fromList :: [a] -> Signal' clk a
- sample_strict :: (Foldable f, NFData a) => f a -> [a]
- sampleN_strict :: (Foldable f, NFData a) => Int -> f a -> [a]
- fromList_strict :: NFData a => [a] -> Signal' clk a
- testFor :: Foldable f => Int -> f Bool -> Property
- (.==.) :: (Eq a, Applicative f) => f a -> f a -> f Bool
- (./=.) :: (Eq a, Applicative f) => f a -> f a -> f Bool
- compare1 :: (Ord a, Applicative f) => f a -> f a -> f Ordering
- (.<.) :: (Ord a, Applicative f) => f a -> f a -> f Bool
- (.<=.) :: (Ord a, Applicative f) => f a -> f a -> f Bool
- (.>=.) :: (Ord a, Applicative f) => f a -> f a -> f Bool
- (.>.) :: (Ord a, Applicative f) => f a -> f a -> f Bool
- mapSignal# :: (a -> b) -> Signal' clk a -> Signal' clk b
- signal# :: a -> Signal' clk a
- appSignal# :: Signal' clk (a -> b) -> Signal' clk a -> Signal' clk b
- foldr# :: (a -> b -> b) -> b -> Signal' clk a -> b
- traverse# :: Applicative f => (a -> f b) -> Signal' clk a -> f (Signal' clk b)
- fromEnum1 :: (Enum a, Functor f) => f a -> f Int
- toRational1 :: (Real a, Functor f) => f a -> f Rational
- toInteger1 :: (Integral a, Functor f) => f a -> f Integer
- testBit1 :: (Bits a, Applicative f) => f a -> f Int -> f Bool
- popCount1 :: (Bits a, Functor f) => f a -> f Int
- shift1 :: (Bits a, Applicative f) => f a -> f Int -> f a
- rotate1 :: (Bits a, Applicative f) => f a -> f Int -> f a
- setBit1 :: (Bits a, Applicative f) => f a -> f Int -> f a
- clearBit1 :: (Bits a, Applicative f) => f a -> f Int -> f a
- shiftL1 :: (Bits a, Applicative f) => f a -> f Int -> f a
- unsafeShiftL1 :: (Bits a, Applicative f) => f a -> f Int -> f a
- shiftR1 :: (Bits a, Applicative f) => f a -> f Int -> f a
- unsafeShiftR1 :: (Bits a, Applicative f) => f a -> f Int -> f a
- rotateL1 :: (Bits a, Applicative f) => f a -> f Int -> f a
- rotateR1 :: (Bits a, Applicative f) => f a -> f Int -> f a
- joinSignal# :: Signal' clk (Signal' clk a) -> Signal' clk a
Datatypes
Singleton value for a type-level Clock
with the given name
and period
A synchronized signal with samples of type a
, explicitly synchronized to
a clock clk
NB: The constructor, (
, is not synthesisable.:-
)
Functor (Signal' clk) Source | |
Applicative (Signal' clk) Source | |
Foldable (Signal' clk) Source | NB: Not synthesisable NB: In "
|
Traversable (Signal' clk) Source | |
Bounded a => Bounded (Signal' clk a) Source | |
Enum a => Enum (Signal' clk a) Source | |
Eq (Signal' clk a) Source | WARNING: ( |
Fractional a => Fractional (Signal' clk a) Source | |
Integral a => Integral (Signal' clk a) Source | WARNING: |
Num a => Num (Signal' clk a) Source | |
Ord a => Ord (Signal' clk a) Source | WARNING: |
(Num a, Ord a) => Real (Signal' clk a) Source | WARNING: |
Show a => Show (Signal' clk a) Source | |
Arbitrary a => Arbitrary (Signal' clk a) Source | |
CoArbitrary a => CoArbitrary (Signal' clk a) Source | |
Bits a => Bits (Signal' clk a) Source | WARNING: |
FiniteBits a => FiniteBits (Signal' clk a) Source | |
Default a => Default (Signal' clk a) Source | |
Lift a => Lift (Signal' clk a) Source | |
SaturatingNum a => SaturatingNum (Signal' clk a) Source | |
ExtendingNum a b => ExtendingNum (Signal' clk a) (Signal' clk b) Source | |
type AResult (Signal' clk a) (Signal' clk b) = Signal' clk (AResult a b) Source | |
type MResult (Signal' clk a) (Signal' clk b) = Signal' clk (MResult a b) Source |
Basic circuits
mux :: Applicative f => f Bool -> f a -> f a -> f a Source
signal :: Applicative f => a -> f a Source
Boolean connectives
Simulation functions (not synthesisable)
strict versions
simulate_strict :: (NFData a, NFData b) => (Signal' clk1 a -> Signal' clk2 b) -> [a] -> [b] Source
Deprecated: simulate
will be strict in CLaSH 1.0, and simulate_strict
will be removed
Version of simulate
that strictly evaluates the input elements and the
output elements
N.B: Exceptions are lazily rethrown
List <-> Signal conversion (not synthesisable)
fromList :: [a] -> Signal' clk a Source
Create a Signal
from a list
Every element in the list will correspond to a value of the signal for one clock cycle.
>>>
sampleN 2 (fromList [1,2,3,4,5])
[1,2]
NB: This function is not synthesisable
strict versions
sample_strict :: (Foldable f, NFData a) => f a -> [a] Source
Deprecated: sample
will be strict in CLaSH 1.0, and sample_strict
will be removed
Version of sample
that strictly evaluates the samples
N.B: Exceptions are lazily rethrown
sampleN_strict :: (Foldable f, NFData a) => Int -> f a -> [a] Source
Deprecated: sampleN
will be strict in CLaSH 1.0, and sampleN_strict
will be removed
Version of sampleN
that strictly evaluates the samples
N.B: Exceptions are lazily rethrown
fromList_strict :: NFData a => [a] -> Signal' clk a Source
Deprecated: fromList
will be strict in CLaSH 1.0, and fromList_strict
will be removed
Version of fromList
that strictly evaluates the elements of the list
N.B: Exceptions are lazily rethrown
QuickCheck combinators
Type classes
Eq
-like
(.==.) :: (Eq a, Applicative f) => f a -> f a -> f Bool infix 4 Source
(./=.) :: (Eq a, Applicative f) => f a -> f a -> f Bool infix 4 Source
Ord
-like
compare1 :: (Ord a, Applicative f) => f a -> f a -> f Ordering Source
(.<.) :: (Ord a, Applicative f) => f a -> f a -> f Bool infix 4 Source
(.<=.) :: (Ord a, Applicative f) => f a -> f a -> f Bool infix 4 Source
(.>=.) :: (Ord a, Applicative f) => f a -> f a -> f Bool infix 4 Source
(.>.) :: (Ord a, Applicative f) => f a -> f a -> f Bool infix 4 Source
Functor
mapSignal# :: (a -> b) -> Signal' clk a -> Signal' clk b Source
Applicative
appSignal# :: Signal' clk (a -> b) -> Signal' clk a -> Signal' clk b Source
Foldable
foldr# :: (a -> b -> b) -> b -> Signal' clk a -> b Source
NB: Not synthesisable
NB: In "
":foldr#
f z s
- The function
f
should be lazy in its second argument. - The
z
element will never be used.
Traversable
traverse# :: Applicative f => (a -> f b) -> Signal' clk a -> f (Signal' clk b) Source
Enum
-like
Rational
-like
toRational1 :: (Real a, Functor f) => f a -> f Rational Source
Integral
-like
toInteger1 :: (Integral a, Functor f) => f a -> f Integer Source
Bits
-like
shift1 :: (Bits a, Applicative f) => f a -> f Int -> f a Source
rotate1 :: (Bits a, Applicative f) => f a -> f Int -> f a Source
setBit1 :: (Bits a, Applicative f) => f a -> f Int -> f a Source
clearBit1 :: (Bits a, Applicative f) => f a -> f Int -> f a Source
shiftL1 :: (Bits a, Applicative f) => f a -> f Int -> f a Source
unsafeShiftL1 :: (Bits a, Applicative f) => f a -> f Int -> f a Source
shiftR1 :: (Bits a, Applicative f) => f a -> f Int -> f a Source
unsafeShiftR1 :: (Bits a, Applicative f) => f a -> f Int -> f a Source
rotateL1 :: (Bits a, Applicative f) => f a -> f Int -> f a Source
rotateR1 :: (Bits a, Applicative f) => f a -> f Int -> f a Source