From: Matthijs Kooijman Date: Tue, 17 Feb 2009 14:52:57 +0000 (+0100) Subject: Move the DesignFile creation to VHDL. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=e73057cb92295256ab62810771da8e723f4a8223;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Move the DesignFile creation to VHDL. --- diff --git a/Translator.hs b/Translator.hs index c037a1e..9cced34 100644 --- a/Translator.hs +++ b/Translator.hs @@ -72,13 +72,7 @@ main = modFuncs nameFlatFunction modFuncs VHDL.createEntity modFuncs VHDL.createArchitecture - -- Extract the library units generated from all the functions in the - -- session. - funcs <- getFuncs - let units = concat $ map VHDL.getLibraryUnits funcs - return $ AST.DesignFile - [] - units + VHDL.getDesignFile findBind :: [CoreBind] -> String -> Maybe CoreBind findBind binds lookfor = diff --git a/VHDL.hs b/VHDL.hs index ee61c50..5d57bb5 100644 --- a/VHDL.hs +++ b/VHDL.hs @@ -20,6 +20,16 @@ import FlattenTypes import TranslatorTypes import Pretty +getDesignFile :: VHDLState AST.DesignFile +getDesignFile = do + -- Extract the library units generated from all the functions in the + -- session. + funcs <- getFuncs + let units = concat $ map getLibraryUnits funcs + return $ AST.DesignFile + [] + units + -- | Create an entity for a given function createEntity :: HsFunction -- | The function signature