1 {-# LANGUAGE FlexibleContexts,GADTs,ExistentialQuantification,LiberalTypeSynonyms,TemplateHaskell #-}
5 import qualified Data.Param.TFVec as TFVec
7 import Language.Haskell.TH.Lift
10 -- hwand :: a -> a -> a
11 -- hwor :: a -> a -> a
12 -- hwxor :: a -> a -> a
15 -- -- Prettyprint a signal. We're not extending Show here, since show must
16 -- -- return a valid haskell syntax
17 -- displaysig :: a -> String
19 hwand :: Bit -> Bit -> Bit
20 hwor :: Bit -> Bit -> Bit
21 hwxor :: Bit -> Bit -> Bit
24 -- Prettyprint Bit signal. We're not extending Show here, since show must
25 -- return Bit valid haskell syntax
26 displaysig :: Bit -> String
28 --instance Signal Bit where
29 High `hwand` High = High
36 High `hwxor` Low = High
37 Low `hwxor` High = High
48 deriving (Show, Eq, Read)
52 -- A function to prettyprint a bitvector
54 --displaysigs :: (Signal s) => [s] -> String
55 displaysigs :: [Bit] -> String
56 displaysigs = (foldl (++) "") . (map displaysig)
60 -- An infinite streams of highs or lows
64 type BitVec len = TFVec.TFVec len Bit
66 -- vim: set ts=8 sw=2 sts=2 expandtab: