Skip to content

Commit

Permalink
Revert "Test simplification of BitSlip"
Browse files Browse the repository at this point in the history
This reverts commit de0cd58.
  • Loading branch information
jvnknvlgl committed Jul 8, 2024
1 parent 4f0aae0 commit 246b717
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions clash-cores/src/Clash/Cores/Sgmii/BitSlip.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ bitSlipT BSFail{..} (cg, _)
| ns == repeat (fromJust n) = BSOk s (fromJust n) 0
| otherwise = BSFail s ns hist
where
s = resize $ _s ++# cg
s = resize $ _s ++# (v2bv . reverse . bv2v) cg
ns = maybe _ns (_ns <<+) n
hist = map pack $ take d10 $ windows1d d7 $ bv2v s

Expand All @@ -67,7 +67,7 @@ bitSlipT BSOk{..} (cg, syncStatus)
| failTimer >= timeout (Proxy @dom) = BSFail s (repeat 0) (repeat 0)
| otherwise = BSOk s _n failTimer
where
s = resize $ _s ++# cg
s = resize $ _s ++# (v2bv . reverse . bv2v) cg
failTimer = if syncStatus == Fail then _failTimer + 1 else 0

-- | Output function for 'bitSlip' that takes the calculated index value and
Expand All @@ -80,10 +80,10 @@ bitSlipO ::
(BitSlipState dom, BitVector 10, Bool)
bitSlipO self@BSFail{..} = (self, o, False)
where
o = resize $ rotateR _s 10
o = (v2bv . reverse . bv2v) $ resize $ rotateR _s 10
bitSlipO self@BSOk{..} = (self, o, True)
where
o = resize $ rotateR _s (13 - fromEnum _n)
o = (v2bv . reverse . bv2v) $ resize $ rotateR _s (10 - fromEnum _n)

-- | Function that takes a code word and returns the same code word, but if a
-- comma is detected the code words is shifted such that the comma is at the
Expand Down

0 comments on commit 246b717

Please sign in to comment.