From: Matthijs Kooijman Date: Wed, 18 Feb 2009 15:06:20 +0000 (+0100) Subject: Add a listBind function to show the Core for a bind. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=c77b7153a516c7dab7824520dd391189270a570b;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Add a listBind function to show the Core for a bind. This function is meant to be used from the ghci console. --- diff --git a/Translator.hs b/Translator.hs index 3cf456e..53befc2 100644 --- a/Translator.hs +++ b/Translator.hs @@ -49,6 +49,15 @@ main = do -- Write VHDL to file writeVHDL vhdl "../vhdl/vhdl/output.vhdl" +-- | Show the core structure of the given binds in the given file. +listBind :: String -> String -> IO () +listBind filename name = do + core <- loadModule filename + let binds = findBinds core [name] + putStr "\n" + putStr $ prettyShow binds + putStr "\n\n" + -- | Translate the binds with the given names from the given core module to -- VHDL moduleToVHDL :: HscTypes.CoreModule -> [String] -> IO AST.DesignFile