packages feed

clash-prelude 0.10.5 → 0.10.6

raw patch · 50 files changed

+388/−280 lines, 50 filesdep ~ghc-typelits-natnormalise

Dependency ranges changed: ghc-typelits-natnormalise

Files

CHANGELOG.md view
@@ -1,6 +1,10 @@ # Changelog for [`clash-prelude` package](http://hackage.haskell.org/package/clash-prelude) -## 0.10.5 *January 13th 2015*+## 0.10.6 *February 10th 2016*+* Fixes bugs:+  * `CLaSH.Prelude.DataFlow.parNDF` is not lazy enough++## 0.10.5 *January 13th 2016* * New features:   * Add `readNew` to `CLaSH.Prelude.BlockRam`: create a read-after-write blockRAM from a read-before-write blockRAM.   * `popCount` functions for `BitVector`, `Signed`, and `Unsigned` are now synthesisable.
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2013-2015, University of Twente+Copyright (c) 2013-2016, University of Twente All rights reserved.  Redistribution and use in source and binary forms, with or without
clash-prelude.cabal view
@@ -1,5 +1,5 @@ Name:                 clash-prelude-Version:              0.10.5+Version:              0.10.6 Synopsis:             CAES Language for Synchronous Hardware - Prelude library Description:   CλaSH (pronounced ‘clash’) is a functional hardware description language that@@ -45,7 +45,7 @@ License-file:         LICENSE Author:               Christiaan Baaij Maintainer:           Christiaan Baaij <christiaan.baaij@gmail.com>-Copyright:            Copyright © 2013-2015 University of Twente+Copyright:            Copyright © 2013-2016 University of Twente Category:             Hardware Build-type:           Simple @@ -118,6 +118,7 @@                       CLaSH.Sized.BitVector                       CLaSH.Sized.Fixed                       CLaSH.Sized.Index+                      CLaSH.Sized.RTree                       CLaSH.Sized.Signed                       CLaSH.Sized.Unsigned                       CLaSH.Sized.Vector@@ -157,7 +158,7 @@                       integer-gmp               >= 0.5.1.0,                       ghc-prim                  >= 0.3.1.0,                       ghc-typelits-extra        >= 0.1,-                      ghc-typelits-natnormalise >= 0.3,+                      ghc-typelits-natnormalise >= 0.4.1,                       lens                      >= 4.9,                       QuickCheck                >= 2.7 && <2.9,                       reflection                >= 2,@@ -171,9 +172,6 @@     -- See: https://github.com/clash-lang/clash-compiler/commit/721fcfa9198925661cd836668705f817bddaae3c     -- as to why we need this.     ghc-options:      -fcpr-off-  -- Uncomment the 'else' branch once hackage recognises the DeriveLift extension-  -- else-  --   other-extensions: DeriveLift    if flag(doclinks)     CPP-Options:      -DDOCLINKS
src/CLaSH/Annotations/TopEntity.hs view
@@ -1,11 +1,5 @@-{-# LANGUAGE DeriveDataTypeable #-}--{-# LANGUAGE Safe #-}--{-# OPTIONS_HADDOCK show-extensions #-}- {-|-Copyright  :  (C) 2015, University of Twente+Copyright  :  (C) 2015-2016, University of Twente License    :  BSD2 (see the file LICENSE) Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com> @@ -167,6 +161,13 @@  See the documentation of 'TopEntity' for the meaning of all its fields. -}++{-# LANGUAGE DeriveDataTypeable #-}++{-# LANGUAGE Safe #-}++{-# OPTIONS_HADDOCK show-extensions #-}+ module CLaSH.Annotations.TopEntity   ( -- * Data types     TopEntity (..)
src/CLaSH/Class/BitPack.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds            #-} {-# LANGUAGE FlexibleContexts     #-} {-# LANGUAGE MagicHash            #-}@@ -9,11 +15,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Class.BitPack   ( BitPack (..)   , bitCoerce
src/CLaSH/Class/Num.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds             #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies          #-}@@ -6,11 +12,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Class.Num   ( -- * Arithmetic functions for arguments and results of different precision     ExtendingNum (..)
src/CLaSH/Class/Resize.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds        #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE KindSignatures   #-}@@ -7,11 +13,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Class.Resize where  import GHC.TypeLits (KnownNat, Nat, type (+))
src/CLaSH/Examples.hs view
@@ -1,11 +1,12 @@+{-|+Copyright : © Christiaan Baaij, 2015-2016+Licence   : Creative Commons 4.0 (CC BY 4.0) (http://creativecommons.org/licenses/by/4.0/)+-}+ {-# LANGUAGE NoImplicitPrelude, CPP, TemplateHaskell, DataKinds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} -{-|-Copyright : © Christiaan Baaij, 2015-Licence   : Creative Commons 4.0 (CC BY 4.0) (http://creativecommons.org/licenses/by/4.0/)--} module CLaSH.Examples (   -- * Decoders and Encoders   -- $decoders_and_encoders
src/CLaSH/Prelude.hs view
@@ -1,14 +1,5 @@-{-# LANGUAGE CPP              #-}-{-# LANGUAGE DataKinds        #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE TypeOperators    #-}--{-# LANGUAGE Unsafe #-}--{-# OPTIONS_HADDOCK show-extensions #-}- {-|-  Copyright   :  (C) 2013-2015, University of Twente+  Copyright   :  (C) 2013-2016, University of Twente   License     :  BSD2 (see the file LICENSE)   Maintainer  :  Christiaan Baaij <christiaan.baaij@gmail.com> @@ -33,6 +24,16 @@   library. A preliminary version of a tutorial can be found in "CLaSH.Tutorial".   Some circuit examples can be found in "CLaSH.Examples". -}++{-# LANGUAGE CPP              #-}+{-# LANGUAGE DataKinds        #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE TypeOperators    #-}++{-# LANGUAGE Unsafe #-}++{-# OPTIONS_HADDOCK show-extensions #-}+ module CLaSH.Prelude   ( -- * Creating synchronous sequential circuits     mealy@@ -91,6 +92,8 @@   , module CLaSH.Sized.Fixed     -- *** Fixed size vectors   , module CLaSH.Sized.Vector+    -- *** Perfect depth trees+  , module CLaSH.Sized.RTree     -- ** Annotations   , module CLaSH.Annotations.TopEntity     -- ** Type-level natural numbers@@ -157,6 +160,7 @@ import CLaSH.Sized.BitVector import CLaSH.Sized.Fixed import CLaSH.Sized.Index+import CLaSH.Sized.RTree import CLaSH.Sized.Signed import CLaSH.Sized.Unsigned import CLaSH.Sized.Vector
src/CLaSH/Prelude/BitIndex.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds        #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MagicHash        #-}@@ -8,11 +14,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Prelude.BitIndex where  import GHC.TypeLits                   (KnownNat, type (+), type (-))
src/CLaSH/Prelude/BitReduction.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MagicHash        #-} @@ -5,11 +11,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Prelude.BitReduction where  import GHC.TypeLits                   (KnownNat)
src/CLaSH/Prelude/BlockRam.hs view
@@ -1,14 +1,5 @@-{-# LANGUAGE DataKinds        #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE MagicHash        #-}-{-# LANGUAGE TypeOperators    #-}--{-# LANGUAGE Safe #-}--{-# OPTIONS_HADDOCK show-extensions #-}- {-|-Copyright  :  (C) 2013-2015, University of Twente+Copyright  :  (C) 2013-2016, University of Twente License    :  BSD2 (see the file LICENSE) Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com> @@ -343,6 +334,16 @@ This concludes the short introduction to using 'blockRam'.  -}++{-# LANGUAGE DataKinds        #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE MagicHash        #-}+{-# LANGUAGE TypeOperators    #-}++{-# LANGUAGE Safe #-}++{-# OPTIONS_HADDOCK show-extensions #-}+ module CLaSH.Prelude.BlockRam   ( -- * BlockRAM synchronised to the system clock     blockRam
src/CLaSH/Prelude/BlockRam/File.hs view
@@ -1,15 +1,5 @@-{-# LANGUAGE DataKinds           #-}-{-# LANGUAGE FlexibleContexts    #-}-{-# LANGUAGE MagicHash           #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE TypeOperators       #-}--{-# LANGUAGE Unsafe #-}--{-# OPTIONS_HADDOCK show-extensions #-}- {-|-Copyright  :  (C) 2015, University of Twente+Copyright  :  (C) 2015-2016, University of Twente License    :  BSD2 (see the file LICENSE) Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com> @@ -72,6 +62,17 @@ @  -}++{-# LANGUAGE DataKinds           #-}+{-# LANGUAGE FlexibleContexts    #-}+{-# LANGUAGE MagicHash           #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TypeOperators       #-}++{-# LANGUAGE Unsafe #-}++{-# OPTIONS_HADDOCK show-extensions #-}+ module CLaSH.Prelude.BlockRam.File   ( -- * BlockRAM synchronised to the system clock     blockRamFile@@ -84,7 +85,6 @@   , initMem   ) where-  import Control.Monad                (when) import Control.Monad.ST.Lazy        (ST,runST)
src/CLaSH/Prelude/DataFlow.hs view
@@ -1,3 +1,11 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>++Self-synchronising circuits based on data-flow principles.+-}+ {-# LANGUAGE DataKinds             #-} {-# LANGUAGE FlexibleContexts      #-} {-# LANGUAGE FlexibleInstances     #-}@@ -12,13 +20,6 @@ {-# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise #-} {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--Self-synchronising circuits based on data-flow principles.--} module CLaSH.Prelude.DataFlow   ( -- * Data types     DataFlow@@ -293,7 +294,7 @@             aVs' = unbundle' clk aVs             bRs' = unbundle' clk bRs             (bs,bVs,aRs) = unzip3 (zipWith (\k (a,b,r) -> df k a b r) fs-                                  (zip3 as' aVs' bRs'))+                                  (zip3 (lazyV as') (lazyV aVs') bRs'))         in  (bundle' clk bs,bundle' clk bVs, bundle' clk aRs)      ) 
src/CLaSH/Prelude/Explicit.hs view
@@ -1,14 +1,5 @@-{-# LANGUAGE DataKinds        #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE TypeOperators    #-}--{-# LANGUAGE Unsafe #-}--{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}-{-# OPTIONS_HADDOCK show-extensions #-}- {-|-Copyright  :  (C) 2013-2015, University of Twente+Copyright  :  (C) 2013-2016, University of Twente License    :  BSD2 (see the file LICENSE) Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com> @@ -20,6 +11,16 @@ look at "CLaSH.Signal.Explicit" to see how you can make multi-clock designs using explicitly clocked signals. -}++{-# LANGUAGE DataKinds        #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE TypeOperators    #-}++{-# LANGUAGE Unsafe #-}++{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}+{-# OPTIONS_HADDOCK show-extensions #-}+ module CLaSH.Prelude.Explicit   ( -- * Creating synchronous sequential circuits     mealy'
src/CLaSH/Prelude/Explicit/Safe.hs view
@@ -1,13 +1,5 @@-{-# LANGUAGE DataKinds        #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE TypeOperators    #-}--{-# LANGUAGE Safe #-}--{-# OPTIONS_HADDOCK show-extensions #-}- {-|-Copyright  :  (C) 2013-2015, University of Twente+Copyright  :  (C) 2013-2016, University of Twente License    :  BSD2 (see the file LICENSE) Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com> @@ -21,6 +13,15 @@ look at "CLaSH.Signal.Explicit" to see how you can make multi-clock designs using explicitly clocked signals. -}++{-# LANGUAGE DataKinds        #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE TypeOperators    #-}++{-# LANGUAGE Safe #-}++{-# OPTIONS_HADDOCK show-extensions #-}+ module CLaSH.Prelude.Explicit.Safe   ( -- * Creating synchronous sequential circuits     mealy'
src/CLaSH/Prelude/Mealy.hs view
@@ -1,7 +1,5 @@-{-# LANGUAGE Safe #-}- {-|-  Copyright  :  (C) 2013-2015, University of Twente+  Copyright  :  (C) 2013-2016, University of Twente   License    :  BSD2 (see the file LICENSE)   Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com> @@ -11,6 +9,9 @@   Mealy machines are strictly more expressive, but may impose stricter timing   requirements. -}++{-# LANGUAGE Safe #-}+ module CLaSH.Prelude.Mealy   ( -- * Mealy machine synchronised to the system clock     mealy
src/CLaSH/Prelude/Moore.hs view
@@ -1,7 +1,5 @@-{-# LANGUAGE Safe #-}- {-|-  Copyright  :  (C) 2013-2015, University of Twente+  Copyright  :  (C) 2013-2016, University of Twente   License    :  BSD2 (see the file LICENSE)   Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com> @@ -11,6 +9,9 @@   Moore machines are strictly less expressive, but may impose laxer timing   requirements. -}++{-# LANGUAGE Safe #-}+ module CLaSH.Prelude.Moore   ( -- * Moore machine synchronised to the system clock     moore
src/CLaSH/Prelude/RAM.hs view
@@ -1,3 +1,11 @@+{-|+Copyright  :  (C) 2015-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>++RAM primitives with a combinational read port.+-}+ {-# LANGUAGE CPP                 #-} {-# LANGUAGE DataKinds           #-} {-# LANGUAGE FlexibleContexts    #-}@@ -16,13 +24,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--RAM primitives with a combinational read port.--} module CLaSH.Prelude.RAM   ( -- * RAM synchronised to the system clock     asyncRam
src/CLaSH/Prelude/ROM.hs view
@@ -1,3 +1,11 @@+{-|+Copyright  :  (C) 2015-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>++ROMs+-}+ {-# LANGUAGE DataKinds        #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MagicHash        #-}@@ -7,13 +15,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--ROMs--} module CLaSH.Prelude.ROM   ( -- * Asynchronous ROM     asyncRom
src/CLaSH/Prelude/ROM/File.hs view
@@ -1,15 +1,5 @@-{-# LANGUAGE DataKinds           #-}-{-# LANGUAGE FlexibleContexts    #-}-{-# LANGUAGE MagicHash           #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE TypeOperators       #-}--{-# LANGUAGE Unsafe #-}--{-# OPTIONS_HADDOCK show-extensions #-}- {-|-Copyright  :  (C) 2015, University of Twente+Copyright  :  (C) 2015-2016, University of Twente License    :  BSD2 (see the file LICENSE) Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com> @@ -70,6 +60,17 @@ [(1,2),(1,3)(1,-4)] @ -}++{-# LANGUAGE DataKinds           #-}+{-# LANGUAGE FlexibleContexts    #-}+{-# LANGUAGE MagicHash           #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TypeOperators       #-}++{-# LANGUAGE Unsafe #-}++{-# OPTIONS_HADDOCK show-extensions #-}+ module CLaSH.Prelude.ROM.File   ( -- * Asynchronous ROM     asyncRomFile
src/CLaSH/Prelude/Safe.hs view
@@ -1,13 +1,5 @@-{-# LANGUAGE DataKinds        #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE TypeOperators    #-}--{-# LANGUAGE Safe #-}--{-# OPTIONS_HADDOCK show-extensions #-}- {-|-  Copyright   :  (C) 2013-2015, University of Twente+  Copyright   :  (C) 2013-2016, University of Twente   License     :  BSD2 (see the file LICENSE)   Maintainer  :  Christiaan Baaij <christiaan.baaij@gmail.com> @@ -34,6 +26,15 @@   library. A preliminary version of a tutorial can be found in "CLaSH.Tutorial".   Some circuit examples can be found in "CLaSH.Examples". -}++{-# LANGUAGE DataKinds        #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE TypeOperators    #-}++{-# LANGUAGE Safe #-}++{-# OPTIONS_HADDOCK show-extensions #-}+ module CLaSH.Prelude.Safe   ( -- * Creating synchronous sequential circuits     mealy@@ -78,6 +79,8 @@   , module CLaSH.Sized.Fixed     -- *** Fixed size vectors   , module CLaSH.Sized.Vector+    -- *** Perfect depth trees+  , module CLaSH.Sized.RTree     -- ** Annotations   , module CLaSH.Annotations.TopEntity     -- ** Type-level natural numbers@@ -133,6 +136,7 @@ import CLaSH.Sized.BitVector import CLaSH.Sized.Fixed import CLaSH.Sized.Index+import CLaSH.Sized.RTree import CLaSH.Sized.Signed import CLaSH.Sized.Unsigned import CLaSH.Sized.Vector
src/CLaSH/Prelude/Synchronizer.hs view
@@ -1,3 +1,11 @@+{-|+Copyright   :  (C) 2015-2016, University of Twente+License     :  BSD2 (see the file LICENSE)+Maintainer  :  Christiaan Baaij <christiaan.baaij@gmail.com>++Synchronizer circuits for safe clock domain crossings+-}+ {-# LANGUAGE DataKinds             #-} {-# LANGUAGE FlexibleContexts      #-} {-# LANGUAGE PartialTypeSignatures #-}@@ -9,13 +17,6 @@ {-# OPTIONS_GHC -fno-warn-partial-type-signatures #-} {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright   :  (C) 2015, University of Twente-License     :  BSD2 (see the file LICENSE)-Maintainer  :  Christiaan Baaij <christiaan.baaij@gmail.com>--Synchronizer circuits for safe clock domain crossings--} module CLaSH.Prelude.Synchronizer   ( -- * Bit-synchronizers     dualFlipFlopSynchronizer
src/CLaSH/Prelude/Testbench.hs view
@@ -1,14 +1,15 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE ScopedTypeVariables #-}  {-# LANGUAGE Unsafe #-}  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Prelude.Testbench   ( -- * Testbench functions for circuits synchronised to the system slock     assert
src/CLaSH/Promoted/Nat.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds           #-} {-# LANGUAGE FlexibleContexts    #-} {-# LANGUAGE GADTs               #-}@@ -10,11 +16,6 @@ {-# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise #-} {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Promoted.Nat   ( SNat (..), snat, withSNat, snatToInteger, addSNat, subSNat, mulSNat, powSNat   , UNat (..), toUNat, addUNat, multUNat, powUNat
src/CLaSH/Promoted/Nat/Literals.hs view
@@ -1,12 +1,5 @@-{-# LANGUAGE TemplateHaskell #-}-{-# LANGUAGE DataKinds       #-}--{-# LANGUAGE Trustworthy #-}--{-# OPTIONS_HADDOCK show-extensions #-}- {-|-Copyright  :  (C) 2013-2015, University of Twente+Copyright  :  (C) 2013-2016, University of Twente License    :  BSD2 (see the file LICENSE) Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com> @@ -24,6 +17,14 @@  You can generate more 'SNat' literals using 'decLiteralsD' from "CLaSH.Promoted.Nat.TH" -}++{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE DataKinds       #-}++{-# LANGUAGE Trustworthy #-}++{-# OPTIONS_HADDOCK show-extensions #-}+ module CLaSH.Promoted.Nat.Literals where  import CLaSH.Promoted.Nat.TH
src/CLaSH/Promoted/Nat/TH.hs view
@@ -1,14 +1,15 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE TemplateHaskell #-}  {-# LANGUAGE Trustworthy #-}  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Promoted.Nat.TH   ( -- * Declare a single @d\<N\>@ literal     decLiteralD
src/CLaSH/Promoted/Nat/Unsafe.hs view
@@ -1,10 +1,11 @@-{-# LANGUAGE Unsafe #-}- {-|-Copyright  :  (C) 2015, University of Twente+Copyright  :  (C) 2015-2016, University of Twente License    :  BSD2 (see the file LICENSE) Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com> -}++{-# LANGUAGE Unsafe #-}+ module CLaSH.Promoted.Nat.Unsafe   (unsafeSNat) where
src/CLaSH/Promoted/Ord.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds            #-} {-# LANGUAGE TypeFamilies         #-} {-# LANGUAGE TypeOperators        #-}@@ -7,11 +13,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Promoted.Ord where  import Data.Type.Bool
src/CLaSH/Promoted/Symbol.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds      #-} {-# LANGUAGE GADTs          #-} {-# LANGUAGE KindSignatures #-}@@ -6,11 +12,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Promoted.Symbol   (SSymbol (..), ssymbol, ssymbolToString) where
src/CLaSH/Signal.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE MagicHash #-}  {-# LANGUAGE Trustworthy #-}@@ -5,11 +11,6 @@ {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Signal   ( -- * Implicitly clocked synchronous signal     Signal
src/CLaSH/Signal/Bundle.hs view
@@ -1,3 +1,11 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>++The Product/Signal isomorphism+-}+ {-# LANGUAGE DataKinds         #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE KindSignatures    #-}@@ -8,13 +16,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--The Product/Signal isomorphism--} module CLaSH.Signal.Bundle   ( Bundle (..)   )
src/CLaSH/Signal/Delayed.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE CPP                        #-} {-# LANGUAGE DataKinds                  #-} #if __GLASGOW_HASKELL__ > 710@@ -18,11 +24,6 @@ {-# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise #-} {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Signal.Delayed   ( -- * Delay-annotated synchronous signals     DSignal
src/CLaSH/Signal/Explicit.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs     #-} {-# LANGUAGE MagicHash #-}@@ -6,11 +12,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Signal.Explicit   ( -- * Explicitly clocked synchronous signal     -- $relativeclocks
src/CLaSH/Signal/Internal.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE CPP                   #-} {-# LANGUAGE DataKinds             #-} {-# LANGUAGE FlexibleInstances     #-}@@ -19,11 +25,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Signal.Internal   ( -- * Datatypes     Clock (..)
src/CLaSH/Sized/BitVector.hs view
@@ -1,14 +1,15 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE MagicHash #-}  {-# LANGUAGE Trustworthy #-}  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Sized.BitVector   ( -- * Datatypes     BitVector
src/CLaSH/Sized/Fixed.hs view
@@ -1,22 +1,5 @@-{-# LANGUAGE ConstraintKinds            #-}-{-# LANGUAGE DataKinds                  #-}-{-# LANGUAGE FlexibleContexts           #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE KindSignatures             #-}-{-# LANGUAGE MultiParamTypeClasses      #-}-{-# LANGUAGE ScopedTypeVariables        #-}-{-# LANGUAGE StandaloneDeriving         #-}-{-# LANGUAGE TemplateHaskell            #-}-{-# LANGUAGE TypeOperators              #-}-{-# LANGUAGE TypeFamilies               #-}-{-# LANGUAGE UndecidableInstances       #-}--{-# LANGUAGE Trustworthy #-}--{-# OPTIONS_HADDOCK show-extensions #-}- {-|-Copyright  :  (C) 2013-2015, University of Twente+Copyright  :  (C) 2013-2016, University of Twente License    :  BSD2 (see the file LICENSE) Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com> @@ -38,6 +21,24 @@ * Truncation for positive numbers effectively results in: round towards zero. * Truncation for negative numbers effectively results in: round towards -infinity. -}++{-# LANGUAGE ConstraintKinds            #-}+{-# LANGUAGE DataKinds                  #-}+{-# LANGUAGE FlexibleContexts           #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE KindSignatures             #-}+{-# LANGUAGE MultiParamTypeClasses      #-}+{-# LANGUAGE ScopedTypeVariables        #-}+{-# LANGUAGE StandaloneDeriving         #-}+{-# LANGUAGE TemplateHaskell            #-}+{-# LANGUAGE TypeOperators              #-}+{-# LANGUAGE TypeFamilies               #-}+{-# LANGUAGE UndecidableInstances       #-}++{-# LANGUAGE Trustworthy #-}++{-# OPTIONS_HADDOCK show-extensions #-}+ module CLaSH.Sized.Fixed   ( -- * 'SFixed': 'Signed' 'Fixed' point numbers     SFixed, sf, unSF
src/CLaSH/Sized/Index.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds        #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MagicHash        #-}@@ -9,11 +15,6 @@ {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Sized.Index   (Index, bv2i) where
src/CLaSH/Sized/Internal/BitVector.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds             #-} {-# LANGUAGE FlexibleContexts      #-} {-# LANGUAGE KindSignatures        #-}@@ -12,11 +18,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Sized.Internal.BitVector   ( -- * Datatypes     BitVector (..)
src/CLaSH/Sized/Internal/BitVector.hs-boot view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2015-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds       #-} {-# LANGUAGE KindSignatures  #-} {-# LANGUAGE RoleAnnotations #-}
src/CLaSH/Sized/Internal/Index.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds             #-} {-# LANGUAGE KindSignatures        #-} {-# LANGUAGE MagicHash             #-}@@ -11,11 +17,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Sized.Internal.Index   ( -- * Datatypes     Index (..)
src/CLaSH/Sized/Internal/Index.hs-boot view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2015-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds       #-} {-# LANGUAGE KindSignatures  #-} {-# LANGUAGE RoleAnnotations #-}
src/CLaSH/Sized/Internal/Signed.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds             #-} {-# LANGUAGE FlexibleContexts      #-} {-# LANGUAGE KindSignatures        #-}@@ -12,11 +18,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Sized.Internal.Signed   ( -- * Datatypes     Signed (..)
src/CLaSH/Sized/Internal/Unsigned.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds                  #-} {-# LANGUAGE FlexibleContexts           #-} {-# LANGUAGE MagicHash                  #-}@@ -11,11 +17,6 @@  {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Sized.Internal.Unsigned   ( -- * Datatypes     Unsigned (..)
+ src/CLaSH/Sized/RTree.hs view
@@ -0,0 +1,38 @@+{-|+Copyright  :  (C) 2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}++{-# LANGUAGE DataKinds, TypeOperators, GADTs, ScopedTypeVariables,+             KindSignatures, RankNTypes #-}++{-# LANGUAGE Trustworthy #-}++{-# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise #-}++module CLaSH.Sized.RTree where++import Data.Singletons.Prelude     (TyFun,type ($))+import Data.Proxy                  (Proxy (..))+import GHC.TypeLits                (KnownNat, Nat, type (+))++import CLaSH.Promoted.Nat          (SNat, snat, subSNat)+import CLaSH.Promoted.Nat.Literals (d1)++data RTree :: Nat -> * -> * where+  LR :: a -> RTree 0 a+  BR :: RTree n a -> RTree n a -> RTree (n+1) a++tfold :: forall p k a . KnownNat k+      => Proxy (p :: TyFun Nat * -> *)+      -> (a -> (p $ 0))+      -> (forall l . SNat l -> (p $ l) -> (p $ l) -> (p $ (l+1)))+      -> RTree k a+      -> (p $ k)+tfold _ f g = go snat+  where+    go :: SNat m -> RTree m a -> (p $ m)+    go _  (LR a)   = f a+    go sn (BR l r) = let sn' = sn `subSNat` d1+                     in  g sn' (go sn' l) (go sn' r)
src/CLaSH/Sized/Signed.hs view
@@ -1,9 +1,11 @@-{-# LANGUAGE Trustworthy #-} {-|-Copyright  :  (C) 2013-2015, University of Twente+Copyright  :  (C) 2013-2016, University of Twente License    :  BSD2 (see the file LICENSE) Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com> -}++{-# LANGUAGE Trustworthy #-}+ module CLaSH.Sized.Signed   ( Signed   )
src/CLaSH/Sized/Unsigned.hs view
@@ -1,9 +1,11 @@-{-# LANGUAGE Trustworthy #-} {-|-Copyright  :  (C) 2013-2015, University of Twente+Copyright  :  (C) 2013-2016, University of Twente License    :  BSD2 (see the file LICENSE) Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com> -}++{-# LANGUAGE Trustworthy #-}+ module CLaSH.Sized.Unsigned   (Unsigned) where
src/CLaSH/Sized/Vector.hs view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2013-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE BangPatterns         #-} {-# LANGUAGE DataKinds            #-} {-# LANGUAGE FlexibleContexts     #-}@@ -20,11 +26,6 @@ {-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} {-# OPTIONS_HADDOCK show-extensions #-} -{-|-Copyright  :  (C) 2013-2015, University of Twente-License    :  BSD2 (see the file LICENSE)-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>--} module CLaSH.Sized.Vector   ( -- * 'Vec'tor data type     Vec(..)
src/CLaSH/Sized/Vector.hs-boot view
@@ -1,3 +1,9 @@+{-|+Copyright  :  (C) 2015-2016, University of Twente+License    :  BSD2 (see the file LICENSE)+Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>+-}+ {-# LANGUAGE DataKinds       #-} {-# LANGUAGE GADTs           #-} {-# LANGUAGE KindSignatures  #-}
src/CLaSH/Tutorial.hs view
@@ -1,10 +1,11 @@-{-# LANGUAGE NoImplicitPrelude, MagicHash #-}-{-# OPTIONS_GHC -fno-warn-unused-imports #-}- {-|-Copyright : © Christiaan Baaij, 2014-2015+Copyright : © Christiaan Baaij, 2014-2016 Licence   : Creative Commons 4.0 (CC BY 4.0) (http://creativecommons.org/licenses/by/4.0/) -}++{-# LANGUAGE NoImplicitPrelude, MagicHash #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+ module CLaSH.Tutorial (   -- * Introduction   -- $introduction@@ -459,7 +460,7 @@ of a <http://en.wikipedia.org/wiki/VHDL VHDL> netlist, from our sequential circuit specification. The first thing we have to do is create a function called 'topEntity' and ensure that it has a __monomorphic__ type. In our case-that means that we have to give it an explicit type annotation. It might now+that means that we have to give it an explicit type annotation. It might not always be needed, you can always check the type with the @:t@ command and see if the function is monomorphic: @@ -1023,11 +1024,11 @@ /template/, meaning that the compiler must fill in the holes heralded by the tilde (~). Here: -  * @~ARG[1]@ denotes the second argument given to the @timesS@ function, which+  * @~ARG[1]@ denotes the second argument given to the @(*#)@ function, which     corresponds to the LHS of the ('*') operator.-  * @~ARG[2]@ denotes the third argument given to the @timesS@ function, which+  * @~ARG[2]@ denotes the third argument given to the @(*#)@ function, which     corresponds to the RHS of the ('*') operator.-  * @~LIT[0]@ denotes the first argument given to the @timesS@ function, with+  * @~LIT[0]@ denotes the first argument given to the @(*#)@ function, with     the extra condition that it must be a @LIT@eral. If for some reason this     first argument does not turn out to be a literal then the compiler will     raise an error. This first arguments corresponds to the \"@'KnownNat' n@\"@@ -1046,7 +1047,7 @@ @ {\-\# NOINLINE blockRam# \#-\} -- | blockRAM primitive-blockRam' :: 'GHC.TypeLits.KnownNat' n+blockRam# :: 'GHC.TypeLits.KnownNat' n           => 'SClock' clk       -- ^ \'Clock\' to synchronize to           -> 'Vec' n a          -- ^ Initial content of the BRAM, also                               -- determines the size, \@n\@, of the BRAM.@@ -1059,7 +1060,7 @@           -> 'Signal'' clk a           -- ^ Value of the \@blockRAM\@ at address \@r\@ from the previous clock           -- cycle-blockRam' clk binit wr rd en din = 'register'' clk undefined dout+blockRam# clk binit wr rd en din = 'register'' clk undefined dout   where     szI  = fromInteger $ 'maxIndex' content     dout = runST $ do