X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=Adders.hs;h=6529642f4758ad640b1b93e736ef566e4b1f63eb;hb=b8c1e8554ba8aee73bc9d9a54bb3cb32f7930957;hp=3afb82fae22e6ecebd6349ac23da944ebbec95f5;hpb=b4ae262efb842ce254721f0f9ed9f0936241e094;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/Adders.hs b/Adders.hs index 3afb82f..6529642 100644 --- a/Adders.hs +++ b/Adders.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE TemplateHaskell #-} + module Adders where import Bits import qualified Sim @@ -11,6 +13,8 @@ import Language.Haskell.Syntax import Types import Data.Param.TFVec import Data.RangedWord +import Data.SizedInt +import Data.SizedWord mainIO f = Sim.simulateIO (Sim.stateless f) () @@ -172,8 +176,13 @@ highordtest = \x -> in \c d -> op' d c -functiontest :: TFVec D4 Bit -> TFVec D5 Bit -> RangedWord D3 -> RangedWord D4 -> (Bit, Bit) -functiontest = \v1 v2 i1 i2 -> let r1 = v1!i1 ; r2 = v2!i2 in (r1,r2) +xand a b = hwand a b + +functiontest :: TFVec D3 (TFVec D4 Bit) -> TFVec D12 Bit +functiontest = \v -> let r = concat v in r + +functiontest2 :: SizedInt D8 -> SizedInt D7 +functiontest2 = \a -> let r = Data.SizedInt.resize a in r xhwnot x = hwnot x