diff --git a/clash-protocols/src/Protocols/Idle.hs b/clash-protocols/src/Protocols/Idle.hs index d1f20988..6f7e6114 100644 --- a/clash-protocols/src/Protocols/Idle.hs +++ b/clash-protocols/src/Protocols/Idle.hs @@ -9,6 +9,7 @@ module Protocols.Idle ( idleSink, ) where +import qualified Clash.Prelude as C import Data.Proxy import Protocols.Cpp (maxTupleSize) import Protocols.Internal @@ -18,6 +19,14 @@ instance (IdleCircuit a, IdleCircuit b) => IdleCircuit (a, b) where idleFwd _ = (idleFwd $ Proxy @a, idleFwd $ Proxy @b) idleBwd _ = (idleBwd $ Proxy @a, idleBwd $ Proxy @b) +instance (IdleCircuit a, C.KnownNat n) => IdleCircuit (C.Vec n a) where + idleFwd _ = C.repeat $ idleFwd $ Proxy @a + idleBwd _ = C.repeat $ idleBwd $ Proxy @a + +instance IdleCircuit () where + idleFwd _ = () + idleBwd _ = () + -- Derive instances for tuples up to maxTupleSize idleCircuitTupleInstances 3 maxTupleSize