diff --git a/clash-cores/src/Clash/Cores/Sgmii/BitSlip.hs b/clash-cores/src/Clash/Cores/Sgmii/BitSlip.hs index 5ff78dcbd7..36f4a5cd87 100644 --- a/clash-cores/src/Clash/Cores/Sgmii/BitSlip.hs +++ b/clash-cores/src/Clash/Cores/Sgmii/BitSlip.hs @@ -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 @@ -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 @@ -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