Skip to content

Commit

Permalink
Use Signal dom () in Bwd (CSignal dom a) again
Browse files Browse the repository at this point in the history
Just a `()` means `dom` gets lost, which makes bundeling and unbundeling
impossible. This can make it very awkward to use `CSignal` in practise.
  • Loading branch information
martijnbastiaan committed Mar 13, 2024
1 parent db8f880 commit 968aa3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Protocols/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ instance C.KnownNat n => Protocol (C.Vec n a) where
-- XXX: Type families with Signals on LHS are currently broken on Clash:
instance Protocol (CSignal dom a) where
type Fwd (CSignal dom a) = Signal dom a
type Bwd (CSignal dom a) = ()
type Bwd (CSignal dom a) = Signal dom ()

-- | Left-to-right circuit composition.
--
Expand Down Expand Up @@ -257,7 +257,7 @@ instance (C.KnownNat n, Backpressure a) => Backpressure (C.Vec n a) where
boolsToBwd _ bs = C.repeat (boolsToBwd (Proxy @a) bs)

instance Backpressure (CSignal dom a) where
boolsToBwd _ _ = ()
boolsToBwd _ _ = pure ()

-- | Right-to-left circuit composition.
--
Expand Down
2 changes: 1 addition & 1 deletion src/Protocols/Wishbone/Standard.hs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ crossbarSwitch ::
crossbarSwitch = Circuit go
where
go ((route, bundle -> m2ss0), bundle -> s2ms0) =
(((), unbundle s2ms1), unbundle m2ss1)
((pure (), unbundle s2ms1), unbundle m2ss1)
where
m2ss1 = scatter @_ @_ @_ @_ @0 (repeat emptyWishboneM2S) <$> route <*> m2ss0
s2ms1 = gather <$> s2ms0 <*> route
Expand Down

0 comments on commit 968aa3e

Please sign in to comment.