Skip to content

Commit

Permalink
Add Connectable instance for connecting ReadOnly to WriteOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
darius-bluespec authored and quark17 committed Jan 24, 2025
1 parent 934465e commit 86236bf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Libraries/Base1/Connectable.bs
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,14 @@ instance Connectable Action Action
==> action
a1
a2

instance Connectable (ReadOnly a) (WriteOnly a) where
mkConnection :: (IsModule m c) => (ReadOnly a) -> (WriteOnly a) -> (m Empty)
mkConnection ro wo =
module
rules
{-# ASSERT fire when enabled #-}
{-# ASSERT no implicit conditions #-}
"write":
when True
==> wo._write(ro._read)

0 comments on commit 86236bf

Please sign in to comment.