File: clash-lib.cabal

package info (click to toggle)
haskell-clash-lib 1.8.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,108 kB
  • sloc: haskell: 28,988; tcl: 474; ansic: 4; makefile: 4
file content (439 lines) | stat: -rw-r--r-- 15,680 bytes parent folder | download
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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
Cabal-version:        2.2
Name:                 clash-lib
Version:              1.8.4
Synopsis:             Clash: a functional hardware description language - As a library
Description:
  Clash is a functional hardware description language that borrows both its
  syntax and semantics from the functional programming language Haskell. The
  Clash compiler transforms these high-level descriptions to low-level
  synthesizable VHDL, Verilog, or SystemVerilog.
  .
  Features of Clash:
  .
  * Strongly typed, but with a very high degree of type inference, enabling both
    safe and fast prototyping using concise descriptions.
  .
  * Interactive REPL: load your designs in an interpreter and easily test all
    your component without needing to setup a test bench.
  .
  * Higher-order functions, with type inference, result in designs that are
    fully parametric by default.
  .
  * Synchronous sequential circuit design based on streams of values, called
    @Signal@s, lead to natural descriptions of feedback loops.
  .
  * Support for multiple clock domains, with type safe clock domain crossing.
  .
  .
  This package provides:
  .
  * The CoreHW internal language: SystemF + Letrec + Case-decomposition
  .
  * The normalisation process that brings CoreHW in a normal form that can be
  converted to a netlist
  .
  * Blackbox/Primitive Handling
  .
  .
  Front-ends (for: parsing, typecheck, etc.) are provided by separate packages:
  .
  * <https://hackage.haskell.org/package/clash-ghc GHC/Haskell Frontend>
  .
  * <https://github.com/christiaanb/Idris-dev Idris Frontend>
  .
  .
  Prelude library: <https://hackage.haskell.org/package/clash-prelude>
Homepage:             https://clash-lang.org/
bug-reports:          https://github.com/clash-lang/clash-compiler/issues
License:              BSD-2-Clause
License-file:         LICENSE
Author:               The Clash Authors
Maintainer:           QBayLogic B.V. <devops@qbaylogic.com>
Copyright:            Copyright © 2012-2016, University of Twente,
                                  2016-2019, Myrtle Software Ltd,
                                  2017-2023, QBayLogic B.V., Google Inc.
Category:             Hardware
Build-type:           Simple

Extra-source-files:
  README.md,
  CHANGELOG.md,
  src/ClashDebug.h

