From: Christiaan Baaij Date: Fri, 31 Jul 2009 19:01:02 +0000 (+0200) Subject: Fix a few comments so Haddock will complete X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=46f158b38c85034e5bef234df4436ea279f895f9;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Fix a few comments so Haddock will complete --- diff --git "a/c\316\273ash/CLasH/Translator.hs" "b/c\316\273ash/CLasH/Translator.hs" index e221646..5f9978e 100644 --- "a/c\316\273ash/CLasH/Translator.hs" +++ "b/c\316\273ash/CLasH/Translator.hs" @@ -144,12 +144,12 @@ loadModules :: -> (HscTypes.CoreModule -> Ghc (Maybe CoreBndr)) -- ^ The TopEntity finder -> (HscTypes.CoreModule -> Ghc (Maybe CoreBndr)) -- ^ The InitState finder -> (HscTypes.CoreModule -> Ghc (Maybe CoreExpr)) -- ^ The TestInput finder - -> IO ( [HscTypes.CoreModule] -- ^ The loaded modules - , [Maybe CoreBndr] -- ^ The TopEntity - , [Maybe CoreBndr] -- ^ The InitState - , [Maybe CoreExpr] -- ^ The TestInput - , HscTypes.HscEnv -- ^ The Environment corresponding ot the loaded modules - ) + -> IO ( [HscTypes.CoreModule] + , [Maybe CoreBndr] + , [Maybe CoreBndr] + , [Maybe CoreExpr] + , HscTypes.HscEnv + ) -- ^ (The loaded modules , The TopEntity , The InitState, The TestInput, The Environment corresponding ot the loaded modules) loadModules libdir filenames topEntLoc initSLoc testLoc = defaultErrorHandler defaultDynFlags $ do runGhc (Just libdir) $ do @@ -164,7 +164,7 @@ loadModules libdir filenames topEntLoc initSLoc testLoc = -- | Find a binder in module according to a certain criteria findBind :: - GhcMonad m => -- ^ Expected to be run in some kind of GHC Monad + GhcMonad m => (Var.Var -> m Bool) -- ^ The criteria to filter the binds on -> HscTypes.CoreModule -- ^ The module to be inspected -> m (Maybe CoreBndr) -- ^ The (first) bind to meet the criteria @@ -176,7 +176,7 @@ findBind annotation core = do -- | Find an expresion in module according to a certain criteria findExpr :: - GhcMonad m => -- ^ Expected to be run in some kind off GHC Monad + GhcMonad m => (Var.Var -> m Bool) -- ^ The criteria to filter the binds on -> HscTypes.CoreModule -- ^ The module to be inspected -> m (Maybe CoreExpr) -- ^ The (first) expr to meet the criteria @@ -188,7 +188,7 @@ findExpr annotation core = do -- | Determine if a binder has an Annotation meeting a certain criteria hasCLasHAnnotation :: - GhcMonad m => -- ^ Expected to be run in some kind of GHC Monad + GhcMonad m => (CLasHAnn -> Bool) -- ^ The criteria the Annotation has to meet -> Var.Var -- ^ The Binder -> m Bool -- ^ Indicates if binder has the Annotation @@ -203,7 +203,7 @@ hasCLasHAnnotation clashAnn var = do -- | Determine if a binder has a certain name hasVarName :: - GhcMonad m => -- ^ Exprected to be run in some kind of GHC Monad + GhcMonad m => String -- ^ The name the binder has to have -> Var.Var -- ^ The Binder -> m Bool -- ^ Indicate if the binder has the name diff --git "a/c\316\273ash/CLasH/VHDL.hs" "b/c\316\273ash/CLasH/VHDL.hs" index 60b4f8a..fd83899 100644 --- "a/c\316\273ash/CLasH/VHDL.hs" +++ "b/c\316\273ash/CLasH/VHDL.hs" @@ -103,8 +103,8 @@ createLibraryUnits binds = do -- | Create an entity for a given function createEntity :: - (CoreSyn.CoreBndr, CoreSyn.CoreExpr) -- | The function - -> VHDLSession AST.EntityDec -- | The resulting entity + (CoreSyn.CoreBndr, CoreSyn.CoreExpr) -- ^ The function + -> VHDLSession AST.EntityDec -- ^ The resulting entity createEntity (fname, expr) = do -- Strip off lambda's, these will be arguments @@ -139,12 +139,12 @@ createEntity (fname, expr) = do return (id, type_mark) ) - -- | Create the VHDL AST for an entity +-- | Create the VHDL AST for an entity createEntityAST :: - AST.VHDLId -- | The name of the function - -> [Port] -- | The entity's arguments - -> Port -- | The entity's result - -> AST.EntityDec -- | The entity with the ent_decl filled in as well + AST.VHDLId -- ^ The name of the function + -> [Port] -- ^ The entity's arguments + -> Port -- ^ The entity's result + -> AST.EntityDec -- ^ The entity with the ent_decl filled in as well createEntityAST vhdl_id args res = AST.EntityDec vhdl_id ports @@ -158,9 +158,9 @@ createEntityAST vhdl_id args res = -- | Create a port declaration mkIfaceSigDec :: - AST.Mode -- | The mode for the port (In / Out) - -> (AST.VHDLId, AST.TypeMark) -- | The id and type for the port - -> AST.IfaceSigDec -- | The resulting port declaration + AST.Mode -- ^ The mode for the port (In / Out) + -> (AST.VHDLId, AST.TypeMark) -- ^ The id and type for the port + -> AST.IfaceSigDec -- ^ The resulting port declaration mkIfaceSigDec mode (id, ty) = AST.IfaceSigDec id mode ty diff --git "a/c\316\273ash/CLasH/VHDL/VHDLTools.hs" "b/c\316\273ash/CLasH/VHDL/VHDLTools.hs" index d1c008e..412e0c4 100644 --- "a/c\316\273ash/CLasH/VHDL/VHDLTools.hs" +++ "b/c\316\273ash/CLasH/VHDL/VHDLTools.hs" @@ -56,11 +56,11 @@ mkCondAssign dst cond true false = mkAssign dst (Just (cond, true)) false -- Create a conditional or unconditional assignment statement mkAssign :: - Either CoreBndr AST.VHDLName -> -- ^ The signal to assign to - Maybe (AST.Expr , AST.Expr) -> -- ^ Optionally, the condition to test for + Either CoreBndr AST.VHDLName -- ^ The signal to assign to + -> Maybe (AST.Expr , AST.Expr) -- ^ Optionally, the condition to test for -- and the value to assign when true. - AST.Expr -> -- ^ The value to assign when false or no condition - AST.ConcSm -- ^ The resulting concurrent statement + -> AST.Expr -- ^ The value to assign when false or no condition + -> AST.ConcSm -- ^ The resulting concurrent statement mkAssign dst cond false_expr = let -- I'm not 100% how this assignment AST works, but this gets us what we @@ -81,10 +81,10 @@ mkAssign dst cond false_expr = AST.CSSASm assign mkAssocElems :: - [AST.Expr] -- | The argument that are applied to function - -> AST.VHDLName -- | The binder in which to store the result - -> Entity -- | The entity to map against. - -> [AST.AssocElem] -- | The resulting port maps + [AST.Expr] -- ^ The argument that are applied to function + -> AST.VHDLName -- ^ The binder in which to store the result + -> Entity -- ^ The entity to map against. + -> [AST.AssocElem] -- ^ The resulting port maps mkAssocElems args res entity = -- Create the actual AssocElems zipWith mkAssocElem ports sigs