-
Notifications
You must be signed in to change notification settings - Fork 3
/
clash-cores.cabal
268 lines (241 loc) · 7.2 KB
/
clash-cores.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
cabal-version: 2.2
name: clash-cores
version: 1.9.0
synopsis: A collection of IP cores for Clash
description: A collection of IP cores for Clash
bug-reports: https://github.com/clash-lang/clash-cores/issues
license: BSD-2-Clause
license-file: LICENSE
author: QBayLogic B.V.
maintainer: [email protected]
copyright: Copyright © 2019 , Foamspace Corp.,
2022-2023, QBayLogic B.V.
category: Hardware
-- TODO: Revert to "Simple". See:
--
-- https://github.com/clash-lang/clash-compiler/pull/2665#issuecomment-1939044550
build-type: Custom
extra-source-files: CHANGELOG.md
flag doctests
description:
You can disable testing with doctests using `-f-doctests`.
default: True
manual: True
flag unit-tests
description:
You can disable testing with unit tests using `-f-unit-tests`.
default: True
manual: True
flag haddock
description:
Work-around haddock bug on GHC 8.6.*
default: False
manual: True
flag nix
description:
Are we building this package from 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
custom-setup
setup-depends:
base,
Cabal >= 3.10.3.0
common basic-config
default-language: Haskell2010
default-extensions:
BinaryLiterals
DataKinds
DefaultSignatures
DeriveAnyClass
DeriveGeneric
DerivingStrategies
FlexibleContexts
MagicHash
NoImplicitPrelude
PostfixOperators
NoStarIsType
ScopedTypeVariables
TemplateHaskell
TypeApplications
TypeFamilies
TypeOperators
-- See https://github.com/clash-lang/clash-compiler/pull/2511
if impl(ghc >= 9.4)
CPP-Options: -DCLASH_OPAQUE=OPAQUE
else
CPP-Options: -DCLASH_OPAQUE=NOINLINE
ghc-options:
-Wall -Wcompat
if flag(haddock)
ghc-options:
-fdefer-type-errors
elif flag(nix)
-- It's absolutely grimy, but if we don't specify the `-package` flags here
-- then when nix eventually calls `./Setup register` on the package it will
-- still pass the `-fplugin` options to GHC and fail to create the package
-- registation file needed to finish the `installPhase`.
--
-- These flags are something we NEVER want to manually specify in a normal
-- build, since correctly configuring this kind of thing should be solely
-- left to cabal as a build tool.
ghc-options:
-package ghc-typelits-extra
-fplugin GHC.TypeLits.Extra.Solver
-package ghc-typelits-knownnat
-fplugin GHC.TypeLits.Normalise
-package ghc-typelits-natnormalise
-fplugin GHC.TypeLits.KnownNat.Solver
else
ghc-options:
-fplugin GHC.TypeLits.Extra.Solver
-fplugin GHC.TypeLits.Normalise
-fplugin GHC.TypeLits.KnownNat.Solver
build-depends:
base >= 4.10 && < 5,
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
exposed-modules:
Clash.Cores.Crc
Clash.Cores.Crc.Internal
Clash.Cores.Crc.Catalog
Clash.Cores.LatticeSemi.ECP5.Blackboxes.IO
Clash.Cores.LatticeSemi.ECP5.IO
Clash.Cores.LatticeSemi.ICE40.Blackboxes.IO
Clash.Cores.LatticeSemi.ICE40.IO
Clash.Cores.LineCoding8b10b
Clash.Cores.LineCoding8b10b.Decoder
Clash.Cores.LineCoding8b10b.Encoder
Clash.Cores.SPI
Clash.Cores.UART
Clash.Cores.Xilinx.BlockRam
Clash.Cores.Xilinx.BlockRam.BlackBoxes
Clash.Cores.Xilinx.BlockRam.Internal
Clash.Cores.Xilinx.DcFifo
Clash.Cores.Xilinx.DcFifo.Internal.BlackBoxes
Clash.Cores.Xilinx.DcFifo.Internal.Instances
Clash.Cores.Xilinx.DcFifo.Internal.Types
Clash.Cores.Xilinx.Floating
Clash.Cores.Xilinx.Floating.Annotations
Clash.Cores.Xilinx.Floating.BlackBoxes
Clash.Cores.Xilinx.Floating.Explicit
Clash.Cores.Xilinx.Floating.Internal
Clash.Cores.Xilinx.Ila
Clash.Cores.Xilinx.Ila.Internal
Clash.Cores.Xilinx.Internal
Clash.Cores.Xilinx.Unisim.DnaPortE2
Clash.Cores.Xilinx.Unisim.DnaPortE2.Internal
Clash.Cores.Xilinx.VIO
Clash.Cores.Xilinx.VIO.Internal.BlackBoxes
Clash.Cores.Xilinx.Xpm
Clash.Cores.Xilinx.Xpm.Cdc
Clash.Cores.Xilinx.Xpm.Cdc.ArraySingle
Clash.Cores.Xilinx.Xpm.Cdc.Gray
Clash.Cores.Xilinx.Xpm.Cdc.Handshake
Clash.Cores.Xilinx.Xpm.Cdc.Internal
Clash.Cores.Xilinx.Xpm.Cdc.Pulse
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
ghc-options:
-fexpose-all-unfoldings
-fno-worker-wrapper
build-depends:
unordered-containers,
ghc-prim >= 0.3.1.0 && < 1.0,
lens,
mtl >= 2.1.1 && < 2.4,
pretty-show,
prettyprinter >= 1.2.0.1 && < 1.8,
prettyprinter-interp ^>= 0.2,
reducers >= 3.12.2 && < 4.0,
text >= 1.2.2 && < 2.2,
constraints >= 0.9 && < 1.0,
template-haskell >= 2.12.0.0 && < 2.23,
test-suite unit-tests
import: basic-config
hs-source-dirs: test
type: exitcode-stdio-1.0
main-is: unit-tests.hs
if !flag(unit-tests)
buildable: False
other-modules:
Test.Cores.Crc
Test.Cores.Internal.SampleSPI
Test.Cores.LineCoding8b10b
Test.Cores.Internal.Signals
Test.Cores.SPI
Test.Cores.SPI.MultiSlave
Test.Cores.UART
Test.Cores.Xilinx.BlockRam
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-prelude-hedgehog,
deepseq,
tasty >= 1.2 && < 1.6,
tasty-hunit,
tasty-quickcheck,
tasty-th,
hedgehog,
tasty-hedgehog >= 1.2.0,
test-suite doctests
type: exitcode-stdio-1.0
default-language: Haskell2010
main-is: doctests.hs
ghc-options: -Wall -Wcompat -threaded
hs-source-dirs: test
if !flag(doctests)
buildable: False
else
build-depends:
base,
clash-cores,
doctest-parallel >= 0.2 && < 0.4,
filepath,