Data-files:
  data-files/tcl/clashConnector.tcl
  prims/common/*.primitives.yaml,
  prims/commonverilog/*.primitives.yaml,
  prims/verilog/*.primitives.yaml,
  prims/systemverilog/*.primitives.yaml,
  prims/vhdl/*.primitives.yaml

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

flag debug
   description:
     Build a debug compiler
   default: False
   manual: True

flag unittests
  description:
    You can disable testing with unittests using `-f-unittests`.
  default: True
  manual: True

flag doctests
  description:
    You can disable testing with doctests using `-f-doctests`.
  default: True
  manual: True

flag workaround-ghc-mmap-crash
  description:
    Only use this flag when hit by GHC bug #19421. See clash-compiler PR #2444.
  default: False
  manual: True

common common-options
  default-language:   Haskell2010
  default-extensions: BangPatterns
                      BinaryLiterals
                      DataKinds
                      DefaultSignatures
                      DeriveDataTypeable
                      DeriveFoldable
                      DeriveFunctor
                      DeriveGeneric
                      DeriveLift
                      DeriveTraversable
                      DerivingStrategies
                      InstanceSigs
                      KindSignatures
                      NoStarIsType
                      PostfixOperators
                      ScopedTypeVariables
                      StandaloneDeriving
                      TupleSections
                      TypeApplications
                      TypeOperators
                      ViewPatterns

Library
  import:             common-options
  HS-Source-Dirs:     src

  ghc-options:        -Wall -Wcompat
  CPP-Options:        -DCABAL

  other-extensions:   CPP
                      DeriveAnyClass
                      FlexibleContexts
                      FlexibleInstances
                      GeneralizedNewtypeDeriving
                      LambdaCase
                      MultiParamTypeClasses
                      OverloadedStrings
                      RankNTypes
                      RecordWildCards
                      TemplateHaskell

  Build-depends:      aeson                   >= 0.6.2.0  && < 2.3,
                      attoparsec-aeson        >= 2.1      && < 2.3,
                      aeson-pretty            >= 0.8      && < 0.9,
                      ansi-terminal           >= 0.8.0.0  && < 1.2,
                      array,
                      async                   >= 2.2.0    && < 2.3,
                      attoparsec              >= 0.10.4.0 && < 0.15,
                      base                    >= 4.11     && < 5,
                      base16-bytestring       >= 0.1.1    && < 1.1,
                      binary                  >= 0.8.5    && < 0.11,
                      bytestring              >= 0.10.0.2 && < 0.13,
                      clash-prelude           == 1.8.4,
                      containers              >= 0.5.0.0  && < 0.8,
                      cryptohash-sha256       >= 0.11     && < 0.12,
                      data-binary-ieee754     >= 0.4.4    && < 0.6,
                      data-default            >= 0.7      && < 0.9,
                      deepseq                 >= 1.3.0.2  && < 1.6,
                      dlist                   >= 0.8      && < 1.1,
                      directory               >= 1.2.0.1  && < 1.4,
                      exceptions              >= 0.8.3    && < 0.11.0,
                      extra                   >= 1.6.17   && < 1.9,
                      filepath                >= 1.3.0.1  && < 1.6,
                      ghc                     >= 8.6.0    && < 9.11,
                      ghc-boot-th,
                      ghc-prim,
                      hashable                >= 1.2.1.0  && < 1.6,
                      haskell-src-meta        >= 0.8      && < 0.9,
                      hint                    >= 0.7      && < 0.10,
                      infinite-list           ^>= 0.1,
                      lens                    >= 4.10     && < 5.4,
                      mtl                     >= 2.1.2    && < 2.4,
                      ordered-containers      >= 0.2      && < 0.3,
                      prettyprinter           >= 1.2.0.1  && < 1.8,
                      prettyprinter-interp    ^>= 0.2,
                      pretty-show             >= 1.9      && < 2.0,
                      primitive               >= 0.5.0.1  && < 1.0,
                      string-interpolate      ^>= 0.3,
                      template-haskell        >= 2.8.0.0  && < 2.23,
                      temporary               >= 1.2.1    && < 1.4,
                      terminal-size           >= 0.3      && < 0.4,
                      text                    >= 1.2.2    && < 2.2,
                      time                    >= 1.4.0.1  && < 1.15,
                      transformers            >= 0.5.2.0  && < 0.7,
                      trifecta                >= 1.7.1.1  && < 2.2,
                      vector                  >= 0.11     && < 1.0,
                      vector-binary-instances >= 0.2.3.5  && < 0.3,
                      unordered-containers    >= 0.2.3.3  && < 0.3,
                      yaml                    >= 0.11     && < 0.12,

  if impl(ghc < 9.4.0)
    build-depends:

  if impl(ghc >= 9.0.0)
    build-depends:     ghc-bignum >=1.0 && <1.4
  else
    build-depends:     integer-gmp >=1.0 && <1.1

  Autogen-Modules:    Paths_clash_lib

  Exposed-modules:    Clash.Annotations.BitRepresentation.ClashLib

                      Clash.Backend
                      Clash.Backend.SystemVerilog
                      Clash.Backend.Verilog
                      Clash.Backend.Verilog.Time
                      Clash.Backend.VHDL

                      Clash.Core.DataCon
                      Clash.Core.EqSolver
                      Clash.Core.Evaluator.Types
                      Clash.Core.FreeVars
                      Clash.Core.HasType
                      Clash.Core.HasFreeVars
                      Clash.Core.Literal
                      Clash.Core.Name
                      Clash.Core.PartialEval
                      Clash.Core.PartialEval.AsTerm
                      Clash.Core.PartialEval.Monad
                      Clash.Core.PartialEval.NormalForm
                      Clash.Core.Pretty
                      Clash.Core.Subst
                      Clash.Core.Term
                      Clash.Core.TermInfo
                      Clash.Core.TermLiteral
                      Clash.Core.TermLiteral.TH
                      Clash.Core.TyCon
                      Clash.Core.Type
                      Clash.Core.TysPrim
                      Clash.Core.Util
                      Clash.Core.Var
                      Clash.Core.VarEnv

                      Clash.Data.UniqMap

                      Clash.DataFiles

                      Clash.Debug

                      Clash.Driver
                      Clash.Driver.Bool
                      Clash.Driver.Manifest
                      Clash.Driver.Types

                      Clash.Edalize.Edam

                      Clash.Netlist
                      Clash.Netlist.BlackBox
                      Clash.Netlist.BlackBox.Parser
                      Clash.Netlist.BlackBox.Types
                      Clash.Netlist.BlackBox.Util
                      Clash.Netlist.Expr
                      Clash.Netlist.Id
                      Clash.Netlist.Id.Common
                      Clash.Netlist.Id.Internal
                      Clash.Netlist.Id.SystemVerilog
                      Clash.Netlist.Id.Verilog
                      Clash.Netlist.Id.VHDL
                      Clash.Netlist.Types
                      Clash.Netlist.Util

                      Clash.Normalize
                      Clash.Normalize.PrimitiveReductions
                      Clash.Normalize.Primitives
                      Clash.Normalize.Strategy
                      Clash.Normalize.Transformations
                      Clash.Normalize.Transformations.ANF
                      Clash.Normalize.Transformations.Case
                      Clash.Normalize.Transformations.Cast
                      Clash.Normalize.Transformations.DEC
                      Clash.Normalize.Transformations.EtaExpand
                      Clash.Normalize.Transformations.Inline
                      Clash.Normalize.Transformations.Letrec
                      Clash.Normalize.Transformations.MultiPrim
                      Clash.Normalize.Transformations.Reduce
                      Clash.Normalize.Transformations.SeparateArgs
                      Clash.Normalize.Transformations.Specialize
                      Clash.Normalize.Transformations.XOptimize
                      Clash.Normalize.Types
                      Clash.Normalize.Util

                      Clash.Primitives.DSL
                      Clash.Primitives.Types
                      Clash.Primitives.Util

                      Clash.Primitives.Annotations.SynthesisAttributes
                      Clash.Primitives.GHC.Int
                      Clash.Primitives.GHC.Literal
                      Clash.Primitives.GHC.Word
                      Clash.Primitives.Intel.ClockGen
                      Clash.Primitives.Magic
                      Clash.Primitives.Sized.ToInteger
                      Clash.Primitives.Sized.Signed
                      Clash.Primitives.Sized.Vector
                      Clash.Primitives.Verification
                      Clash.Primitives.Xilinx.ClockGen

                      Clash.Rewrite.Combinators
                      Clash.Rewrite.Types
                      Clash.Rewrite.Util
                      Clash.Rewrite.WorkFree

                      Clash.Unique
                      Clash.Util
                      Clash.Util.Eq
                      Clash.Util.Graph
                      Clash.Util.Interpolate
                      Clash.Util.Supply
                      Clash.Pretty

                      Clash.Verification.Pretty

                      -- Used in v16-upgrade-primitives to decode our non-standard
                      -- JSON primitive files.
                      Data.Aeson.Extra

                      -- Used in clash-cores
                      Data.Text.Prettyprint.Doc.Extra

                      -- Used in clash-ghc
                      GHC.BasicTypes.Extra

  Other-Modules:      Clash.Annotations.TopEntity.Extra
                      Data.IntMap.Extra
                      Data.List.Extra
                      Data.Map.Ordered.Extra
                      Data.Monoid.Extra
                      Data.Primitive.ByteArray.Extra
                      Data.Set.Ordered.Extra
                      Data.Text.Extra
                      GHC.SrcLoc.Extra
                      Paths_clash_lib

  if flag(debug)
    cpp-options:      -DDEBUG

executable v16-upgrade-primitives
  Main-Is:            tools/v16-upgrade-primitives.hs
  Build-Depends:
    base,
    aeson,
    attoparsec-aeson,
    deepseq,
    yaml,
    bytestring,
    clash-lib,
    text,
    containers,
    directory,
    Glob
  GHC-Options:        -Wall -Wcompat
  default-language:   Haskell2010

executable static-files
  Main-Is:            tools/static-files.hs
  Build-Depends:
    base,
    clash-lib,
    directory,
    docopt                  ^>= 0.7,
    extra,
    filepath
  GHC-Options:        -Wall -Wcompat
  default-language:   Haskell2010
  if impl(ghc >= 9.2.0)
    buildable: False


test-suite doctests
  type:             exitcode-stdio-1.0
  default-language: Haskell2010
  main-is:          doctests.hs
  ghc-options:      -Wall -Wcompat -threaded
  hs-source-dirs:   tests

  if !flag(doctests)
    buildable: False
  else
    build-depends:
      base,
      clash-lib,
      doctest-parallel >= 0.2 && < 0.5,
      filepath

test-suite unittests
  import:           common-options
  type:             exitcode-stdio-1.0
  default-language: Haskell2010
  main-is:          unittests.hs
  ghc-options:      -Wall -Wcompat -threaded
  -- Note that multiple -with-rtsopts are not cumulative, so we can't add the
  -- common RTS options in the unconditional GHC-Options
  if arch(x86_64) && flag(workaround-ghc-mmap-crash)
    GHC-Options: "-with-rtsopts=-N -xm20000000"
  hs-source-dirs:   tests

  if !flag(unittests)
    buildable: False
  else
    build-depends:
      clash-prelude,
      clash-lib,

      ghc-typelits-knownnat,

      aeson,
      attoparsec-aeson,
      aeson-pretty,
      base,
      base16-bytestring,
      bytestring,
      containers,
      data-default,
      deepseq,
      haskell-src-exts,
      ghc,
      lens,
      pretty-show,
      quickcheck-text,
      tasty         >= 1.2      && < 1.6,
      tasty-hunit,
      tasty-quickcheck,
      tasty-th,
      template-haskell,
      text,
      transformers,
      unordered-containers

  Other-Modules: Clash.Tests.Core.FreeVars
                 Clash.Tests.Core.Subst
                 Clash.Tests.Core.TermLiteral
                 Clash.Tests.Core.TermLiteral.Types
                 Clash.Tests.Driver.Manifest
                 Clash.Tests.Netlist.Id
                 Clash.Tests.Util.Interpolate
                 Clash.Tests.Normalize.Transformations

                 Test.Clash.Rewrite