From 3bb42752f82fc94120ef8bae20b24c0f743a7555 Mon Sep 17 00:00:00 2001 From: Jasper Vinkenvleugel Date: Fri, 21 Jun 2024 10:22:45 +0200 Subject: [PATCH] Move Sgmii dependency out of EbTb tests --- clash-cores/clash-cores.cabal | 1 - clash-cores/test/Test/Cores/Sgmii/BitSlip.hs | 2 +- clash-cores/test/Test/Cores/Sgmii/Common.hs | 22 -------------------- clash-cores/test/Test/Cores/Sgmii/Sync.hs | 2 +- 4 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 clash-cores/test/Test/Cores/Sgmii/Common.hs diff --git a/clash-cores/clash-cores.cabal b/clash-cores/clash-cores.cabal index 13645433df..d3f8cf9bd6 100644 --- a/clash-cores/clash-cores.cabal +++ b/clash-cores/clash-cores.cabal @@ -212,7 +212,6 @@ test-suite unittests Test.Cores.Internal.Signals Test.Cores.Sgmii.AutoNeg Test.Cores.Sgmii.BitSlip - Test.Cores.Sgmii.Common Test.Cores.Sgmii.Gearbox Test.Cores.Sgmii.PcsReceive Test.Cores.Sgmii.PcsTransmit diff --git a/clash-cores/test/Test/Cores/Sgmii/BitSlip.hs b/clash-cores/test/Test/Cores/Sgmii/BitSlip.hs index 58df4a6b5f..1880b74316 100644 --- a/clash-cores/test/Test/Cores/Sgmii/BitSlip.hs +++ b/clash-cores/test/Test/Cores/Sgmii/BitSlip.hs @@ -8,7 +8,7 @@ import Data.Maybe (isNothing) import qualified Hedgehog as H import qualified Hedgehog.Gen as Gen import qualified Hedgehog.Range as Range -import Test.Cores.Sgmii.Common +import Test.Cores.EbTb import Test.Tasty import Test.Tasty.Hedgehog import Test.Tasty.TH diff --git a/clash-cores/test/Test/Cores/Sgmii/Common.hs b/clash-cores/test/Test/Cores/Sgmii/Common.hs deleted file mode 100644 index 94a2600b51..0000000000 --- a/clash-cores/test/Test/Cores/Sgmii/Common.hs +++ /dev/null @@ -1,22 +0,0 @@ -module Test.Cores.Sgmii.Common where - -import Clash.Prelude - --- | Example DataWord that doesn't invert the running disparity -dwD09_1 :: BitVector 8 -dwD09_1 = 0b00101001 - --- | Check if a 'BitVector' does not contain a sequence of bits with the same --- value for 5 or more bits consequetively. -checkBitSequence :: (KnownNat n) => BitVector n -> Bool -checkBitSequence cg = - fst (fst (mapAccumL (f 0) (0, 0) (bv2v cg))) - < 5 - && fst (fst (mapAccumL (f 1) (0, 0) (bv2v cg))) - < 5 - where - f :: Bit -> (Int, Int) -> Bit -> ((Int, Int), Bit) - f c (accMax, acc) i = - if i == c - then ((if accMax < (acc + 1) then acc + 1 else accMax, acc + 1), i) - else ((accMax, 0), i) diff --git a/clash-cores/test/Test/Cores/Sgmii/Sync.hs b/clash-cores/test/Test/Cores/Sgmii/Sync.hs index 77961b7873..9b167f1b46 100644 --- a/clash-cores/test/Test/Cores/Sgmii/Sync.hs +++ b/clash-cores/test/Test/Cores/Sgmii/Sync.hs @@ -10,7 +10,7 @@ import Data.List (group, mapAccumL, maximumBy) import qualified Hedgehog as H import qualified Hedgehog.Gen as Gen import qualified Hedgehog.Range as Range -import Test.Cores.Sgmii.Common +import Test.Cores.EbTb import Test.Tasty import Test.Tasty.Hedgehog import Test.Tasty.TH