clash-lib 1.4.3 → 1.4.4
raw patch · 6 files changed
+53/−14 lines, 6 filesdep ~aesondep ~clash-preludedep ~prettyprinterPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: aeson, clash-prelude, prettyprinter, time, transformers
API changes (from Hackage documentation)
- Clash.Rewrite.Types: bindings :: forall extra_a3uoJ. Lens' (RewriteState extra_a3uoJ) BindingMap
+ Clash.Rewrite.Types: bindings :: forall extra_a3uA9. Lens' (RewriteState extra_a3uA9) BindingMap
- Clash.Rewrite.Types: curFun :: forall extra_a3uoJ. Lens' (RewriteState extra_a3uoJ) (Id, SrcSpan)
+ Clash.Rewrite.Types: curFun :: forall extra_a3uA9. Lens' (RewriteState extra_a3uA9) (Id, SrcSpan)
- Clash.Rewrite.Types: extra :: forall extra_a3uoJ extra_a3ux9. Lens (RewriteState extra_a3uoJ) (RewriteState extra_a3ux9) extra_a3uoJ extra_a3ux9
+ Clash.Rewrite.Types: extra :: forall extra_a3uA9 extra_a3uIz. Lens (RewriteState extra_a3uA9) (RewriteState extra_a3uIz) extra_a3uA9 extra_a3uIz
- Clash.Rewrite.Types: globalHeap :: forall extra_a3uoJ. Lens' (RewriteState extra_a3uoJ) PrimHeap
+ Clash.Rewrite.Types: globalHeap :: forall extra_a3uA9. Lens' (RewriteState extra_a3uA9) PrimHeap
- Clash.Rewrite.Types: nameCounter :: forall extra_a3uoJ. Lens' (RewriteState extra_a3uoJ) Int
+ Clash.Rewrite.Types: nameCounter :: forall extra_a3uA9. Lens' (RewriteState extra_a3uA9) Int
- Clash.Rewrite.Types: transformCounter :: forall extra_a3uoJ. Lens' (RewriteState extra_a3uoJ) Int
+ Clash.Rewrite.Types: transformCounter :: forall extra_a3uA9. Lens' (RewriteState extra_a3uA9) Int
- Clash.Rewrite.Types: uniqSupply :: forall extra_a3uoJ. Lens' (RewriteState extra_a3uoJ) Supply
+ Clash.Rewrite.Types: uniqSupply :: forall extra_a3uA9. Lens' (RewriteState extra_a3uA9) Supply
- Clash.Rewrite.Types: workFreeBinders :: forall extra_a3uoJ. Lens' (RewriteState extra_a3uoJ) (VarEnv Bool)
+ Clash.Rewrite.Types: workFreeBinders :: forall extra_a3uA9. Lens' (RewriteState extra_a3uA9) (VarEnv Bool)
Files
- CHANGELOG.md +7/−0
- clash-lib.cabal +10/−6
- src/Clash/Driver/Manifest.hs +1/−2
- src/Clash/Netlist/Util.hs +23/−4
- src/Clash/Primitives/Types.hs +11/−1
- src/Clash/Rewrite/WorkFree.hs +1/−1
CHANGELOG.md view
@@ -1,5 +1,12 @@ # Changelog for the Clash project +## 1.4.4 *Oct 11th 2021*+Fixed:++ * Dont' loop on recursive data types hiding behind type families [#1921](https://github.com/clash-lang/clash-compiler/issues/1921)+ * Recognize `enableGen` as workfree and don't duplicate registers [#1935](https://github.com/clash-lang/clash-compiler/issues/1935)++ ## 1.4.3 *Aug 8th 2021* Fixed:
clash-lib.cabal view
@@ -1,6 +1,6 @@ Cabal-version: 2.2 Name: clash-lib-Version: 1.4.3+Version: 1.4.4 Synopsis: Clash: a functional hardware description language - As a library Description: Clash is a functional hardware description language that borrows both its@@ -135,7 +135,7 @@ RecordWildCards TemplateHaskell - Build-depends: aeson >= 0.6.2.0 && < 1.6,+ Build-depends: aeson >= 0.6.2.0 && < 2.1, aeson-pretty >= 0.8 && < 0.9, ansi-terminal >= 0.8.0.0 && < 0.12, array,@@ -144,7 +144,7 @@ base16-bytestring >= 0.1.1 && < 1.1, binary >= 0.8.5 && < 0.11, bytestring >= 0.10.0.2 && < 0.12,- clash-prelude == 1.4.3,+ clash-prelude == 1.4.4, concurrent-supply >= 0.1.7 && < 0.2, containers >= 0.5.0.0 && < 0.7, cryptohash-sha256 >= 0.11 && < 0.12,@@ -167,7 +167,11 @@ mtl >= 2.1.2 && < 2.3, ordered-containers >= 0.2 && < 0.3, parsers >= 0.12.8 && < 1.0,- prettyprinter >= 1.2.0.1 && < 2.0,+ -- TODO upper bound needed on prettyprinter until we can+ -- switch to 1.7 on both nix and debian. 1.7.1 has+ -- DEPRECATED pragmas on the old module names which+ -- break CI+ prettyprinter >= 1.2.0.1 && < 1.7.1, pretty-show >= 1.9 && < 2.0, primitive >= 0.5.0.1 && < 1.0, process >= 1.1.0.2 && < 1.7,@@ -177,8 +181,8 @@ terminal-size >= 0.3 && < 0.4, text >= 1.2.2 && < 1.3, text-show >= 3.7 && < 3.10,- time >= 1.4.0.1 && < 1.12,- transformers >= 0.5.2.0 && < 0.6,+ time >= 1.4.0.1 && < 1.13,+ transformers >= 0.5.2.0 && < 0.7, trifecta >= 1.7.1.1 && < 2.2, utf8-string >= 1.0.1 && < 1.1, vector >= 0.11 && < 1.0,
src/Clash/Driver/Manifest.hs view
@@ -211,12 +211,11 @@ <*> parseWithRead "init_behavior" v <*> parseWithRead "reset_polarity" v - parseWithRead :: Read a => Text -> Aeson.Object -> Parser a parseWithRead field obj = do v <- obj .:? field case readMaybe =<< v of Just a -> pure a- Nothing -> fail $ "Could not read field: " <> Text.unpack field+ Nothing -> fail $ "Could not read field: " <> show field data UnexpectedModification -- | Clash generated file was modified
src/Clash/Netlist/Util.hs view
@@ -89,8 +89,8 @@ import Clash.Core.TermInfo import Clash.Core.TyCon (TyCon (FunTyCon), TyConName, TyConMap, tyConDataCons)-import Clash.Core.Type (Type (..), TypeView (..),- coreView1, splitTyConAppM, tyView, TyVar)+import Clash.Core.Type+ (Type (..), TyVar, TypeView (..), coreView1, normalizeType, splitTyConAppM, tyView) import Clash.Core.Util (substArgTys, tyLitShow) import Clash.Core.Var@@ -616,11 +616,30 @@ -- | Simple check if a TyCon is recursively defined.+--+-- Note [Look through type families in recursivity check]+--+-- Consider:+--+-- @+-- data SList :: [Type] -> Type where+-- SNil :: SList []+-- CSons :: a -> Sing (as :: [k]) -> SList (a:as)+--+-- type family Sing [a] = SList [a]+-- @+--+-- Without looking through type families, we would think that /SList/ is not+-- recursive. This lead to issue #1921 isRecursiveTy :: TyConMap -> TyConName -> Bool isRecursiveTy m tc = case tyConDataCons (m `lookupUniqMap'` tc) of [] -> False- dcs -> let argTyss = map dcArgTys dcs- argTycons = (map fst . catMaybes) $ (concatMap . map) splitTyConAppM argTyss+ dcs -> let argTyss = map dcArgTys dcs+ argTycons = (map fst . catMaybes)+ $ (concatMap . map)+ -- Note [Look through type families in recursivity check]+ (splitTyConAppM . normalizeType m)+ argTyss in tc `elem` argTycons -- | Determines if a Core type is translatable to a HWType given a function that
src/Clash/Primitives/Types.hs view
@@ -2,12 +2,14 @@ Copyright : (C) 2012-2016, University of Twente, 2016-2017, Myrtle Software Ltd 2018 , Google Inc.+ 2021 , QBayLogic B.V. License : BSD2 (see the file LICENSE)- Maintainer : Christiaan Baaij <christiaan.baaij@gmail.com>+ Maintainer : QBayLogic B.V. <devops@qbaylogic.com> Type and instance definitions for Primitive -} +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LambdaCase #-}@@ -51,6 +53,10 @@ import GHC.Generics (Generic) import GHC.Stack (HasCallStack) +#if MIN_VERSION_aeson(2,0,0)+import qualified Data.Aeson.KeyMap as KeyMap+#endif+ -- | An unresolved primitive still contains pointers to files. type UnresolvedPrimitive = Primitive Text ((TemplateFormat,BlackBoxFunctionName),Maybe TemplateSource) (Maybe S.Text) (Maybe TemplateSource) @@ -227,7 +233,11 @@ instance FromJSON UnresolvedPrimitive where parseJSON (Object v) =+#if MIN_VERSION_aeson(2,0,0)+ case KeyMap.toList v of+#else case H.toList v of+#endif [(conKey,Object conVal)] -> case conKey of "BlackBoxHaskell" -> do
src/Clash/Rewrite/WorkFree.hs view
@@ -150,7 +150,7 @@ case collectArgs e of (Prim p,_) -> Just (primName p == "Clash.Transformations.removedArg") (Var _, []) -> Just True- (Data _, []) -> Just True -- For Enable True/False+ (Data _, [_dom, Left (stripTicks -> Data _)]) -> Just True -- For Enable True/False (Literal _,_) -> Just True _ -> Just False else