Skip to content

Commit

Permalink
Add input queue to PcsTransmit
Browse files Browse the repository at this point in the history
  • Loading branch information
jvnknvlgl committed Jan 29, 2025
1 parent 91ce8b2 commit 2b7b1f9
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/Clash/Cores/Sgmii/PcsTransmit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,31 @@
Top level module for the PCS transmit block, that combines the processes
that are defined in the two submodules @CodeGroup@ and @OrderedSet@.
-}
module Clash.Cores.Sgmii.PcsTransmit (pcsTransmit) where
module Clash.Cores.Sgmii.PcsTransmit
( inputQueueT
, inputQueueO
, pcsTransmit
)
where

import Clash.Cores.Sgmii.Common
import Clash.Cores.Sgmii.PcsTransmit.CodeGroup
import Clash.Cores.Sgmii.PcsTransmit.OrderedSet
import Clash.Prelude

type InputQueue = Vec 2 (BitVector 8)

inputQueueT ::
InputQueue ->
BitVector 8 ->
InputQueue
inputQueueT s i = s <<+ i

inputQueueO ::
InputQueue ->
BitVector 8
inputQueueO = head

-- | Takes the signals that are defined in IEEE 802.3 Clause 36 and runs them
-- through the state machines as defined for the PCS transmit block. These are
-- implemented in 'codeGroupT', 'codeGroupO' and 'orderedSetT'.
Expand All @@ -39,12 +57,14 @@ pcsTransmit txEn txEr dw xmit txConfReg = cg
codeGroupT
codeGroupO
(IdleDisparityOk False 0 0)
(txOSet, dw, txConfReg)
(txOSet, dw', txConfReg)

(_, txOSet) =
mealyB
orderedSetT
(IdleS Idle False)
(txEn, txEr, dw, xmit, txEven, txInd)

dw' = mooreB inputQueueT inputQueueO (repeat 0) dw

{-# CLASH_OPAQUE pcsTransmit #-}

0 comments on commit 2b7b1f9

Please sign in to comment.