Merge branch 'master' of git://github.com/christiaanb/clash into cλash
authorMatthijs Kooijman <m.kooijman@student.utwente.nl>
Fri, 31 Jul 2009 09:26:59 +0000 (11:26 +0200)
committerMatthijs Kooijman <m.kooijman@student.utwente.nl>
Fri, 31 Jul 2009 09:26:59 +0000 (11:26 +0200)
* 'master' of git://github.com/christiaanb/clash:
  Quick hack implementation of FSVec literals, needs to be fixed
  We need the latest vhdl package
  We now make a show function for all default datatypes.
  Add automated testbench generation according to supplied test input

Conflicts:
cλash/CLasH/Translator.hs

cλash/CLasH/Translator.hs
cλash/CLasH/Utils/Core/CoreShow.hs

index c35e33826b42c19dc1b8af86826c22f8093abb75..a3471432e11b15067949690b75ee8ff13399d399 100644 (file)
@@ -91,11 +91,13 @@ listBinding :: (CoreBndr, CoreExpr) -> IO ()
 listBinding (b, e) = do
   putStr "\nBinder: "
   putStr $ show b
-  putStr "\nExpression: \n"
+  putStr "\nType of Binder: \n"
+  putStr $ showSDoc $ ppr $ Var.varType b
+  putStr "\n\nExpression: \n"
   putStr $ prettyShow e
   putStr "\n\n"
   putStr $ showSDoc $ ppr e
-  putStr "\n\n"
+  putStr "\n\nType of Expression: \n"
   putStr $ showSDoc $ ppr $ CoreUtils.exprType e
   putStr "\n\n"
   
@@ -104,13 +106,7 @@ listBind :: FilePath -> String -> String -> IO ()
 listBind libdir filename name = do
   (core, env) <- loadModule libdir filename
   let [(b, expr)] = findBinds core [name]
-  putStr "\n"
-  putStr $ prettyShow expr
-  putStr "\n\n"
-  putStr $ showSDoc $ ppr expr
-  putStr "\n\n"
-  putStr $ showSDoc $ ppr $ CoreUtils.exprType expr
-  putStr "\n\n"  
+  listBinding (b, expr)
 
 -- | Translate the binds with the given names from the given core module to
 --   VHDL. The Bool in the tuple makes the function stateful (True) or
index ac6b1d118c97413a17635fec15ef12a3209c4a50..1db286ec6a7ff27d76826f77da891c4679333b33 100644 (file)
@@ -32,6 +32,7 @@ deriving instance (Show x, OutputableBndr x) => Show (HsExpr.HsExpr x)
 deriving instance Show (RdrName.RdrName)
 deriving instance (Show idL, Show idR, OutputableBndr idL, OutputableBndr idR) => Show (HsBinds.HsBindLR idL idR)
 deriving instance Show CoreSyn.Note
+deriving instance Show TyCon.SynTyConRhs
 
 
 -- Implement dummy shows, since deriving them will need loads of other shows
@@ -39,7 +40,26 @@ deriving instance Show CoreSyn.Note
 instance Show TypeRep.PredType where
   show t = "_PredType:(" ++ (showSDoc $ ppr t) ++ ")"
 instance Show TyCon.TyCon where
-  show t = "_TyCon:(" ++ (showSDoc $ ppr t) ++ ")"
+  show t | TyCon.isAlgTyCon t && not (TyCon.isTupleTyCon t) =
+           showtc "AlgTyCon" ""
+         | TyCon.isCoercionTyCon t =
+           showtc "CoercionTyCon" ""
+         | TyCon.isSynTyCon t =
+           showtc "SynTyCon" (", synTcRhs = " ++ synrhs)
+         | TyCon.isTupleTyCon t =
+           showtc "TupleTyCon" ""
+         | TyCon.isFunTyCon t =
+           showtc "FunTyCon" ""
+         | TyCon.isPrimTyCon t =
+           showtc "PrimTyCon" ""
+         | TyCon.isSuperKindTyCon t =
+           showtc "SuperKindTyCon" ""
+         | otherwise = 
+           "_Nonexistant tycon?:(" ++ (showSDoc $ ppr t) ++ ")_"
+      where
+        showtc con extra = "(" ++ con ++ " {tyConName = " ++ name ++ extra ++ ", ...})"
+        name = show (TyCon.tyConName t)
+        synrhs = show (TyCon.synTyConRhs t)
 instance Show BasicTypes.Boxity where
   show b = "_Boxity"
 instance Show HsTypes.HsExplicitForAll where