| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-04-23 | 12.2 kB | |
| v1.10.0 source code.tar.gz | 2026-04-23 | 2.1 MB | |
| v1.10.0 source code.zip | 2026-04-23 | 2.8 MB | |
| Totals: 3 Items | 4.9 MB | 0 | |
Release highlight:
Clash.Class.NumConvert: Utilities for safely converting between various Clash number types #2915
Added:
- Added GHC 9.12 support
Clash.Class.NumConvert: Utilities for safely converting between various Clash number types #2915- Add
Clash.XException.ShowXinstance forForeign.C.Types.CUShort. #2397 - Introduced various new types to
Clash.Signalto more easily represent time and its relation to your clock domain. New types:Seconds,Milliseconds,Microseconds,Nanoseconds,Picoseconds,DomainToHz,HzToPeriod,PeriodToHz,PeriodToCycles,ClockDivider. #2734 DistributiveandRepresentableinstances forVec- Resize functions
maybeResizeandmaybeTruncateBtoClash.Class.Resize. Can be used to resize without loss of information. #2779 - Alongside the existing Eq-like and Ord-like signal operators like
.==.and.<=.etc., there are now new functions for comparing with constants:.==,==.,./=,/=.,.<=,<=.,.>=,>=.,.>,>.,.<,<.,.&&,&&.,.||,||.. These are useful for comparing signals with constants in a more readable way. For example,a .==. pure Truecan now be replaced witha .== True. #2545 - instance
HasField f (Signal dom r) (Signal dom a). This means record dot accesses will be passed to the underlying type. For example, this will work:
```haskell data MyRecord = MyRecord { myField :: Int }
a :: Signal dom MyRecord a = pure (MyRecord 3)
b :: Signal dom Int b = a.myField ```
BitPackinstance forData.Proxy.ProxyapEn, which is amuxthat optionally applies an update function to a value. #3029regEnN, which is a chain ofregEns. #3029Index 0instances forBitPack,Bits,Counter,FiniteBits,Parity, andSaturatingNum. #2784- Zero-sized block RAM implementations for
blockRam1andblockRamU. #2784 Counter a => Counter (Vec 0 a)instance. #2784SaturatingNumandBoundedinstances forSignal dom a. Thesatfamily (satAdd,satSucc, ...) can now be used onSignals and{min,max}Boundcan be used to construct them #2931-fclash-no-concurrent-topentity-compilationflag to disable concurrent compilation of top entities. This is mostly useful to get a consistent debug output.SomeBoundedSNatand Hedgehog generators #3183Eq,NFData,ShowXandBitPackinstances forRamOp.smapWithBoundsextendingsmapvia offering a proof witness for the upper bound of the vector size to the mapping function. #2686- The function
Clash.Explicit.DDR.ddrForwardClock, which uses a DDR output primitive to forward a clock signal to a DDR-capable output pin. #2876
Removed:
- Support for GHC versions 9.4 and older
- Newer Verilators (> v5) can deal with delay statements, hence removing the need for Clash specific workarounds. If you relied on Clash-generated Verilator shims, consider using
verilator --build --binaryinstead. - Experimental feature "multiple hidden domains" #2750
- The deprecated module
Clash.Prelude.DataFlowwas removed. Theclash-protocolspackage provides dataflow-based protocols and circuits. #3181 - The deprecated functions
altpllandalteraPllwere removed from theClash.Intel.ClockGenmodule. Clash 1.8 introduced the new functionsaltpllSync,alteraPllSync,unsafeAltpllandunsafeAlteraPll. A name for the IP instantiation, handled by the name argument toaltpllandalteraPll, can be provided with theClash.Magic.setNamefunction. #3181
Changed:
dfoldnow offers a proof witness for the upper bound of the vector size to the folding function. Note that this change may require additional type annotations, as solutions working in the past may complain with an untouchable type error now. #2686- You can now only create an
SDomainConfigurationwhen theperiodof the domain is at least1. Pattern matching on anSDomainConfigurationbring the1 <= periodinto scope. This in turns enables the following code to typecheck: ``` import Clash.Prelude import Data.Proxy
f ::
forall dom .
KnownDomain dom =>
Proxy dom ->
SNat (PeriodToCycles dom (Milliseconds 1))
f Proxy = case knownDomain @dom of
SDomainConfiguration {} -> SNat
where the `DivRU` in
type PeriodToCycles (dom :: Domain) (period :: Nat) = period DivRU DomainPeriod dom
``
requires that theDomainPeriod domis at least1`. #2740
selectandselectInow use<=constraints instead ofCmpNat. #2873ResetStrategynow contains the reset function, to avoid dummy arguments onNoClearOnReset#2849Clash.Explicit.DDR,Clash.Intel.DDRandClash.Xilinx.DDR: #2833- The constraints for the functions have been rewritten to use
DomainPeriod, which makes them more readable and relaxes unnecessary constraints on the virtual DDR domain. The type-level variables for the domains have been renamed.domis a real domain,domDDRis the virtual DDR domain. - The Xilinx and Intel primitives only support domains where the rising edge is the active edge. This is now enforced at the type level by adding a constraint.
- The Xilinx and Intel primitives now directly support any data type that has a
BitPackinstance.
- The constraints for the functions have been rewritten to use
- Order of type arguments for functions in
clash-prelude-hedgehognow follows size, domain, monad. #2880 - The Clash Prelude now exports the
Defaultclass from the packagedata-defaultinstead of from the now supersededdata-default-class. If you import theDefaultclass name or thedeffunction from thedata-default-classpackage older than version 0.2, or one of your dependencies does, you might get a bewildering error message. You might get the error "No instance for (Default T)" even though there appears to be such an instance. The best solution is to make sure all your packages and dependencies use thedata-defaultpackage and not thedata-default-classpackage. The next most obvious solution is to make suredata-default-classis of version 0.2 or higher, for instance by depending on it in your own package. If this creates a dependency conflict, another solution is to import the correct module.DefaultanddeffromClash.PreludeorData.Defaultare for the newdata-defaultpackage.Data.Default.Classis for thedata-default-classpackage. There are situations where this will still not be enough, but luckily theDefaultclass is not used all that much. #2891 - Changed implementation of
(+>>)to no longer requireKnownNat - The
clash-preludepackage now usesPolyKindsby default, meaning all its type class instances are now more general than before. As an example, withoutPolyKinds,BitPack (Proxy a)would only be defined whena :: Type, with the extension it would be defined for anya :: k. After this change, some instances in user code might now overlap. #2994 - When generating (System)Verilog, Clash now resets the default net type from none to the verilog default after the generated module. #3005
- The content from the
Clash.Tutorialmodule and from https://clash-lang.readthedocs.io/ has been split and moved to two new locations. - The actual tutorial parts has been moved to: https://docs.clash-lang.org/tutorial/
- Parts that fit better in the clash compiler user guide have been moved to: https://docs.clash-lang.org/compiler-user-guide/
Moving the documentation to these locations makes it easier to update their content as it is no longer needed to release a new version of the clash-prelude package for the publication of this content.
- Vector functions in Verilog now have indices consistent with the Vec inputs/outputs (before they were reversed). This is convenient when writing design constraints, which can now be referenced consistently like
imap[0],imap[1],... See #3088.
Fixed:
- Clash no longer gives
Dubious primitive instantiation warningwhen usingunpack#2386. - Clash now generates more intuitive names for specialized binders. See #2508.
foldlonVecis now strict. See this GitHub discussion and this blog post for more information. #2482- Type families that appear in GHC core types are now normalized before being translated into their Clash core equivalent. See #3063.
- Added an evaluator rule for
bigNatEq#with compile-time constant arguments #3084 - Reduce constants to NF before specialization #3129
rotateLandrotateRno longer error when used onBitVector 0#2980- Behavior of
shiftRis now documented forUnsigned,BitVector,Index, andSigned#2959 - Clash will no longer error if it finds the same data file more than once due to duplicate
-iflags #3141 - Higher order blackboxes not propagating usage metadata for generated results #3147
- Run
caseConafter post-normalizationinlineCleanup#3159 - Failure to generate binder assignments in very specific cases #3185
- Clash won't create (invalid) netlist cases on Integer and Natural constructors anymore #3157
- Post-normalization flattening could leave a
Justconstructor as the scrutinee of acaseafter simplifying tuple projections #3204 - Clash no longer crashes on false positive free variable introduction in
reduceConstandconstantSpec. Fixes #3206. negateforNum Bitis now defined as the additive inverse, i.e.,negate = id. #2999