Skip to content

Commit bcb0b4b

Browse files
committed
Bump clash-compiler hash
1 parent 7cf7fc4 commit bcb0b4b

4 files changed

Lines changed: 8 additions & 40 deletions

File tree

bittide/src/Bittide/ClockControl/Topology/LinkMasks.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type MaskConstraints nNodes nLinks =
2828

2929
linkMasks ::
3030
forall nNodes nLinks.
31-
(MaskConstraints nNodes nLinks) =>
31+
(MaskConstraints nNodes nLinks, NumConvert (Index nNodes) Int) =>
3232
Vec nNodes (Vec nLinks (Index nNodes)) ->
3333
Topology ->
3434
Vec nNodes (BitVector nLinks)
@@ -44,7 +44,7 @@ linkMasks setup topology
4444

4545
-- | Determines whether a link is active for a given FPGA and topology.
4646
isActiveLink ::
47-
(MaskConstraints nNodes nLinks) =>
47+
(MaskConstraints nNodes nLinks, NumConvert (Index nNodes) Int) =>
4848
Vec nNodes (Vec nLinks (Index nNodes)) ->
4949
Topology ->
5050
Index nNodes ->
@@ -86,7 +86,7 @@ setup =
8686
-}
8787
linkMask ::
8888
forall nNodes nLinks.
89-
(MaskConstraints nNodes nLinks) =>
89+
(MaskConstraints nNodes nLinks, NumConvert (Index nNodes) Int) =>
9090
Vec nNodes (Vec nLinks (Index nNodes)) ->
9191
Topology ->
9292
Index nNodes ->

bittide/src/Bittide/DoubleBufferedRam.hs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -515,23 +515,3 @@ splitWriteInBytes (Just (addr, writeData)) byteSelect =
515515
case getRegsBe writeData of
516516
RegisterBank vec -> orNothing <$> unpack byteSelect <*> fmap (addr,) vec
517517
splitWriteInBytes Nothing _ = repeat Nothing
518-
519-
{- | Takes an address and write operation and 'bitCoerce's the addresses as follows:
520-
'bitCoerce' (address, bool)
521-
-}
522-
updateAddrs ::
523-
(KnownNat n, 1 <= n, KnownNat m, 1 <= m) =>
524-
-- | An address.
525-
Index n ->
526-
-- | A write operation.
527-
Maybe (Index m, b) ->
528-
-- | A boolean that will be used for the addresses LSBs.
529-
AorB ->
530-
-- |
531-
-- 1. Updated address
532-
-- 2. Write operation with updated address.
533-
(Index (n * 2), Maybe (Index (m * 2), b))
534-
updateAddrs rdAddr (Just (i, a)) bufSelect =
535-
(mul2Index rdAddr bufSelect, Just (mul2Index i (swapAorB bufSelect), a))
536-
updateAddrs rdAddr Nothing bufSelect =
537-
(mul2Index rdAddr bufSelect, Nothing)

bittide/src/Bittide/SharedTypes.hs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import Clash.Prelude
1515
import Clash.Class.BitPackC (ByteOrder (..), Bytes)
1616
import Data.Constraint
1717
import Data.Constraint.Nat.Lemmas
18-
import Data.Type.Equality ((:~:) (Refl))
1918
import Protocols (ToConstBwd)
2019
import Protocols.MemoryMap (Mm)
2120
import Protocols.Wishbone
@@ -154,24 +153,13 @@ getDataLe (RegisterBank (reverse -> vec)) =
154153
case timesDivRU @bw @(BitSize a) of
155154
Dict -> unpack . snd $ split @_ @(Pad a bw) @(BitSize a) (pack vec)
156155

157-
{- | Coerces a tuple of index n and a boolean to index (n*2) where the LSB of the result
158-
is determined by the boolean.
159-
-}
160-
mul2Index ::
161-
forall n b.
162-
(KnownNat n, 1 <= n, BitPack b, BitSize b ~ 1) =>
163-
Index n ->
164-
b ->
165-
Index (n * 2)
166-
mul2Index n b = case clogProductRule @n of Refl -> bitCoerce (n, b)
167-
168156
-- | Coerces an index of size (n*2) to index n with the LSB as separate boolean.
169157
div2Index ::
170-
forall n b.
171-
(KnownNat n, 1 <= n, BitPack b, BitSize b ~ 1) =>
158+
forall n.
159+
(KnownNat n, 1 <= n) =>
172160
Index (n * 2) ->
173-
(Index n, b)
174-
div2Index = case clogProductRule @n of Refl -> bitCoerce
161+
(Index n, Bool)
162+
div2Index idx = (resize (idx `shiftR` 1), lsb idx == 1)
175163

176164
-- | Delays the output controls to align them with the actual read / write timing.
177165
delayControls ::

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs: $ncpus
4343
source-repository-package
4444
type: git
4545
location: https://github.com/clash-lang/clash-compiler.git
46-
tag: 5ec337c04139f74dd706db77ccb25f92ad5dc3dc
46+
tag: 83e906547b38a3d8bdeaf5ec839507f3478812fb
4747
subdir:
4848
clash-prelude
4949
clash-ghc

0 commit comments

Comments
 (0)