packages feed

clash-ghc 1.8.4 → 1.8.5

raw patch · 14 files changed

+112/−30 lines, 14 filesdep ~clash-libdep ~clash-preludedep ~ghc-typelits-extraPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: clash-lib, clash-prelude, ghc-typelits-extra, ghc-typelits-knownnat, ghc-typelits-natnormalise

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,25 @@ # Changelog for the Clash project +## 1.8.5 *Mar 24th, 2026*++Added:+* `Clash.Annotation.SynthesisAtrributes.annotateReg`, a function to add synthesis attributes (e.g. `ASYNC_REG`) to register declarations in the HDL generated by the Clash compiler.+  [#3093](https://github.com/clash-lang/clash-compiler/pull/3093)+* `registerSyncReset` [#3115](https://github.com/clash-lang/clash-compiler/issues/3115)++Fixed:+* The `Clash.Explicit.Verification.check` blackbox now correctly uses the given clock line, not assuming any longer that it is already bound to an identifier in the first place. [#2907](https://github.com/clash-lang/clash-compiler/issues/2907)+* The type of string literals passed to the `Clash.Explicit.Verification.check` blackbox now matches with the input provided via `Clash.Explicit.Verification.name`. [#2908](https://github.com/clash-lang/clash-compiler/issues/2908)+* `toInteger`, `toEnum`, and `fromEnum` now correctly sign extend when using Verilog backend. [#2729](https://github.com/clash-lang/clash-compiler/issues/2729).+* `dumpVCD` now properly aligns the first clock edges in multi-domain designs. [#3075](https://github.com/clash-lang/clash-compiler/issues/3075)+* Removed the limit on the number of traces in `dumpVCD`. Also removed unnecessary double newlines after 1-bit signals. [#3082](https://github.com/clash-lang/clash-compiler/issues/3082)+* In Clash simulation, `pack` for `Vec` and `RTree` had all bits undefined when the spine of the value had an `XException`. Now, those elements with defined bits will output those defined bits. In HDL, this was already the case. Example: consider `xs = 1 :> undefined :> Nil :: Vec 2 (Unsigned 4)` and `ys = 1 :> undefined :: Vec 2 (Unsigned 4)`. `xs` merely has an undefined element, but `ys` has an undefined spine: it is a `:>` constructor that is undefined. `pack ys` used to be `0b...._....` but is now `0b0001_....`, just as `pack xs` already was.+  [#3114](https://github.com/clash-lang/clash-compiler/pull/3114)+* Clash drops cached normalization result. [#3109](https://github.com/clash-lang/clash-compiler/issues/3109)+* Fix `holdReset` glitch behavior for asynchronous resets and wrong hold cycles for sync resets. [#3115](https://github.com/clash-lang/clash-compiler/issues/3115)+* Do not emit source locations if `-g` is not passed to clash [#3132](https://github.com/clash-lang/clash-compiler/issues/3132)+* `clash-ghc`: Remove `Opt_LlvmTBAA` from unwanted flags [#2508](https://github.com/clash-lang/clash-compiler/issues/2823)+ ## 1.8.4 *Nov 6th 2025*  Changed:@@ -314,7 +334,7 @@ Added:   * `Clash.Class.Counter`: a class that defines a odometer-style supercounter. [#1763](https://github.com/clash-lang/clash-compiler/pull/1763)   * `isLike` function for BitPack types. [#1774](https://github.com/clash-lang/clash-compiler/pull/1774)-  * 'seqErrorX' for catching both `XException` and `ErrorCall`. [#1774](https://github.com/clash-lang/clash-compiler/pull/1774)+  * 'seqErrorX' for catching both `XException` and `ErrorCall`. [#1839](https://github.com/clash-lang/clash-compiler/pull/1839)   * `Clash.Explicit.BlockRam.File.memFile`, a function for creating the contents of the data files this blockRAM uses. Can also be imported from `Clash.Prelude.BlockRam.File`, `Clash.Prelude.ROM.File` and `Clash.Explicit.ROM.File`. [#1840](https://github.com/clash-lang/clash-compiler/pull/1840)   * Support for Yosys compatible SVA to `Clash.Verification`. This enables formal verification using SymbiYosis for Verilog and SystemVerilog. [#1798](https://github.com/clash-lang/clash-compiler/pull/1798)   * `Clash.Explicit.Signal.Delayed.forward`, a function that can be used to retime a `DSignal` into the future without applying any logic. [#1882](https://github.com/clash-lang/clash-compiler/pull/1882)
clash-ghc.cabal view
@@ -1,6 +1,6 @@ Cabal-version:        2.2 Name:                 clash-ghc-Version:              1.8.4+Version:              1.8.5 Synopsis:             Clash: a functional hardware description language - GHC frontend Description:   Clash is a functional hardware description language that borrows both its@@ -172,11 +172,11 @@                       transformers              >= 0.5.2.0  && < 0.7,                       unordered-containers      >= 0.2.1.0  && < 0.3, -                      clash-lib                 == 1.8.4,-                      clash-prelude             == 1.8.4,-                      ghc-typelits-extra        >= 0.3.2    && < 0.5,-                      ghc-typelits-knownnat     >= 0.6      && < 0.8,-                      ghc-typelits-natnormalise >= 0.6      && < 0.8,+                      clash-lib                 == 1.8.5,+                      clash-prelude             == 1.8.5,+                      ghc-typelits-extra        >= 0.4      && < 0.6,+                      ghc-typelits-knownnat     >= 0.7.2    && < 0.9,+                      ghc-typelits-natnormalise >= 0.7.2    && < 0.10,                       deepseq                   >= 1.3.0.2  && < 1.6,                       time                      >= 1.4.0.1  && < 1.15,                       ghc-boot                  >= 8.6.0    && < 9.11,
src-bin-8.10/Clash/Main.hs view
@@ -237,9 +237,12 @@   (dflags3, fileish_args, dynamicFlagWarnings) <-       GHC.parseDynamicFlags dflags2 args -  -- Propagate -Werror to Clash+  -- Propagate some GHC flags to Clash   liftIO . modifyIORef' clashOpts $ \opts ->-    opts { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3) }+    opts+      { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3)+      , opt_ghcDebugLevel = debugLevel dflags3+      }    let dflags4 = case lang of                 HscInterpreted | not (gopt Opt_ExternalInterpreter dflags3) ->
src-bin-861/Clash/Main.hs view
@@ -236,9 +236,12 @@   (dflags3, fileish_args, dynamicFlagWarnings) <-       GHC.parseDynamicFlags dflags2 args -  -- Propagate -Werror to Clash+  -- Propagate some GHC flags to Clash   liftIO . modifyIORef' clashOpts $ \opts ->-    opts { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3) }+    opts+      { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3)+      , opt_ghcDebugLevel = debugLevel dflags3+      }    let dflags4 = case lang of                 HscInterpreted | not (gopt Opt_ExternalInterpreter dflags3) ->
src-bin-881/Clash/Main.hs view
@@ -231,9 +231,12 @@   (dflags3, fileish_args, dynamicFlagWarnings) <-       GHC.parseDynamicFlags dflags2 args -  -- Propagate -Werror to Clash+  -- Propagate some GHC flags to Clash   liftIO . modifyIORef' clashOpts $ \opts ->-    opts { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3) }+    opts+      { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3)+      , opt_ghcDebugLevel = debugLevel dflags3+      }    let dflags4 = case lang of                 HscInterpreted | not (gopt Opt_ExternalInterpreter dflags3) ->
src-bin-9.0/Clash/Main.hs view
@@ -238,9 +238,12 @@   (dflags3, fileish_args, dynamicFlagWarnings) <-       GHC.parseDynamicFlags dflags2 args -  -- Propagate -Werror to Clash+  -- Propagate some GHC flags to Clash   liftIO . modifyIORef' clashOpts $ \opts ->-    opts { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3) }+    opts+      { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3)+      , opt_ghcDebugLevel = debugLevel dflags3+      }    let dflags4 = case lang of                 HscInterpreted | not (gopt Opt_ExternalInterpreter dflags3) ->
src-bin-9.10.1/Clash/Main.hs view
@@ -268,9 +268,12 @@   (dflags3, fileish_args, dynamicFlagWarnings) <-       GHC.parseDynamicFlags logger2 dflags2 args' --- Propagate -Werror to Clash+  -- Propagate some GHC flags to Clash   liftIO . modifyIORef' clashOpts $ \opts ->-    opts { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3) }+    opts+      { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3)+      , opt_ghcDebugLevel = debugLevel dflags3+      }    let dflags4 = if backendNeedsFullWays bcknd &&                    not (gopt Opt_ExternalInterpreter dflags3)
src-bin-9.10.2/Clash/Main.hs view
@@ -268,9 +268,12 @@   (dflags3, fileish_args, dynamicFlagWarnings) <-       GHC.parseDynamicFlags logger2 dflags2 args' -  -- Propagate -Werror to Clash+  -- Propagate some GHC flags to Clash   liftIO . modifyIORef' clashOpts $ \opts ->-    opts { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3) }+    opts+      { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3)+      , opt_ghcDebugLevel = debugLevel dflags3+      }    let dflags4 = if backendNeedsFullWays bcknd &&                    not (gopt Opt_ExternalInterpreter dflags3)
src-bin-9.2/Clash/Main.hs view
@@ -248,9 +248,12 @@   (dflags3, fileish_args, dynamicFlagWarnings) <-       GHC.parseDynamicFlags logger dflags2 args' -  -- Propagate -Werror to Clash+  -- Propagate some GHC flags to Clash   liftIO . modifyIORef' clashOpts $ \opts ->-    opts { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3) }+    opts+      { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3)+      , opt_ghcDebugLevel = debugLevel dflags3+      }    let dflags4 = case bcknd of                 Interpreter | not (gopt Opt_ExternalInterpreter dflags3) ->
src-bin-9.4/Clash/Main.hs view
@@ -262,9 +262,12 @@   (dflags3, fileish_args, dynamicFlagWarnings) <-       GHC.parseDynamicFlags logger2 dflags2 args' -  -- Propagate -Werror to Clash+  -- Propagate some GHC flags to Clash   liftIO . modifyIORef' clashOpts $ \opts ->-    opts { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3) }+    opts+      { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3)+      , opt_ghcDebugLevel = debugLevel dflags3+      }    let dflags4 = case bcknd of                 Interpreter | not (gopt Opt_ExternalInterpreter dflags3) ->
src-bin-9.6/Clash/Main.hs view
@@ -268,9 +268,12 @@   (dflags3, fileish_args, dynamicFlagWarnings) <-       GHC.parseDynamicFlags logger2 dflags2 args' -  -- Propagate -Werror to Clash+  -- Propagate some GHC flags to Clash   liftIO . modifyIORef' clashOpts $ \opts ->-    opts { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3) }+    opts+      { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3)+      , opt_ghcDebugLevel = debugLevel dflags3+      }    let dflags4 = if backendNeedsFullWays bcknd &&                    not (gopt Opt_ExternalInterpreter dflags3)
src-bin-9.8/Clash/Main.hs view
@@ -266,9 +266,12 @@   (dflags3, fileish_args, dynamicFlagWarnings) <-       GHC.parseDynamicFlags logger2 dflags2 args' -  -- Propagate -Werror to Clash+  -- Propagate some GHC flags to Clash   liftIO . modifyIORef' clashOpts $ \opts ->-    opts { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3) }+    opts+      { opt_werror = EnumSet.member Opt_WarnIsError (generalFlags dflags3)+      , opt_ghcDebugLevel = debugLevel dflags3+      }    let dflags4 = if backendNeedsFullWays bcknd &&                    not (gopt Opt_ExternalInterpreter dflags3)
src-ghc/Clash/GHC/GHC2Core.hs view
@@ -454,6 +454,9 @@           -- xToErrorCtx :: forall a. String -> a -> a           | [_ty, _msg, x] <- args           = term x+        go "Clash.Annotations.SynthesisAttributes.annotateReg" args+          | [ Type nTy, _domTy, _aTy, attrs, x] <- args+          = C.Tick <$> (C.Attributes <$> coreToType nTy <*> term attrs) <*> term x         go nm args           | Just n <- parseBundle "bundle" nm             -- length args = domain tyvar + signal arg + number of type vars@@ -635,6 +638,8 @@               -> return (nameModTerm C.SetName xType)               | f == "Clash.XException.xToErrorCtx"               -> return (xToErrorCtxTerm xType)+              | f == "Clash.Annotations.SynthesisAttributes.annotateReg"+              -> return (annotateRegTerm xType)               | x `elem` unlocs               -> return (C.Prim (C.PrimInfo xNameS xType wi C.SingleResult C.NoUnfolding))               | otherwise@@ -1563,6 +1568,36 @@       C.Var xId)))  xToErrorCtxTerm ty = error $ $(curLoc) ++ show ty++-- | Given the type+--+-- > forall n dom a . Vec n (Attr String) -> Signal dom a -> Signal dom a+--+-- Generate the term:+--+-- > /\(n:Nat) (dom:Symbol) (a:Type).\(attrs:Vec n (Attr String)) (x:Signal dom a).<TICK attrs> x+annotateRegTerm+  :: C.Type+  -> C.Term+annotateRegTerm (C.ForAllTy nTV (C.ForAllTy domTV (C.ForAllTy aTV funTy)))+  | C.FunTy attrTy rTy <- C.tyView funTy+  , C.FunTy xTy _ <- C.tyView rTy+  = let+      -- Safe to use `mkUnsafeSystemName` here, because we're building the+      -- identity \x.x, so any shadowing of 'x' would be the desired behavior.+      xName            = C.mkUnsafeSystemName "x" 0+      xId              = C.mkLocalId xTy xName+      attrName         = C.mkUnsafeSystemName "attrs" 1+      attrId           = C.mkLocalId attrTy attrName+    in+      C.TyLam nTV (+      C.TyLam domTV (+      C.TyLam aTV (+      C.Lam   attrId (+      C.Lam   xId (+      C.Tick (C.Attributes (C.VarTy nTV) (C.Var attrId)) (C.Var xId))))))++annotateRegTerm ty = error ($(curLoc) ++ show ty)  isDataConWrapId :: Id -> Bool isDataConWrapId v = case idDetails v of
src-ghc/Clash/GHC/LoadModules.hs view
@@ -1061,9 +1061,6 @@                , Opt_RegsGraph -- Don't care                , Opt_RegsGraph -- Don't care                , Opt_PedanticBottoms -- Stops eta-expansion through case: avoid-#if !MIN_VERSION_ghc(9,10,0)-               , Opt_LlvmTBAA -- Don't care-#endif                , Opt_CmmSink -- Don't care                , Opt_CmmElimCommonBlocks -- Don't care                , Opt_OmitYields -- Don't care