Skip to content

Commit

Permalink
Merge pull request #17 from clash-lang/port-sgmii
Browse files Browse the repository at this point in the history
Add SGMII support
  • Loading branch information
DigitalBrains1 authored Oct 10, 2024
2 parents d6e3269 + 275dca5 commit bbecbdc
Show file tree
Hide file tree
Showing 20 changed files with 2,530 additions and 35 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ cabal.config
*.bin
*.log
*.tar.gz
*.tix

*~
*.DS_Store
Expand Down
32 changes: 6 additions & 26 deletions cabal.project-master
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,12 @@ source-repository-package
type: git
location: https://github.com/clash-lang/clash-compiler.git
tag: master
subdir: clash-prelude

source-repository-package
type: git
location: https://github.com/clash-lang/clash-compiler.git
tag: master
subdir: clash-lib

source-repository-package
type: git
location: https://github.com/clash-lang/clash-compiler.git
tag: master
subdir: clash-ghc

source-repository-package
type: git
location: https://github.com/clash-lang/clash-compiler.git
tag: master
subdir: clash-prelude-hedgehog

-- clash-testsuite
source-repository-package
type: git
location: https://github.com/clash-lang/clash-compiler.git
tag: master
subdir: tests
subdir:
clash-prelude
clash-lib
clash-ghc
clash-prelude-hedgehog
tests

constraints:
clash-prelude == 1.9.0,
Expand Down
47 changes: 39 additions & 8 deletions clash-cores.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ flag nix
default: False
manual: True

flag clash-18
description:
Disable cores that require a Clash version later than 1.8
default: False

-- TODO: Remove this workaround. See:
--
-- https://github.com/clash-lang/clash-compiler/pull/2665#issuecomment-1939044550
Expand Down Expand Up @@ -107,17 +112,26 @@ common basic-config

build-depends:
base >= 4.10 && < 5,
clash-prelude,
constraints,
containers >=0.5 && <0.8,
ghc-typelits-extra >= 0.3.2,
ghc-typelits-knownnat >= 0.6,
ghc-typelits-natnormalise >= 0.6,
infinite-list ^>= 0.1,
lens,
QuickCheck,
string-interpolate ^>= 0.3,
template-haskell,

if flag(clash-18)
build-depends:
clash-lib >= 1.8.1,
clash-prelude >= 1.8.1,
else
build-depends:
clash-lib >= 1.9.0,
clash-prelude >= 1.9.0,

library
import: basic-config
hs-source-dirs: src
Expand Down Expand Up @@ -164,6 +178,19 @@ library
Clash.Cores.Xilinx.Xpm.Cdc.Single
Clash.Cores.Xilinx.Xpm.Cdc.SyncRst

if !flag(clash-18)
exposed-modules:
Clash.Cores.Sgmii
Clash.Cores.Sgmii.AutoNeg
Clash.Cores.Sgmii.BitSlip
Clash.Cores.Sgmii.Common
Clash.Cores.Sgmii.PcsReceive
Clash.Cores.Sgmii.PcsTransmit
Clash.Cores.Sgmii.PcsTransmit.CodeGroup
Clash.Cores.Sgmii.PcsTransmit.OrderedSet
Clash.Cores.Sgmii.RateAdapt
Clash.Cores.Sgmii.Sync

other-modules:
Data.Text.Extra

Expand All @@ -172,9 +199,7 @@ library
-fno-worker-wrapper

build-depends:
clash-lib,
unordered-containers,
infinite-list ^>= 0.1,
ghc-prim >= 0.3.1.0 && < 1.0,
lens,
mtl >= 2.1.1 && < 2.4,
Expand All @@ -184,7 +209,7 @@ library
reducers >= 3.12.2 && < 4.0,
text >= 1.2.2 && < 2.2,
constraints >= 0.9 && < 1.0,
template-haskell >= 2.12.0.0 && < 2.22
template-haskell >= 2.12.0.0 && < 2.22,

test-suite unit-tests
import: basic-config
Expand All @@ -195,7 +220,7 @@ test-suite unit-tests
if !flag(unit-tests)
buildable: False

other-Modules:
other-modules:
Test.Cores.Crc
Test.Cores.Internal.SampleSPI
Test.Cores.LineCoding8b10b
Expand All @@ -207,9 +232,16 @@ test-suite unit-tests
Test.Cores.Xilinx.DcFifo
Test.Cores.Xilinx.DnaPortE2

if !flag(clash-18)
other-modules:
Test.Cores.Sgmii.AutoNeg
Test.Cores.Sgmii.BitSlip
Test.Cores.Sgmii.RateAdapt
Test.Cores.Sgmii.Sgmii
Test.Cores.Sgmii.Sync

build-depends:
clash-cores,
clash-lib,
clash-prelude-hedgehog,
deepseq,
tasty >= 1.2 && < 1.6,
Expand All @@ -218,7 +250,6 @@ test-suite unit-tests
tasty-th,
hedgehog,
tasty-hedgehog >= 1.2.0,
infinite-list

test-suite doctests
type: exitcode-stdio-1.0
Expand All @@ -234,4 +265,4 @@ test-suite doctests
base,
clash-cores,
doctest-parallel >= 0.2 && < 0.4,
filepath
filepath,
Loading

0 comments on commit bbecbdc

Please sign in to comment.