packages feed

clash-ghc 0.6.1 → 0.6.2

raw patch · 6 files changed

+37/−14 lines, 6 filesdep +ghc-typelits-extradep ~clash-libdep ~clash-preludedep ~clash-systemverilog

Dependencies added: ghc-typelits-extra

Dependency ranges changed: clash-lib, clash-prelude, clash-systemverilog, clash-verilog, clash-vhdl

Files

CHANGELOG.md view
@@ -1,5 +1,13 @@ # Changelog for the [`clash-ghc`](http://hackage.haskell.org/package/clash-ghc) package +## 0.6.2 *October 21st 2015*+* New features:+  * Support `clash-prelude` 0.10.2++* Fixes bugs:+  * CLaSH interpreter was reading '.ghci' file instead of '.clashi' file [#87](https://github.com/clash-lang/clash-compiler/issues/87)+  * DEC: Subject and alternatives are not disjoint [#88](https://github.com/clash-lang/clash-compiler/issues/88)+ ## 0.6.1 *October 16th 2015* * New features:   * Support for `clash-prelude` 0.10.1
clash-ghc.cabal view
@@ -1,5 +1,5 @@ Name:                 clash-ghc-Version:              0.6.1+Version:              0.6.2 Synopsis:             CAES Language for Synchronous Hardware Description:   CλaSH (pronounced ‘clash’) is a functional hardware description language that@@ -94,11 +94,12 @@                       unbound-generics          >= 0.1 && < 0.3,                       unordered-containers      >= 0.2.1.0, -                      clash-lib                 >= 0.6.1 && < 0.7,-                      clash-systemverilog       >= 0.6.1,-                      clash-vhdl                >= 0.6.1,-                      clash-verilog             >= 0.6.1,-                      clash-prelude             >= 0.10.1,+                      clash-lib                 >= 0.6.2 && < 0.7,+                      clash-systemverilog       >= 0.6.2,+                      clash-vhdl                >= 0.6.2,+                      clash-verilog             >= 0.6.2,+                      clash-prelude             >= 0.10.2 && < 0.11,+                      ghc-typelits-extra        >= 0.1,                       ghc-typelits-natnormalise >= 0.3    if os(windows)
src-bin/InteractiveUI.hs view
@@ -475,7 +475,7 @@  withGhcAppData :: (FilePath -> IO a) -> IO a -> IO a withGhcAppData right left = do-    either_dir <- tryIO (getAppUserDataDirectory "ghc")+    either_dir <- tryIO (getAppUserDataDirectory "clash")     case either_dir of         Right dir ->             do createDirectoryIfMissing False dir `catchIO` \_ -> return ()@@ -488,16 +488,16 @@   let    read_dot_files = not (gopt Opt_IgnoreDotGhci dflags) -   current_dir = return (Just ".ghci")+   current_dir = return (Just ".clashi")     app_user_dir = liftIO $ withGhcAppData-                    (\dir -> return (Just (dir </> "ghci.conf")))+                    (\dir -> return (Just (dir </> "clashi.conf")))                     (return Nothing)     home_dir = do     either_dir <- liftIO $ tryIO (getEnv "HOME")     case either_dir of-      Right home -> return (Just (home </> ".ghci"))+      Right home -> return (Just (home </> ".clashi"))       _ -> return Nothing     canonicalizePath' :: FilePath -> IO (Maybe FilePath)@@ -587,13 +587,13 @@                 runCommands' hdle (Just $ hdle (toException $ ExitFailure 1) >> return ()) (return Nothing)    -- and finally, exit-  liftIO $ when (verbosity dflags > 0) $ putStrLn "Leaving GHCi."+  liftIO $ when (verbosity dflags > 0) $ putStrLn "Leaving CLaSHi."  runGHCiInput :: InputT GHCi a -> GHCi a runGHCiInput f = do     dflags <- getDynFlags     histFile <- if gopt Opt_GhciHistory dflags-                then liftIO $ withGhcAppData (\dir -> return (Just (dir </> "ghci_history")))+                then liftIO $ withGhcAppData (\dir -> return (Just (dir </> "clashi_history")))                                              (return Nothing)                 else return Nothing     runInputT
src-bin/Main.hs view
@@ -158,6 +158,8 @@                                     , DynFlags.Opt_ConstraintKinds                                     , DynFlags.Opt_TypeFamilies                                     , DynFlags.Opt_BinaryLiterals+                                    , DynFlags.Opt_ExplicitNamespaces+                                    , DynFlags.Opt_KindSignatures                                     ]                 dflagsExtra1 = foldl DynFlags.xopt_unset dflagsExtra                                      [ DynFlags.Opt_ImplicitPrelude@@ -165,9 +167,11 @@                                      ]                  ghcTyLitNormPlugin = GHC.mkModuleName "GHC.TypeLits.Normalise"+                ghcTyLitExtrPlugin = GHC.mkModuleName "GHC.TypeLits.Extra.Solver"                 dflagsExtra2 = dflagsExtra1                                   { DynFlags.pluginModNames = nub $-                                      ghcTyLitNormPlugin : DynFlags.pluginModNames dflagsExtra1+                                      ghcTyLitNormPlugin : ghcTyLitExtrPlugin :+                                      DynFlags.pluginModNames dflagsExtra1                                   }  
src-ghc/CLaSH/GHC/LoadModules.hs view
@@ -84,6 +84,8 @@                                 , DynFlags.Opt_ConstraintKinds                                 , DynFlags.Opt_TypeFamilies                                 , DynFlags.Opt_BinaryLiterals+                                , DynFlags.Opt_ExplicitNamespaces+                                , DynFlags.Opt_KindSignatures                                 ]                   let dfDis = foldl DynFlags.xopt_unset dfEn                                 [ DynFlags.Opt_ImplicitPrelude
src-ghc/CLaSH/GHC/NetlistTypes.hs view
@@ -74,13 +74,21 @@           -> Type           -> ExceptT String Maybe Int tyNatSize _ (LitTy (NumTy i)) = return i-tyNatSize m (tyView -> TyConApp tc [ty1,ty2]) = case name2String tc of+tyNatSize m ty@(tyView -> TyConApp tc [ty1,ty2]) = case name2String tc of   "GHC.TypeLits.+" -> (+) <$> tyNatSize m ty1 <*> tyNatSize m ty2   "GHC.TypeLits.*" -> (*) <$> tyNatSize m ty1 <*> tyNatSize m ty2   "GHC.TypeLits.^" -> (^) <$> tyNatSize m ty1 <*> tyNatSize m ty2   "GHC.TypeLits.-" -> (-) <$> tyNatSize m ty1 <*> tyNatSize m ty2   "CLaSH.Promoted.Ord.Max" -> max <$> tyNatSize m ty1 <*> tyNatSize m ty2   "CLaSH.Promoted.Ord.Min" -> min <$> tyNatSize m ty1 <*> tyNatSize m ty2+  "GHC.TypeLits.Extra.CLog" -> do+    i1' <- tyNatSize m ty1+    i2' <- tyNatSize m ty2+    if (i1' > 1 && i2' > 0)+       then return (ceiling (logBase (fromIntegral i1' :: Double)+                                     (fromIntegral i2' :: Double)))+       else fail $ $(curLoc) ++ "Can't convert: " ++ show ty+  "GHC.TypeLits.Extra.GCD" -> gcd <$> tyNatSize m ty1 <*> tyNatSize m ty2   _ -> fail $ $(curLoc) ++ "Can't convert tyNatOp: " ++ show tc -- TODO: Remove this conversion -- The current problem is that type-functions are not reduced by the GHC -> Core