packages feed

clash-lib 1.6.4 → 1.6.5

raw patch · 15 files changed

+71/−39 lines, 15 filesdep ~aesondep ~clash-preludedep ~lensPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: aeson, clash-prelude, lens

API changes (from Hackage documentation)

- Clash.Rewrite.Types: bindings :: forall extra_a3VI0. Lens' (RewriteState extra_a3VI0) BindingMap
+ Clash.Rewrite.Types: bindings :: forall extra_a3VQc. Lens' (RewriteState extra_a3VQc) BindingMap
- Clash.Rewrite.Types: curFun :: forall extra_a3VI0. Lens' (RewriteState extra_a3VI0) (Id, SrcSpan)
+ Clash.Rewrite.Types: curFun :: forall extra_a3VQc. Lens' (RewriteState extra_a3VQc) (Id, SrcSpan)
- Clash.Rewrite.Types: extra :: forall extra_a3VI0 extra_a3VPM. Lens (RewriteState extra_a3VI0) (RewriteState extra_a3VPM) extra_a3VI0 extra_a3VPM
+ Clash.Rewrite.Types: extra :: forall extra_a3VQc extra_a3VXY. Lens (RewriteState extra_a3VQc) (RewriteState extra_a3VXY) extra_a3VQc extra_a3VXY
- Clash.Rewrite.Types: globalHeap :: forall extra_a3VI0. Lens' (RewriteState extra_a3VI0) PrimHeap
+ Clash.Rewrite.Types: globalHeap :: forall extra_a3VQc. Lens' (RewriteState extra_a3VQc) PrimHeap
- Clash.Rewrite.Types: nameCounter :: forall extra_a3VI0. Lens' (RewriteState extra_a3VI0) Int
+ Clash.Rewrite.Types: nameCounter :: forall extra_a3VQc. Lens' (RewriteState extra_a3VQc) Int
- Clash.Rewrite.Types: transformCounter :: forall extra_a3VI0. Lens' (RewriteState extra_a3VI0) Word
+ Clash.Rewrite.Types: transformCounter :: forall extra_a3VQc. Lens' (RewriteState extra_a3VQc) Word
- Clash.Rewrite.Types: transformCounters :: forall extra_a3VI0. Lens' (RewriteState extra_a3VI0) (HashMap Text Word)
+ Clash.Rewrite.Types: transformCounters :: forall extra_a3VQc. Lens' (RewriteState extra_a3VQc) (HashMap Text Word)
- Clash.Rewrite.Types: uniqSupply :: forall extra_a3VI0. Lens' (RewriteState extra_a3VI0) Supply
+ Clash.Rewrite.Types: uniqSupply :: forall extra_a3VQc. Lens' (RewriteState extra_a3VQc) Supply
- Clash.Rewrite.Types: workFreeBinders :: forall extra_a3VI0. Lens' (RewriteState extra_a3VI0) (VarEnv Bool)
+ Clash.Rewrite.Types: workFreeBinders :: forall extra_a3VQc. Lens' (RewriteState extra_a3VQc) (VarEnv Bool)

Files

