projects
/
matthijs
/
master-project
/
cλash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add mkNonRecLets and use it.
[matthijs/master-project/cλash.git]
/
Bits.hs
diff --git
a/Bits.hs
b/Bits.hs
index 435b04e1efc5cb0292b345111f5584a694cf2521..558a12b1f24b5b7465baecda7cc402eeabd84c30 100644
(file)
--- a/
Bits.hs
+++ b/
Bits.hs
@@
-1,11
+1,13
@@
-{-# LANGUAGE FlexibleContexts,GADTs,ExistentialQuantification,LiberalTypeSynonyms,TemplateHaskell #-}
+{-# LANGUAGE FlexibleContexts,GADTs,ExistentialQuantification,LiberalTypeSynonyms,TemplateHaskell
, DeriveDataTypeable
#-}
module Bits where
module Bits where
-import qualified Data.Param.TFVec as TFVec
-import qualified Types
+
--
import qualified Data.Param.TFVec as TFVec
+
--
import qualified Types
import Language.Haskell.TH.Lift
import Language.Haskell.TH.Lift
+import Data.Typeable
+
--class Signal a where
-- hwand :: a -> a -> a
-- hwor :: a -> a -> a
--class Signal a where
-- hwand :: a -> a -> a
-- hwor :: a -> a -> a
@@
-45,22
+47,22
@@
displaysig Low = "0"
-- The plain Bit type
data Bit = High | Low
-- The plain Bit type
data Bit = High | Low
- deriving (Show, Eq, Read)
+ deriving (Show, Eq, Read
, Typeable
)
$(deriveLift1 ''Bit)
-- A function to prettyprint a bitvector
--displaysigs :: (Signal s) => [s] -> String
$(deriveLift1 ''Bit)
-- A function to prettyprint a bitvector
--displaysigs :: (Signal s) => [s] -> String
-displaysigs :: [Bit] -> String
-displaysigs = (foldl (++) "") . (map displaysig)
+
--
displaysigs :: [Bit] -> String
+
--
displaysigs = (foldl (++) "") . (map displaysig)
-type Stream a = [a]
+
--
type Stream a = [a]
-- An infinite streams of highs or lows
-- An infinite streams of highs or lows
-lows = Low : lows
-highs = High : highs
-
-type BitVec len = TFVec.TFVec len Bit
+
--
lows = Low : lows
+
--
highs = High : highs
+--
+
--
type BitVec len = TFVec.TFVec len Bit
-- vim: set ts=8 sw=2 sts=2 expandtab:
-- vim: set ts=8 sw=2 sts=2 expandtab: