Support multiple alternative case expressions.
[matthijs/master-project/cλash.git] / Translator.hs
index 3cf456e0ea6118145796430b19d0487c24f630d9..98380606884c24ba953a07216d1bb788d1747d22 100644 (file)
@@ -43,12 +43,21 @@ import qualified VHDL
 
 main = do
   -- Load the module
-  core <- loadModule "Adders.hs"
+  core <- loadModule "Alu.hs"
   -- Translate to VHDL
-  vhdl <- moduleToVHDL core ["sfull_adder"]
+  vhdl <- moduleToVHDL core ["salu"]
   -- 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