CHANGELOG.md view
@@ -1,4 +1,15 @@ # Changelog for the Clash project+## 1.6.5 *Jun 27th 2023*++Fixed:++ * Support building with all combinations of specific versions of our dependencies `hashable` and `primitive`. [#2485](https://github.com/clash-lang/clash-compiler/pull/2485)+ * The Haskell simulation of the PLL lock signal in `Clash.Clocks` (used by `Clash.Intel.ClockGen`) is fixed: the signal is now unasserted for the time the reset input is asserted and vice versa, and no longer crashes the simulation. HDL generation is unchanged. The PLL functions now have an additional constraint: `KnownDomain pllLock`. [#2420](https://github.com/clash-lang/clash-compiler/pull/2420)++Changed:++ * Export the constructor for the `Wrapping` type in the `Clash.Num.Wrapping` module. See [#2292](https://github.com/clash-lang/clash-compiler/issues/2292)+ ## 1.6.4 *Aug 30th 2022* Fixed: 
clash-lib.cabal view
@@ -1,6 +1,6 @@ Cabal-version:        2.2 Name:                 clash-lib-Version:              1.6.4+Version:              1.6.5 Synopsis:             Clash: a functional hardware description language - As a library Description:   Clash is a functional hardware description language that borrows both its@@ -126,7 +126,7 @@                       RecordWildCards                       TemplateHaskell -  Build-depends:      aeson                   >= 0.6.2.0  && < 2.1,+  Build-depends:      aeson                   >= 0.6.2.0  && < 2.2,                       aeson-pretty            >= 0.8      && < 0.9,                       ansi-terminal           >= 0.8.0.0  && < 0.12,                       array,@@ -136,7 +136,7 @@                       base16-bytestring       >= 0.1.1    && < 1.1,                       binary                  >= 0.8.5    && < 0.11,                       bytestring              >= 0.10.0.2 && < 0.12,-                      clash-prelude           == 1.6.4,+                      clash-prelude           == 1.6.5,                       concurrent-supply       >= 0.1.7    && < 0.2,                       containers              >= 0.5.0.0  && < 0.7,                       cryptohash-sha256       >= 0.11     && < 0.12,@@ -154,7 +154,7 @@                       haskell-src-meta        >= 0.8      && < 0.9,                       hint                    >= 0.7      && < 0.10,                       interpolate             >= 0.2.0    && < 1.0,-                      lens                    >= 4.10     && < 5.2.0,+                      lens                    >= 4.10     && < 5.3,                       mtl                     >= 2.1.2    && < 2.3,                       ordered-containers      >= 0.2      && < 0.3,                       prettyprinter           >= 1.2.0.1  && < 1.8,
prims/verilog/Clash_Explicit_Testbench.primitives.yaml view
@@ -73,7 +73,7 @@         `ifndef VERILATOR         #~LONGESTPERIOD0 forever begin           if (~ ~ARG[1]) begin-            $finish;+            $finish(0);           end           ~SYM[0] = ~ ~SYM[0];           #~SYM[1];
prims/vhdl/Clash_Xilinx_DDR.primitives.yaml view
@@ -21,9 +21,9 @@       ~GENSYM[~COMPNAME_IDDR][0] : block         signal ~GENSYM[dataout_l][1] : ~TYP[7];         signal ~GENSYM[dataout_h][2] : ~TYP[7];-        signal ~GENSYM[d][3]         : ~TYP[7];~IF ~ISACTIVEENABLE[4] ~THEN+        signal ~GENSYM[d][3]         : ~TYP[7];~IF ~ISACTIVEENABLE[6] ~THEN         signal ~GENSYM[ce_logic][4]: std_logic;~ELSE ~FI-      begin~IF ~ISACTIVEENABLE[4] ~THEN+      begin~IF ~ISACTIVEENABLE[6] ~THEN         ~SYM[4] <= '1' when (~ARG[6]) else '0';~ELSE ~FI         ~SYM[3] <= ~ARG[7]; 
src/Clash/Backend.hs view
@@ -27,6 +27,7 @@  import Clash.Driver.Types (ClashOpts) import {-# SOURCE #-} Clash.Netlist.Types+  (Component, Declaration, Expr, HWType, Identifier, IdentifierSet, HasIdentifierSet) import Clash.Netlist.BlackBox.Types  import Clash.Signal.Internal                (VDomainConfiguration)
src/Clash/Backend/SystemVerilog.hs view
@@ -1099,7 +1099,7 @@ expr_ _ (Identifier _ (Just (Indexed ((BitVector _),_,0)))) = do   iw <- Ap $ use intWidth   traceIf True ($(curLoc) ++ "WARNING: synthesizing bitvector mask to dontcare") $-    verilogTypeErrValue (Signed iw)+    verilogTypeErrValue (Unsigned iw)  -- See [Note] bitvector projection expr_ _ (Identifier id_ (Just (Indexed ((BitVector w),_,1)))) = do
src/Clash/Backend/Verilog.hs view
@@ -970,7 +970,7 @@ expr_ _ (Identifier _ (Just (Indexed ((BitVector _),_,0)))) = do   iw <- Ap $ use intWidth   traceIf True ($(curLoc) ++ "WARNING: synthesizing bitvector mask to dontcare") $-    verilogTypeErrValue (Signed iw)+    verilogTypeErrValue (Unsigned iw)  -- See [Note] bitvector projection expr_ _ (Identifier id_ (Just (Indexed ((BitVector w),_,1)))) = do
src/Clash/Driver.hs view
@@ -142,7 +142,6 @@ import           Clash.Primitives.Types import           Clash.Signal.Internal import           Clash.Unique                     (Unique, getUnique)-import           Clash.Util.Interpolate           (i) import           Clash.Util   (ClashException(..), reportTimeDiff,    wantedLanguageExtensions, unwantedLanguageExtensions, curLoc)@@ -187,7 +186,7 @@             in               go newLam (take n portNames1 ++ ps)           PortName nm ->-            throw (flip (ClashException sp) Nothing $ [i|+            throw (flip (ClashException sp) Nothing $ [I.i|               Couldn't separate clock, reset, or enable from a product type due               to a malformed Synthesize annotation. All clocks, resets, and               enables should be given a unique port name. Type to be split:@@ -810,7 +809,7 @@   -- Extra newlines are aggressively inserted so the quasiquoter doesn't wrap   -- the outlines lines in the file. It doesn't matter for code inside main,   -- but is fatal for the #include directives.-  pretty $ Data.Text.pack [i|+  pretty $ Data.Text.pack [I.i|     \#include <cstdlib>      \#include <verilated.h>
src/Clash/Netlist/Id.hs view
@@ -56,7 +56,7 @@ import           Clash.Annotations.Primitive (HDL (..)) import           Clash.Core.Var (Id) import           Clash.Debug (debugIsOn)-import {-# SOURCE #-} Clash.Netlist.Types+import           Clash.Netlist.Types   (PreserveCase(..), HasIdentifierSet(..), IdentifierSet(..), Identifier(..),    IdentifierType(..), IdentifierSetMonad(identifierSetM)) import qualified Data.HashSet as HashSet
src/Clash/Netlist/Id/Internal.hs view
@@ -11,7 +11,7 @@ import           Clash.Core.Name (Name(nameOcc)) import           Clash.Core.Var (Id, varName) import           Clash.Debug (debugIsOn)-import {-# SOURCE #-} Clash.Netlist.Types+import           Clash.Netlist.Types   (PreserveCase(..), IdentifierSet(..), Identifier(..), FreshCache,    IdentifierType(..)) import           Control.Arrow (second)
src/Clash/Netlist/Types.hs view
@@ -84,7 +84,7 @@ import Clash.Annotations.BitRepresentation.Internal   (CustomReprs, DataRepr', ConstrRepr') -import {-# SOURCE #-} qualified Clash.Netlist.Id as Id+import {-# SOURCE #-} qualified Clash.Netlist.Id as Id (toText)  -- | Structure describing a top entity: it's id and its port annotations. data TopEntityT = TopEntityT@@ -236,7 +236,7 @@     -- name of 'foo' and an extension of [6, 5] would render as 'foo_5_6'. Note     -- that extensions are stored in reverse order for easier manipulation.     , i_idType :: !IdentifierType-    -- ^ See "IdentifierType".+    -- ^ See 'IdentifierType'.     , i_hdl :: !HDL     -- ^ HDL this identifier is generated for.     , i_provenance :: !CallStack
src/Clash/Normalize/Transformations/Specialize.hs view
@@ -6,7 +6,7 @@   License    :  BSD2 (see the file LICENSE)   Maintainer :  QBayLogic B.V. <devops@qbaylogic.com> -  Transformations for specialisation.+  Transformations for specialization -}  {-# LANGUAGE CPP #-}@@ -127,10 +127,10 @@ --       D a b -> h a b -- @ ----- is very bad because 'b' in 'h a b' is now bound by the pattern instead of the+-- is very bad because @b@ in @h a b@ is now bound by the pattern instead of the -- newly introduced let-binding ----- instead me must deshadow w.r.t. the new variable and rewrite to:+-- instead we must deshadow w.r.t. the new variable and rewrite to: -- -- @ -- let b = f x y@@ -158,8 +158,10 @@ -- whether @x@ is in the current InScopeSet, and deshadow if that's the case, -- i.e. we then rewrite to: --+-- @ -- let x1 = u -- in  e [x:=x1]+-- @ -- -- Case 3. --@@ -282,7 +284,7 @@   goCaseArg _ ty ls [] = return (ty,ls,[]) {-# SCC appProp #-} --- | Specialise functions on arguments which are constant, except when they+-- | Specialize functions on arguments which are constant, except when they -- are clock, reset generators. constantSpec :: HasCallStack => NormRewrite constantSpec ctx@(TransformContext is0 tfCtx) e@(App e1 e2)@@ -430,7 +432,7 @@               (fId,inl',specArg') <- case specArg of                 Left a@(collectArgsTicks -> (Var g,gArgs,_gTicks)) -> if isPolyFun tcm a                     then do-                      -- In case we are specialising on an argument that is a+                      -- In case we are specializing on an argument that is a                       -- global function then we use that function's name as the                       -- name of the specialized higher-order function.                       -- Additionally, we will return the body of the global@@ -469,7 +471,7 @@           bs' -> init bs' ++ bs         go bs _ = bs --- Specialising non Var's is used by nonRepANF+-- Specializing non Var's is used by nonRepANF specialize' _ctx _ (appE,args,ticks) (Left specArg) = do   -- Create binders and variable references for free variables in 'specArg'   let (specBndrs,specVars) = specArgBndrsAndVars (Left specArg)@@ -497,10 +499,10 @@ -- yield (alpha equivalent) results for the same specialization. While collecting -- free variables in a given term or type it should therefore keep a stable -- ordering based on the order in which it finds free vars. To see why,--- consider the following two pseudo-code calls to 'specialise':+-- consider the following two pseudo-code calls to 'specialize': -----     specialise {f ('a', x[123], y[456])}---     specialise {f ('b', x[456], y[123])}+--     specialize {f ('a', x[123], y[456])}+--     specialize {f ('b', x[456], y[123])} -- -- Collecting the binders in a VarSet would yield the following (unique ordered) -- sets:@@ -558,12 +560,12 @@            specialize ctx (App e1 e2')          else return e   where-    -- | If the argument on which we're specialising ia an internal function,+    -- | If the argument on which we're specializing is an internal function,     -- one created by the compiler, then inline that function before we-    -- specialise.+    -- specialize.     ---    -- We need to do this because otherwise the specialisation history won't-    -- recognize the new specialisation argument as something the function has+    -- We need to do this because otherwise the specialization history won't+    -- recognize the new specialization argument as something the function has     -- already been specialized on     inlineInternalSpecialisationArgument       :: Term@@ -596,8 +598,8 @@ {-# SCC typeSpec #-}  -- | Specialize functions on arguments which are zero-width. These arguments--- can have only one possible value, and specialising on this value may create--- additional oppourtunities for transformations to fire.+-- can have only one possible value, and specializing on this value may create+-- additional opportunities for transformations to fire. -- -- As we can't remove zero-width arguements (as transformations cannot change -- the type of a term), we instead substitute all occurances of a lambda-bound
src/Clash/Primitives/Types.hs view
@@ -32,7 +32,7 @@   , CompiledPrimMap   ) where -import {-# SOURCE #-} Clash.Netlist.Types+import {-# SOURCE #-} Clash.Netlist.Types (BlackBox) import           Clash.Annotations.Primitive  (PrimitiveGuard) import           Clash.Core.Term (WorkInfo (..)) import           Clash.Netlist.BlackBox.Types
src/Data/Primitive/ByteArray/Extra.hs view
@@ -3,13 +3,34 @@  module Data.Primitive.ByteArray.Extra where +import Data.Binary (Binary(..))+import Data.Primitive.ByteArray (ByteArray)+import GHC.Exts (IsList(..))+ #if !MIN_VERSION_primitive(0,7,1) import Control.DeepSeq (NFData(..)) #endif-import Data.Binary (Binary(..))++-- hashable 1.4.2 defines Hashable for Data.Array.Byte.ByteArray, either from+-- base or from the data-array-byte compat package for GHC < 9.4.+-- primitive 0.8.0.0 re-exports this ByteArray.+#if !MIN_VERSION_primitive(0,8,0)+-- In primitive < 0.8.0.0, its ByteArray is a distinct type from+-- Data.Array.Byte.ByteArray (insofar as the latter even exists).+#define DEFINE_HASHABLE_BYTEARRAY+#elif !MIN_VERSION_hashable(1,4,1)+-- hashable < 1.4.1 doesn't define a Hashable ByteArray instance at all.+#define DEFINE_HASHABLE_BYTEARRAY+#elif !MIN_VERSION_hashable(1,4,2)+-- hashable 1.4.1 defines hashable for the ByteArray added to base 4.17.+#if !MIN_VERSION_base(4,17,0)+#define DEFINE_HASHABLE_BYTEARRAY+#endif+#endif++#ifdef DEFINE_HASHABLE_BYTEARRAY import Data.Hashable (Hashable(..))-import Data.Primitive.ByteArray (ByteArray)-import GHC.Exts (IsList(..))+#endif  #if !MIN_VERSION_primitive(0,7,1) instance NFData ByteArray where@@ -20,6 +41,7 @@   get = fmap fromList get   put = put . toList +#ifdef DEFINE_HASHABLE_BYTEARRAY instance Hashable ByteArray where   hashWithSalt salt = hashWithSalt salt . toList-+#endif
tests/Clash/Tests/Netlist/Id.hs view
@@ -24,8 +24,6 @@ import Data.Text (Text) import Data.Text.Encoding (decodeUtf8) import Test.QuickCheck.Utf8-import Text.Show.Pretty (ppShow)-import Debug.Trace  newtype NonEmptyText = NonEmptyText Text deriving (Show) newtype ArbitraryText = ArbitraryText Text deriving (Show)@@ -123,7 +121,6 @@         id0 <- Id.addRaw "LED"         put old         Id.add id0-        traceM . ppShow =<< get         id1 <- Id.toText <$> Id.make "led"         pure [ testCase "id1 == led_0" $ id1 @?= "led_0" ]