kansas-lava 0.2.4.4 → 0.2.4.5
raw patch · 7 files changed
+29/−15 lines, 7 filesdep ~sized-typesdep ~template-haskell
Dependency ranges changed: sized-types, template-haskell
Files
- Language/KansasLava/Probes.hs +1/−1
- Language/KansasLava/Protocols/Patch.hs +2/−2
- Language/KansasLava/Rep.hs +1/−1
- Language/KansasLava/Rep/TH.hs +17/−7
- Language/KansasLava/Signal.hs +4/−0
- Language/KansasLava/Utils.hs +1/−1
- kansas-lava.cabal +3/−3
Language/KansasLava/Probes.hs view
@@ -45,7 +45,7 @@ -- with the given function. {-# NOINLINE setProbes #-} setProbes :: (forall a i . (Rep a) => String -> Signal i a -> Signal i a) -> IO ()-setProbes = writeIORef probeFn . ProbeFn+setProbes f = writeIORef probeFn (ProbeFn f) -- | The callback is called for every element of every probed value, in evaluation order. -- The arguments are fully evaluted (so printing them will not cause any side-effects of evaluation.
Language/KansasLava/Protocols/Patch.hs view
@@ -187,9 +187,9 @@ ------------------------------------------------ -- | An instance of the Unit type contains a value that carries no information.-class Unit a where+class Unit unit where -- | The name of the specific value.- unit :: a+ unit :: unit unUnit :: (Unit unit) => unit -> ()
Language/KansasLava/Rep.hs view
@@ -57,7 +57,7 @@ showRep (XBool (Just True)) = "high" showRep (XBool (Just False)) = "low" -$(repIntegral ''Int (S $ bitSize $ (error "witness" :: Int)))+$(repIntegral ''Int (S $ finiteBitSize $ (error "witness" :: Int))) $(repIntegral ''Word8 (U 8)) $(repIntegral ''Word32 (U 32))
Language/KansasLava/Rep/TH.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE TemplateHaskell, TypeFamilies #-}+{-# LANGUAGE TemplateHaskell, TypeFamilies, CPP #-} module Language.KansasLava.Rep.TH where @@ -21,9 +21,14 @@ , dataInstD (return []) ''X [conT tyName] Nothing [ normalC xConsName- [ strictType notStrict (appT (conT ''Maybe) (conT tyName)) ]- ]- (return [])+ [ bangType (bang noSourceUnpackedness noSourceStrictness)+ (appT (conT ''Maybe) (conT tyName)) ]+ ]+#if MIN_VERSION_template_haskell(2,12,0)+ []+#else+ (return [])+#endif , funD 'optX [clause [varP x] (normalB@@ -70,9 +75,14 @@ , dataInstD (return []) ''X [conT tyName] Nothing [ normalC xConsName- [ strictType notStrict (appT (conT ''Maybe) (conT tyName)) ]- ]- (return [])+ [ bangType (bang noSourceUnpackedness noSourceStrictness)+ (appT (conT ''Maybe) (conT tyName)) ]+ ]+#if MIN_VERSION_template_haskell(2,12,0)+ []+#else+ (return [])+#endif , funD 'optX [clause [varP x] (normalB
Language/KansasLava/Signal.hs view
@@ -156,7 +156,11 @@ s1 `rotateR` n = primS2 (rotateR) "rotateR" s1 (pureS n) complement s = primS1 (complement) "complement" s bitSize s = typeWidth (typeOfS s)+ bitSizeMaybe s = Just $ typeWidth (typeOfS s) isSigned s = isTypeSigned (typeOfS s)++instance (Show a, FiniteBits a, Rep a) => FiniteBits (Signal i a) where+ finiteBitSize s = typeWidth (typeOfS s) instance (Eq a, Show a, Fractional a, Rep a) => Fractional (Signal i a) where s1 / s2 = primS2 (/) "/" s1 s2
Language/KansasLava/Utils.hs view
@@ -109,7 +109,7 @@ -- | Predicate to see if a Signed value is positive. isPositive :: forall sig i ix . (sig ~ Signal i, Size ix, Integral ix, Rep ix) => sig (Signed ix) -> sig Bool isPositive a = bitNot $ testABit a (fromIntegral msb)- where msb = bitSize a - 1+ where msb = finiteBitSize a - 1 infixr 3 .&&. infixr 2 .||.
kansas-lava.cabal view
@@ -1,5 +1,5 @@ Name: kansas-lava-Version: 0.2.4.4+Version: 0.2.4.5 Synopsis: Kansas Lava is a hardware simulator and VHDL generator. Description: @@ -43,7 +43,7 @@ base >= 4 && < 5, dotgen >= 0.4.1, containers,- sized-types >= 0.3.4 && < 0.4,+ sized-types >= 0.3.5.2 && < 0.4, data-default, random, strict,@@ -53,7 +53,7 @@ process, netlist >= 0.3.1, netlist-to-vhdl >= 0.3.1,- template-haskell >= 2.11 && < 2.12,+ template-haskell >= 2.11, bytestring, data-reify == 0.6 Exposed-modules: