clash-vhdl 0.6.2 → 0.6.3
raw patch · 3 files changed
+14/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- clash-vhdl.cabal +1/−1
- src/CLaSH/Backend/VHDL.hs +9/−2
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Changelog for the [`clash-vhdl`](http://hackage.haskell.org/package/clash-vhdl) package +## 0.6.3 *November 12th 2015*+* Fixes bugs:+ * Do not generate overlapping literal patterns [#91](https://github.com/clash-lang/clash-compiler/issues/91)+ ## 0.6.2 *October 21st 2015* * New features: * Support `clash-prelude` 0.10.2
clash-vhdl.cabal view
@@ -1,5 +1,5 @@ Name: clash-vhdl-Version: 0.6.2+Version: 0.6.3 Synopsis: CAES Language for Synchronous Hardware - VHDL backend Description: CλaSH (pronounced ‘clash’) is a functional hardware description language that
src/CLaSH/Backend/VHDL.hs view
@@ -28,7 +28,7 @@ import CLaSH.Netlist.BlackBox.Util (extractLiterals, renderBlackBox) import CLaSH.Netlist.Types import CLaSH.Netlist.Util-import CLaSH.Util (clog2, curLoc, makeCached, (<:>))+import CLaSH.Util (clog2, curLoc, first, makeCached, on, (<:>)) #ifdef CABAL import qualified Paths_clash_vhdl@@ -447,8 +447,11 @@ inst_ (CondAssignment id_ _ scrut scrutTy es) = fmap Just $ "with" <+> parens (expr_ True scrut) <+> "select" <$>- indent 2 (text id_ <+> larrow <+> align (vcat (punctuate comma (conds es)) <> semi))+ indent 2 (text id_ <+> larrow <+> align (vcat (punctuate comma (conds esNub)) <> semi)) where+ esMod = map (first (fmap (patMod scrutTy))) es+ esNub = nubBy ((==) `on` fst) esMod+ conds :: [(Maybe Literal,Expr)] -> VHDLM [Doc] conds [] = return [] conds [(_,e)] = expr_ False e <+> "when" <+> "others" <:> return []@@ -611,6 +614,10 @@ in parenIf (i' < 0) (integer i') patLit hwTy (NumLit i) = bits (toBits (conSize hwTy) i) patLit _ l = exprLit Nothing l++patMod :: HWType -> Literal -> Literal+patMod hwTy (NumLit i) = NumLit (i `mod` (2 ^ typeSize hwTy))+patMod _ l = l toBits :: Integral a => Int -> a -> [Bit] toBits size val = map (\x -> if odd x then H else L)