Restructure the "finder" functions.
[matthijs/master-project/cλash.git] / cλash / CLasH / Translator / TranslatorTypes.hs
index de7ee52055b23835174e29571c8172df04705283..257c543e2f9f799980f8035ab89bb7ac4b009050 100644 (file)
@@ -12,6 +12,7 @@ import qualified Data.Accessor.Template
 import Data.Accessor
 
 -- GHC API
+import qualified GHC
 import qualified CoreSyn
 import qualified Type
 import qualified HscTypes
@@ -23,6 +24,20 @@ import qualified Language.VHDL.AST as AST
 -- Local imports
 import CLasH.VHDL.VHDLTypes
 
+-- | A specification of an entity we can generate VHDL for. Consists of the
+--   binder of the top level entity, an optional initial state and an optional
+--   test input.
+type EntitySpec = (CoreSyn.CoreBndr, Maybe CoreSyn.CoreExpr, Maybe CoreSyn.CoreExpr)
+
+-- | A function that knows which parts of a module to compile
+type Finder =
+  HscTypes.CoreModule -- ^ The module to look at
+  -> GHC.Ghc [EntitySpec]
+
+-----------------------------------------------------------------------------
+-- The TranslatorSession
+-----------------------------------------------------------------------------
+
 -- A orderable equivalent of CoreSyn's Type for use as a map key
 newtype OrdType = OrdType { getType :: Type.Type }
 instance Eq OrdType where