@@ -20,42 +20,40 @@ data State = WaitForDeassert | WaitForAssert deriving (Generic, NFDataX)
2020-- | Transfer 1, 2, 3, ... to destination domain
2121srcFsm ::
2222 forall a src .
23- ( KnownDomain src
24- , Num a
23+ ( Num a
2524 , NFDataX a
2625 ) =>
2726 Clock src ->
2827 Signal src Bool ->
2928 Signal src (a , Bool )
30- srcFsm clk = mealy clk noReset enableGen go (0 , WaitForDeassert )
29+ srcFsm clk = mealy clk rst enableGen go (0 , WaitForDeassert )
3130 where
3231 go (n, WaitForDeassert ) True = ((n, WaitForDeassert ), (n, False ))
3332 go (n, WaitForDeassert ) False = ((n + 1 , WaitForAssert ), (n + 1 , True ))
3433 go (n, WaitForAssert ) False = ((n, WaitForAssert ), (n, True ))
3534 go (n, WaitForAssert ) True = ((n, WaitForDeassert ), (n, False ))
35+ rst = provideKnownDomainFrom clk noReset
3636{-# NOINLINE srcFsm #-}
3737
3838-- | Receives data from source domain
3939dstFsm ::
4040 forall a dst .
41- KnownDomain dst =>
4241 Clock dst ->
4342 Signal dst (Bool , a ) ->
4443 Signal dst (Bool , Maybe a )
45- dstFsm clk = mealy clk noReset enableGen go WaitForAssert
44+ dstFsm clk = mealy clk rst enableGen go WaitForAssert
4645 where
4746 go WaitForAssert (False , _) = (WaitForAssert , (False , Nothing ))
4847 go WaitForAssert (True , n) = (WaitForDeassert , (True , Just n))
4948 go WaitForDeassert (True , _) = (WaitForDeassert , (True , Nothing ))
5049 go WaitForDeassert (False , _) = (WaitForAssert , (False , Nothing ))
50+ rst = provideKnownDomainFrom clk noReset
5151{-# NOINLINE dstFsm #-}
5252
5353-- | Composition of 'srcFsm' and 'dstFsm'
5454top ::
5555 forall a srcStages dstStages src dst .
56- ( KnownDomain src
57- , KnownDomain dst
58- , Num a
56+ ( Num a
5957 , NFDataX a
6058 , BitPack a
6159 , 1 <= BitSize a , BitSize a <= 1024
0 commit comments