Skip to content

Commit

Permalink
Explicitly export functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jvnknvlgl committed Jul 24, 2024
1 parent 558d747 commit d740caf
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 13 deletions.
7 changes: 6 additions & 1 deletion clash-cores/src/Clash/Cores/Sgmii.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@
-- basis and they are always transmitted to @TXD@, this port should only be
-- read when @RX_DV@ is asserted as invalid data might be provided when it is
-- not.
module Clash.Cores.Sgmii where
module Clash.Cores.Sgmii (
sgmii,
sgmiiRA,
sgmiiRx,
sgmiiTx,
) where

import Clash.Cores.LineCoding8b10b
import Clash.Cores.Sgmii.AutoNeg
Expand Down
8 changes: 7 additions & 1 deletion clash-cores/src/Clash/Cores/Sgmii/AutoNeg.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
-- Maintainer : QBayLogic B.V. <devops@qbaylogic.com>
--
-- Auto-negotiation process, as defined in IEEE 802.3 Figure 37-6
module Clash.Cores.Sgmii.AutoNeg where
module Clash.Cores.Sgmii.AutoNeg (
AutoNegState (..),
Timeout,
autoNeg,
autoNegO,
autoNegT,
) where

import Clash.Cores.Sgmii.Common
import Clash.Prelude
Expand Down
11 changes: 6 additions & 5 deletions clash-cores/src/Clash/Cores/Sgmii/BitSlip.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
--
-- Bit slip function that word-aligns a stream of bits based on received
-- comma values
module Clash.Cores.Sgmii.BitSlip where
module Clash.Cores.Sgmii.BitSlip (
BitSlipState (..),
bitSlip,
bitSlipO,
bitSlipT,
) where

import Clash.Cores.Sgmii.Common
import Clash.Prelude
Expand All @@ -28,10 +33,6 @@ data BitSlipState
| BSOk {_s :: BitVector 20, _n :: Index 10}
deriving (Generic, NFDataX, Eq, Show)

-- | Reverse the bits of a 'BitVector'
reverseBV :: (KnownNat n) => BitVector n -> BitVector n
reverseBV = v2bv . reverse . bv2v

-- | State transition function for 'bitSlip', where the initial state is the
-- training state, and after 8 consecutive commas have been detected at the
-- same index in the status register it moves into the 'BSOk' state where the
Expand Down
4 changes: 4 additions & 0 deletions clash-cores/src/Clash/Cores/Sgmii/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ orNothing :: Bool -> a -> Maybe a
orNothing True a = Just a
orNothing False _ = Nothing

-- | Reverse the bits of a 'BitVector'
reverseBV :: (KnownNat n) => BitVector n -> BitVector n
reverseBV = v2bv . reverse . bv2v

-- | Code group that corresponds to K28.5 with negative disparity
cgK28_5N :: Cg
cgK28_5N = 0b0101111100
Expand Down
7 changes: 6 additions & 1 deletion clash-cores/src/Clash/Cores/Sgmii/PcsReceive.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
-- Maintainer : QBayLogic B.V. <devops@qbaylogic.com>
--
-- PCS receive process, as defined in IEEE 802.3 Figure 36-7a and 36-7b
module Clash.Cores.Sgmii.PcsReceive where
module Clash.Cores.Sgmii.PcsReceive (
PcsReceiveState (..),
pcsReceive,
pcsReceiveO,
pcsReceiveT,
) where

import Clash.Cores.LineCoding8b10b
import Clash.Cores.Sgmii.Common
Expand Down
2 changes: 1 addition & 1 deletion clash-cores/src/Clash/Cores/Sgmii/PcsTransmit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
--
-- 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 where
module Clash.Cores.Sgmii.PcsTransmit (pcsTransmit) where

import Clash.Cores.Sgmii.Common
import Clash.Cores.Sgmii.PcsTransmit.CodeGroup
Expand Down
6 changes: 5 additions & 1 deletion clash-cores/src/Clash/Cores/Sgmii/PcsTransmit/CodeGroup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
--
-- Code group process of the PCS transmit block, as defined in IEEE 802.3
-- Figure 36-6
module Clash.Cores.Sgmii.PcsTransmit.CodeGroup where
module Clash.Cores.Sgmii.PcsTransmit.CodeGroup (
CodeGroupState (..),
codeGroupO,
codeGroupT,
) where

import Clash.Cores.LineCoding8b10b
import Clash.Cores.Sgmii.Common
Expand Down
5 changes: 4 additions & 1 deletion clash-cores/src/Clash/Cores/Sgmii/PcsTransmit/OrderedSet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
--
-- Ordered set process of the PCS transmit block, as defined in IEEE 802.3
-- Figure 36-5
module Clash.Cores.Sgmii.PcsTransmit.OrderedSet where
module Clash.Cores.Sgmii.PcsTransmit.OrderedSet (
OrderedSetState (..),
orderedSetT,
) where

import Clash.Cores.Sgmii.Common
import Clash.Prelude
Expand Down
5 changes: 4 additions & 1 deletion clash-cores/src/Clash/Cores/Sgmii/RateAdapt.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
--
-- Functions for the rate adaptation blocks that are required for lower bit
-- rates than 1000 Mbps
module Clash.Cores.Sgmii.RateAdapt where
module Clash.Cores.Sgmii.RateAdapt (
rateAdaptRx,
rateAdaptTx,
) where

import Clash.Cores.Sgmii.Common
import Clash.Prelude
Expand Down
9 changes: 8 additions & 1 deletion clash-cores/src/Clash/Cores/Sgmii/Sync.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@
-- Maintainer : QBayLogic B.V. <devops@qbaylogic.com>
--
-- Synchronization process, as defined in IEEE 802.3 Figure 36-9
module Clash.Cores.Sgmii.Sync where
module Clash.Cores.Sgmii.Sync (
SyncState (..),
outputQueueO,
outputQueueT,
sync,
syncO,
syncT,
) where

import Clash.Cores.LineCoding8b10b
import Clash.Cores.Sgmii.Common
Expand Down

0 comments on commit d740caf

Please sign in to comment.