clash-ghc 1.6.1 → 1.6.2
raw patch · 3 files changed
+52/−19 lines, 3 filesdep ~Win32dep ~clash-libdep ~clash-preludePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: Win32, clash-lib, clash-prelude, ghc
API changes (from Hackage documentation)
Files
- CHANGELOG.md +13/−0
- clash-ghc.cabal +15/−5
- src-ghc/Clash/GHC/Evaluator/Primitive.hs +24/−14
CHANGELOG.md view
@@ -1,4 +1,17 @@ # Changelog for the Clash project++## 1.6.2 *Fed 25th 2022*+Fixed:+ * Clash now compiles for users of Clang - i.e., all macOS users.+ * The `trueDualPortBlockRam` model did not accurately simulate concurrent active ports, thus causing a Haskell/HDL simulation mismatch for `asyncFIFOSynchronizer`.+ * `trueDualPortBlockRam` Haskell/HDL simulation mismatch for port enable.+ * Sometimes `trueDualPortBlockRam` swapped the names of the ports in exception messages. [#2102](https://github.com/clash-lang/clash-compiler/pull/2102)+ * The evaluator rule for unpack{Float,Double}# are now corrected to return boxed float and double instead of unboxed literals. [#2097](https://github.com/clash-lang/clash-compiler/issues/2097)++Changed:+ * The `trueDualPortBlockRam` model now only models read/write conflicts for concurrent active ports+ * The `trueDualPortBlockRam` model now models write/write conflicts for concurrent active ports+ ## 1.6.1 *Feb 11th 2022* Changed: * We accidentally released `v1.6.0` with the Cabal flag `multiple-hidden` enabled. This is an experimental feature, supposed to be disabled by default for releases. `v1.6.1` disables it again.
clash-ghc.cabal view
@@ -1,6 +1,6 @@ Cabal-version: 2.2 Name: clash-ghc-Version: 1.6.1+Version: 1.6.2 Synopsis: Clash: a functional hardware description language - GHC frontend Description: Clash is a functional hardware description language that borrows both its@@ -141,7 +141,6 @@ directory >= 1.2 && < 1.4, extra >= 1.6 && < 1.8, filepath >= 1.3 && < 1.5,- ghc >= 8.6.0 && < 9.1, process >= 1.2 && < 1.7, hashable >= 1.1.2.3 && < 1.5, haskeline >= 0.7.0.3 && < 0.9,@@ -152,8 +151,8 @@ transformers >= 0.5.2.0 && < 0.7, unordered-containers >= 0.2.1.0 && < 0.3, - clash-lib == 1.6.1,- clash-prelude == 1.6.1,+ clash-lib == 1.6.2,+ clash-prelude == 1.6.2, concurrent-supply >= 0.1.7 && < 0.2, ghc-typelits-extra >= 0.3.2 && < 0.5, ghc-typelits-knownnat >= 0.6 && < 0.8,@@ -169,6 +168,17 @@ template-haskell >= 2.8.0.0 && < 2.18, utf8-string >= 1.0.0.0 && < 1.1.0.0, vector >= 0.11 && < 1.0++ if os(windows)+ -- 8.8 is broken on Windows - it randomly segfaults+ Build-Depends: ghc >= 8.6.0 && < 8.8.0 || >= 8.10.0 && < 9.1+ elif os(darwin)+ -- 8.10 is broken on macOS - it exits tests with status code -11+ Build-Depends: ghc >= 8.6.0 && < 8.10.0 || >= 9.0.0 && < 9.1+ else+ -- Unix+ Build-Depends: ghc >= 8.6.0 && < 9.1+ if impl(ghc >= 8.10.0) Build-Depends: exceptions >= 0.10.4 && < 0.11, @@ -182,7 +192,7 @@ CPP-Options: -DUSE_GHC_PATHS=1 if os(windows)- Build-Depends: Win32 >= 2.3.1 && < 2.12+ Build-Depends: Win32 >= 2.3.1 && < 2.14 else Build-Depends: unix >= 2.7.1 && < 2.9
src-ghc/Clash/GHC/Evaluator/Primitive.hs view
@@ -96,7 +96,7 @@ (TyConMap, TyConName, tyConDataCons) import Clash.Core.TysPrim import Clash.Core.Util- (mkRTree,mkVec,tyNatSize,dataConInstArgTys,primCo, mkSelectorCase)+ (mkRTree,mkVec,tyNatSize,dataConInstArgTys,primCo, mkSelectorCase,undefinedPrims) import Clash.Core.Var (mkLocalId, mkTyVar) import Clash.Debug import Clash.GHC.GHC2Core (modNameM)@@ -121,9 +121,7 @@ isUndefinedPrimVal :: Value -> Bool isUndefinedPrimVal (PrimVal (PrimInfo{primName}) _ _) =- primName `elem` [ Text.pack (show 'NP.undefined)- ,"Clash.XException.errorX"- ,"Control.Exception.Base.absentError"]+ primName `elem` undefinedPrims isUndefinedPrimVal _ = False -- | Evaluation of primitive operations.@@ -1587,14 +1585,6 @@ | [Lit (NaturalLiteral n), _] <- args -> reduce (Literal (NaturalLiteral n)) - "GHC.Types.C#"- | isSubj- , [Lit (CharLiteral c)] <- args- -> let (_,tyView -> TyConApp charTcNm []) = splitFunForallTy ty- (Just charTc) = lookupUniqMap charTcNm tcm- [charDc] = tyConDataCons charTc- in reduce (mkApps (Data charDc) [Left (Literal (CharLiteral c))])- "GHC.Int.I8#" | isSubj , [Lit (IntLiteral i)] <- args@@ -1790,11 +1780,15 @@ "Clash.Class.BitPack.Internal.unpackFloat#" | [i] <- bitVectorLiterals' args- -> reduce . Literal . FloatLiteral $ unpack (toBV i :: BitVector 32)+ -> let resTy = getResultTy tcm ty tys+ val = unpack (toBV i :: BitVector 32)+ in reduce (mkFloatCLit tcm val resTy) "Clash.Class.BitPack.Internal.unpackDouble#" | [i] <- bitVectorLiterals' args- -> reduce . Literal . DoubleLiteral $ unpack (toBV i :: BitVector 64)+ -> let resTy = getResultTy tcm ty tys+ val = unpack (toBV i :: BitVector 64)+ in reduce (mkDoubleCLit tcm val resTy) -- expIndex# -- :: KnownNat m@@ -4187,6 +4181,22 @@ = Just (nTy,kn,(m,i),j) | otherwise = Nothing++mkFloatCLit :: TyConMap -> Word32 -> Type -> Term+mkFloatCLit tcm lit resTy =+ App (Data floatDc) (Literal (FloatLiteral lit))+ where+ (_, tyView -> TyConApp floatTcNm []) = splitFunForallTy resTy+ (Just floatTc) = lookupUniqMap floatTcNm tcm+ [floatDc] = tyConDataCons floatTc++mkDoubleCLit :: TyConMap -> Word64 -> Type -> Term+mkDoubleCLit tcm lit resTy =+ App (Data doubleDc) (Literal (DoubleLiteral lit))+ where+ (_, tyView -> TyConApp doubleTcNm []) = splitFunForallTy resTy+ (Just doubleTc) = lookupUniqMap doubleTcNm tcm+ [doubleDc] = tyConDataCons doubleTc -- From an argument list to function of type -- forall n. KnownNat n => ...