Name signals in a function after flattening it.
[matthijs/master-project/cλash.git] / Pretty.hs
index 74ffec79cc52f268ef6217b3a66d5e05f2c944b9..ee4b3be78ec7c1facf6ea2402e753b943cf36f16 100644 (file)
--- a/Pretty.hs
+++ b/Pretty.hs
@@ -43,7 +43,8 @@ instance Pretty id => Pretty (CondDef id) where
   pPrint _ = text "TODO"
 
 instance Pretty id => Pretty (Signal id) where
-  pPrint (Signal id) = pPrint id
+  pPrint (Signal id Nothing) = pPrint id
+  pPrint (Signal id (Just name)) = pPrint id <> text ":" <> text name
 
 instance Pretty VHDLSession where
   pPrint (VHDLSession mod nameCount funcs) =
@@ -52,7 +53,9 @@ instance Pretty VHDLSession where
     $+$ text "Functions: " $$ nest 15 (vcat (map ppfunc (Map.toList funcs)))
     where
       ppfunc (hsfunc, (FuncData flatfunc)) =
-        pPrint hsfunc $+$ (text "Flattened: " $$ nest 15 (pPrint flatfunc))
+        pPrint hsfunc $+$ (text "Flattened: " $$ nest 15 (ppffunc flatfunc))
+      ppffunc (Just f) = pPrint f
+      ppffunc Nothing  = text "Nothing"
       modname = showSDoc $ Module.pprModule (HscTypes.cm_module mod)
 
 instance (OutputableBndr b) => Pretty (CoreSyn.Bind b) where