packages feed

clash-lib 0.6.5 → 0.6.6

raw patch · 5 files changed

+28/−17 lines, 5 filesdep ~clash-prelude

Dependency ranges changed: clash-prelude

Files

CHANGELOG.md view
@@ -1,5 +1,10 @@ # Changelog for the [`clash-lib`](http://hackage.haskell.org/package/clash-lib) package +## 0.6.6 *December 11th 2015*+* New features:+  * Remove all existing HDL files before generating new ones. This can be disabled by the `-clash-noclean` flag. [#96](https://github.com/clash-lang/clash-compiler/issues/96)+  * Support for `clash-prelude` 0.10.4+ ## 0.6.5 *November 17th 2015* * Fixes bugs:   * Integer literals used as arguments not always properly annotated with their type.
clash-lib.cabal view
@@ -1,5 +1,5 @@ Name:                 clash-lib-Version:              0.6.5+Version:              0.6.6 Synopsis:             CAES Language for Synchronous Hardware - As a Library Description:   CλaSH (pronounced ‘clash’) is a functional hardware description language that@@ -91,7 +91,7 @@                       attoparsec              >= 0.10.4.0,                       base                    >= 4.8 && < 5,                       bytestring              >= 0.10.0.2,-                      clash-prelude           >= 0.10,+                      clash-prelude           >= 0.10.4,                       concurrent-supply       >= 0.1.7,                       containers              >= 0.5.0.0,                       deepseq                 >= 1.3.0.2,
src/CLaSH/Driver.hs view
@@ -6,6 +6,7 @@  import qualified Control.Concurrent.Supply        as Supply import           Control.DeepSeq+import           Control.Monad                    (when) import           Control.Monad.State              (evalState, get) import           Data.HashMap.Strict              (HashMap) import qualified Data.HashMap.Strict              as HashMap@@ -117,7 +118,7 @@                        , takeWhile (/= '.') (name2String $ fst topEntity)                        , "/"                        ]-      prepareDir dir+      prepareDir (opt_cleanhdl opts) (extension hdlState') dir       mapM_ (writeHDL hdlState' dir) hdlDocs       copyDataFiles dir dfiles' @@ -144,17 +145,22 @@  -- | Prepares the directory for writing HDL files. This means creating the --   dir if it does not exist and removing all existing .hdl files from it.-prepareDir :: String -> IO ()-prepareDir dir = do+prepareDir :: Bool -- ^ Remove existing HDL files+           -> String -- ^ File extension of the HDL files.+           -> String+           -> IO ()+prepareDir cleanhdl ext dir = do   -- Create the dir if needed   Directory.createDirectoryIfMissing True dir-  -- Find all .hdl files in the directory-  files <- Directory.getDirectoryContents dir-  let to_remove = filter ((==".hdl") . FilePath.takeExtension) files-  -- Prepend the dirname to the filenames-  let abs_to_remove = map (FilePath.combine dir) to_remove-  -- Remove the files-  mapM_ Directory.removeFile abs_to_remove+  -- Clean the directory when needed+  when cleanhdl $ do+    -- Find all HDL files in the directory+    files <- Directory.getDirectoryContents dir+    let to_remove = filter ((==ext) . FilePath.takeExtension) files+    -- Prepend the dirname to the filenames+    let abs_to_remove = map (FilePath.combine dir) to_remove+    -- Remove the files+    mapM_ Directory.removeFile abs_to_remove  -- | Writes a HDL file to the given directory writeHDL :: Backend backend => backend -> FilePath -> (String, Doc) -> IO ()
src/CLaSH/Driver/TopWrapper.hs view
@@ -240,12 +240,11 @@   -- | Create a single clock path-clockPorts :: Maybe (String,String) -> [(String,String)]+clockPorts :: [(String,String)] -> [(String,String)]            -> ([(Identifier,Expr)],[String])-clockPorts inp outp = (inp' ++ outp',clks)+clockPorts inp outp = (ports,clks)   where-    inp'  = maybe [] ((:[]) . (pack *** stringToVar)) inp-    outp' = map (pack *** stringToVar) outp+    ports = map (pack *** stringToVar) (inp ++ outp)     clks  = map snd outp  -- | Generate resets@@ -289,7 +288,7 @@    return [NetDecl rst (Reset nm r),resetGenDecl] --- | The 'NetListMonad' is an transformer stack with 'IO' at the bottom.+-- | The 'NetListMonad' is a transformer stack with 'IO' at the bottom. -- So we must use 'unsafePerformIO'. unsafeRunNetlist :: NetlistMonad a                  -> a
src/CLaSH/Driver/Types.hs view
@@ -15,4 +15,5 @@                            , opt_specLimit   :: Int                            , opt_inlineBelow :: Int                            , opt_dbgLevel    :: DebugLevel+                           , opt_cleanhdl    :: Bool                            }