1 {-# LANGUAGE FlexibleContexts,GADTs,ExistentialQuantification,LiberalTypeSynonyms #-}
5 import qualified Data.Param.TFVec as TFVec
9 -- hwand :: a -> a -> a
10 -- hwor :: a -> a -> a
11 -- hwxor :: a -> a -> a
14 -- -- Prettyprint a signal. We're not extending Show here, since show must
15 -- -- return a valid haskell syntax
16 -- displaysig :: a -> String
18 hwand :: Bit -> Bit -> Bit
19 hwor :: Bit -> Bit -> Bit
20 hwxor :: Bit -> Bit -> Bit
23 -- Prettyprint Bit signal. We're not extending Show here, since show must
24 -- return Bit valid haskell syntax
25 displaysig :: Bit -> String
27 --instance Signal Bit where
28 High `hwand` High = High
35 High `hwxor` Low = High
36 Low `hwxor` High = High
47 deriving (Show, Eq, Read)
49 -- A function to prettyprint a bitvector
51 --displaysigs :: (Signal s) => [s] -> String
52 displaysigs :: [Bit] -> String
53 displaysigs = (foldl (++) "") . (map displaysig)
57 -- An infinite streams of highs or lows
61 type BitVec len = TFVec.TFVec len Bit
63 -- vim: set ts=8 sw=2 sts=2 expandtab: