Safe Haskell | None |
---|---|
Language | Haskell2010 |
- (<^>) :: (Pack i, Pack o) => (s -> i -> (s, o)) -> s -> SignalP i -> SignalP o
- registerP :: Pack a => a -> SignalP a -> SignalP a
- newtype Comp a b = C {
- asFunction :: Signal a -> Signal b
- registerC :: a -> Comp a a
- simulateC :: Comp a b -> [a] -> [b]
- (^^^) :: (s -> i -> (s, o)) -> s -> Comp i o
- blockRam :: forall n m a. (KnownNat n, KnownNat m, Pack a) => SNat n -> Signal (Unsigned m) -> Signal (Unsigned m) -> Signal Bool -> Signal a -> Signal a
- blockRamPow2 :: (KnownNat n, KnownNat (2 ^ n), Pack a) => SNat (2 ^ n :: Nat) -> Signal (Unsigned n) -> Signal (Unsigned n) -> Signal Bool -> Signal a -> Signal a
- window :: (KnownNat (n + 1), Default a) => Signal a -> Vec ((n + 1) + 1) (Signal a)
- windowD :: (KnownNat (n + 1), Default a) => Signal a -> Vec (n + 1) (Signal a)
Documentation
:: (Pack i, Pack o) | |
=> (s -> i -> (s, o)) | Transfer function in mealy machine form |
-> s | Initial state |
-> SignalP i -> SignalP o | Synchronous function with input and output matching that of the mealy machine |
Create a synchronous function from a combinational function describing a mealy machine
mac s (x,y) = (s',s) where s' = x * y + s topEntity :: (Signal Int, Signal Int) -> Signal Int topEntity = mac <^> 0 simulateP topEntity [(1,1),(2,2),(3,3),(4,4),... = [0,1,5,14,30,...
registerP :: Pack a => a -> SignalP a -> SignalP a Source
Create a register
function for product-type like signals (e.g. '(Signal a, Signal b)')
rP :: (Signal Int,Signal Int) -> (Signal Int, Signal Int) rP = registerP (8,8) simulateP rP [(1,1),(2,2),(3,3),... = [(8,8),(1,1),(2,2),(3,3),...
Arrow
interface to synchronous functions
C | |
|
simulateC :: Comp a b -> [a] -> [b] Source
Simulate a Comp
onent given a list of samples
simulateC (registerC 8) [1, 2, 3, ... = [8, 1, 2, 3, ...
(^^^) :: (s -> i -> (s, o)) -> s -> Comp i o Source
Create a synchronous Comp
onent from a combinational function describing
a mealy machine
mac s (x,y) = (s',s) where s' = x * y + s topEntity :: Comp (Int,Int) Int topEntity = mac ^^^ 0 simulateC topEntity [(1,1),(2,2),(3,3),(4,4),... = [0,1,5,14,30,...
:: forall n m a . (KnownNat n, KnownNat m, Pack a) | |
=> SNat n | Size |
-> Signal (Unsigned m) | Write address |
-> Signal (Unsigned m) | Read address |
-> Signal Bool | Write enable |
-> Signal a | Value to write (at address |
-> Signal a | Value of the |
Create a blockRAM with space for n
elements
bram40 :: Signal (Unsigned 6) -> Signal (Unsigned 6) -> Signal Bool -> Signal a -> Signal a bram40 = blockRam d50
:: (KnownNat n, KnownNat (2 ^ n), Pack a) | |
=> SNat (2 ^ n :: Nat) | Size 2^ |
-> Signal (Unsigned n) | Write address |
-> Signal (Unsigned n) | Read address |
-> Signal Bool | Write enable |
-> Signal a | Value to write (at address |
-> Signal a | Value of the |
Create a blockRAM with space for 2^n
elements
bram32 :: Signal (Unsigned 5) -> Signal (Unsigned 5) -> Signal Bool -> Signal a -> Signal a bram32 = blockRamPow2 d32