Store a use for each signal in a flattened function.
[matthijs/master-project/cλash.git] / Pretty.hs
index 2bf57f761541e3280bec0a32175c78a12d81b344..6f5f63dc71b46323fb582674992bd18e7c335d19 100644 (file)
--- a/Pretty.hs
+++ b/Pretty.hs
@@ -47,8 +47,17 @@ instance Pretty id => Pretty (CondDef id) where
   pPrint _ = text "TODO"
 
 instance Pretty SignalInfo where
-  pPrint (SignalInfo Nothing ty) = empty
-  pPrint (SignalInfo (Just name) ty) = text ":" <> text name
+  pPrint (SignalInfo name use ty) =
+    text ":" <> (pPrint use) <> (ppname name)
+    where
+      ppname Nothing = empty
+      ppname (Just name) = text ":" <> text name
+
+instance Pretty SigUse where
+  pPrint SigPort     = text "P"
+  pPrint SigInternal = text "I"
+  pPrint SigState    = text "S"
+  pPrint SigSubState = text "s"
 
 instance Pretty VHDLSession where
   pPrint (VHDLSession mod nameCount funcs) =