Releases: clash-lang/clash-compiler
v1.2.2
Bugfix release
-
Changed:
- The hardwired functions to unroll primitive definitions for 'zipWith', 'map', 'foldr', and 'init' have been changed to only unroll a single step, whereas they would previously unroll the whole definition in one step. This allows Clash to take advantage of the lazy nature of these functions, in turn speeding up compilation speeds significantly in some cases. Part of PR 1354.
-
Added:
- Support for GHC 8.10
- Ability to load designs from precompiled modules (i.e., stored in a package database). See #1172
- Support for '-main-is' when used with
--vhdl
,--verilog
, or--systemverilog
- A partial instance for
NFDataX (Signal domain a)
-
Fixed:
- Clash's evaluator now inlines work free definitions, preventing situations where it would otherwise get stuck in an infinite loop
caseCon
doesn't apply type-substitution correctly #1340- Clash generates illegal SystemVerilog slice #1313
- Fix result type of head and tail Verilog blackboxes #1351
- Certain recursive let-expressions in side a alternatives of a case-expression throw the Clash compiler into an infinite loop #1316
- Fixes issue with one of Clash's transformations,
inlineCleanup
, introducing free variables #1337 - Fails to propagate type information of existential type #1310
- Certain case-expressions throw the Clash compiler into an infinite loop #1320
- Added blackbox implementation for 'Clash.Sized.Vector.iterateI', hence making it usable as a register reset value #1240
iterate
anditerateI
can now be used in reset values #1240- Prim evaluation fails on undefined arguments #1297
- Missing re-indexing in (Un)Signed fromSLV conversion #1292
- VHDL: generate a type qualification inside ~TOBV, fixes #1360
v1.2.1
Bug fix release
-
Changed:
- Treat
Signed 0
,Unsigned 0
,Index 1
,BitVector 0
as unit. In effect this means that 'minBound' and 'maxBound' return 0, whereas previously they might crash #1183 - Infix use of
deepseqX
is now right-associative
- Treat
-
Added:
- Add 'natToInteger', 'natToNatural', and 'natToNum'. Similar to 'snatTo*', but works solely on a type argument instead of an SNat.
Clash.Sized.Vector.unfoldr
andClash.Sized.Vector.unfoldrI
to construct vectors from a seed value- Added NFDataX instances for
Data.Monoid.{First,Last}
-
Fixed:
- The Verilog backend can now deal with non-contiguous ranges in custom bit-representations.
- Synthesizing BitPack instances for type with phantom parameter fails #1242
- Synthesis of
fromBNat (toBNat d5)
failed due tounsafeCoerce
coercing fromAny
- Memory leak in register primitives #1256
- Illegal VHDL slice when projecting nested SOP type #1254
- Vivado VHDL code path (
-fclash-hdlsyn Vivado
) generates illegal VHDL #1264
v1.2.0
As promised when releasing 1.0, we've tried our best to keep the API stable. We
think most designs will continue to compile with this new version, although special
care needs to be taken when using:
-
..inline blackboxes. Instead of taking a single HDL, inline primitives now
take multiple. For example,InlinePrimitive VHDL ".."
must now be written
asInlinePrimitive [VHDL] ".."
. -
..the
Enum
instance forBitVector
,Index
,Signed
, orUnsigned
, as
they now respect theirmaxBound
. See #1089.
On top of that, we've added a number of new features:
-
makeTopEntity
: Template Haskell function for generating TopEntity annotations. See the documentation on Haddock for more information. -
Clash.Explicit.SimIO
: ((System)Verilog only) I/O actions that can be translated to HDL I/O. See the documentation on Haddock for more information. -
Clash.Class.AutoReg
: A smart register that improves the chances of synthesis tools inferring clock-gated registers. See the documentation on Haddock for more information.
View all the changes in the CHANGELOG. Happy hacking!
v1.0.1
Bug fix release
-
Fixes issues:
- #810: Verilog backend now correctly specifies type of
BitVector 1
- #811: Improve module load behavior in clashi
- #439: Template Haskell splices and TopEntity annotations can now be used in clashi
- #818: Fixed various mistakes in tutorial
- #662: Clash will now constant specialize partially constant constructs
- #700: Check work content of expression in cast before warning users. Should eliminate a lot of (superfluous) warnings about "specializing on non work-free cast"s.
- #837: Blackboxes will now report clearer error messages if they're given unexpected arguments.
- #810: Verilog backend now correctly specifies type of
-
Small fixes without issue reports:
10 years going
10 year anniversary release!
- 10x - 50x faster compile times
- New features:
- API changes: check the migration guide at the end of
Clash.Tutorial
- All memory elements now have an (implicit) enable line; "Gated" clocks have
been removed as the clock wasn't actually gated, but implemented as an
enable line. - Circuit domains are now configurable in:
-
(old) The clock period
-
(new) Clock edge on which memory elements latch their inputs
(rising edge or falling edge) -
(new) Whether the reset port of a memory element is level sensitive
(asynchronous reset) or edge sensitive (synchronous reset) -
(new) Whether the reset port of a memory element is active-high or
active-low (negated reset) -
(new) Whether memory element power on in a configurable/defined state
(common on FPGAs) or in an undefined state (ASICs) -
See the blog post on this new feature
-
- Data types can now be given custom bit-representations: http://hackage.haskell.org/package/clash-prelude/docs/Clash-Annotations-BitRepresentation.html
- Annotate expressions with attributes that persist in the generated HDL,
e.g. synthesis directives: http://hackage.haskell.org/package/clash-prelude/docs/Clash-Annotations-SynthesisAttributes.html - Control (System)Verilog module instance, and VHDL entity instantiation names
in generated code: http://hackage.haskell.org/package/clash-prelude/docs/Clash-Magic.html - Much improved infrastructure for handling of unknown values: defined spine,
but unknown leafs: http://hackage.haskell.org/package/clash-prelude/docs/Clash-XException.html#t:NFDataX - Experimental: Multiple hidden clocks. Can be enabled by compiling
clash-prelude
with-fmultiple-hidden
- Experimental: Limited GADT support (pattern matching on vectors, or custom
GADTs as longs as their usage can be statically removed; no support of
recursive GADTs) - Experimental: Use regular Haskell functions to generate HDL black boxes for
primitives (in an addition to existing string templates for HDL black boxes)
See for example: http://hackage.haskell.org/package/clash-lib/docs/Clash-Primitives-Intel-ClockGen.html
- API changes: check the migration guide at the end of
0.7.2
v0.7.1
- New features:
- Support distribution of primitive templates with Cabal/Hackage packages commit
- Find memory data files and primitive files relative to import dirs (
-i<DIR>
) - Add 'clashi' program and 'clash-ghc' package #208, thanks to @thoughtpolice
- Fixes bugs:
case (EmptyCase ty) of ty' { ... }
->EmptyCase ty'
#198BitVector.split#
apply the correct type arguments- SystemVerilog: Incorrect unsigned->signed wrap-around and conversion
- SystemVerilog: Use unpacked array syntax in array literals
- SystemVerilog: Add braces when converting unpacked to packed arrays
- SystemVerilog: Fixed
rotateLeftS
systemverilog template - SystemVerilog: Do not generate null-slices
- Verilog: Incorrect unsigned->signed wrap-around and conversion
- VHDL: resize
Integer
multiplication result
v0.7
- New features:
CLaSH.XException
: a module defining an exception representing uninitialised values. Additionally adds theShowX
class which has methods that prints values as "X" where they would normally raise anXException
exception.- Add
BNat
(and supporting functions) toCLaSH.Promoted.Nat
: base-2 encoded natural numbers. - Add
divSNat
andlogBaseSNat
toCLaSH.Promoted.Nat
: division and logarithm for singleton natural numbers. - Add
predUNat
andsubUNat
toCLaSH.Promoted.Nat
: predecessor and subtraction for unary-encoded natural numbers. - Add
dtfold
toCLaSH.Sized.Vector
: a dependently-typed tree-fold overVec
. - Add the perfect-depth binary trees module
CLaSH.Sized.RTree
- Synthesisable definitions of
countLeadingZeros
andcountTrailingZeros
for:BitVector
,Signed
,Unsigned
, andFixed
- Add the
(:::)
type alias inCLaSH.NamedTypes
which allows you to annotate types with documentation
- Changes:
asyncRam
,blockRam
,blockRamFile
have aMaybe (addr,a)
as write input instead of three separateBool
,addr
, anda
inputs.asyncFIFOSynchronizer
has aMaybe a
as write-request instead of a separateBool
anda
inputbundle'
andunbundle'
are removed;bundle
now has typeUnbundled' clk a -> Signal' clk a
,unbundle
now has typeSignal' clk a -> Unbundled' clk a
subSNat
now has the typeSNat (a+b) -> SNat b -> SNat a
(where it used to beSNat a -> SNat b -> SNat (a-b)
)- Renamed
multUNat
tomulUNat
to be in sync withmulSNat
andmulBNat
. - The function argument of
vfold
inCLaSH.Sized.Vector
is now(forall l . SNat l -> a -> Vec l b -> Vec (l + 1) b)
(where it used to be(forall l . a -> Vec l b -> Vec (l + 1) b)
) Cons
constructor ofVec
is no longer visible;(:>)
and(:<)
are now listed as constructors ofVec
- Simulation speed improvements for numeric types
v0.6.24
v0.6.22
- Fixes bugs:
- Bug in DEC transformation overwrites case-alternatives
- Bug in DEC transformation creates non-representable let-binders
- VHDL: Incorrect primitive for
Integer
sltInteger#
andgeInteger#
- (System)Verilog: Fix primitive for CLaSH.Sized.Internal.Signed.mod# and GHC.Type.Integer.modInteger #164