From e73057cb92295256ab62810771da8e723f4a8223 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 17 Feb 2009 15:52:57 +0100 Subject: [PATCH] Move the DesignFile creation to VHDL. --- Translator.hs | 8 +------- VHDL.hs | 10 ++++++++++ 2 files changed, 11 insertions(+), 7 deletions(-) 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 -- 2.30.2