diff --git a/examples/FIR.hs b/examples/FIR.hs index facc061219..5a44b3b2d8 100644 --- a/examples/FIR.hs +++ b/examples/FIR.hs @@ -3,10 +3,10 @@ module FIR where import CLaSH.Prelude dotp :: SaturatingNum a - => Vec n a - -> Vec n a + => Vec (n + 1) a + -> Vec (n + 1) a -> a -dotp as bs = foldl boundedPlus 0 (zipWith boundedMult as bs) +dotp as bs = fold boundedPlus (zipWith boundedMult as bs) fir :: (Default a, KnownNat n, SaturatingNum a) => Vec (n + 1) (Signal a) -> Signal a -> Signal a @@ -16,10 +16,10 @@ fir coeffs x_t = y_t xs = window x_t topEntity :: Signal (Signed 16) -> Signal (Signed 16) -topEntity = fir $(v [2::Signal (Signed 16),3,-2,8]) +topEntity = fir (2:>3:>(-2):>8:>Nil) testInput :: Signal (Signed 16) -testInput = stimuliGenerator $(v [2::Signed 16,3,-2,8]) +testInput = stimuliGenerator (2:>3:>(-2):>8:>Nil) expectedOutput :: Signal (Signed 16) -> Signal Bool -expectedOutput = outputVerifier $(v [4::Signed 16,12,1,20]) +expectedOutput = outputVerifier (4:>12:>1:>20:>Nil)