From da5bb0c8cfdc783b2801cef3bc8d875d3f5b6f53 Mon Sep 17 00:00:00 2001 From: Christiaan Baaij Date: Sun, 2 Aug 2009 20:51:29 +0200 Subject: [PATCH] Reflect API changes of clash in clash-nolibdir --- "c\316\273ash-nolibdir/CLasH/Translator.hs" | 37 +++++++++++--------- "c\316\273ash-nolibdir/CLasH/Utils.hs" | 16 +++++++++ "c\316\273ash-nolibdir/clash-nolibdir.cabal" | 1 + 3 files changed, 37 insertions(+), 17 deletions(-) create mode 100644 "c\316\273ash-nolibdir/CLasH/Utils.hs" diff --git "a/c\316\273ash-nolibdir/CLasH/Translator.hs" "b/c\316\273ash-nolibdir/CLasH/Translator.hs" index 77c1fe3..45c0cca 100644 --- "a/c\316\273ash-nolibdir/CLasH/Translator.hs" +++ "b/c\316\273ash-nolibdir/CLasH/Translator.hs" @@ -1,24 +1,27 @@ module CLasH.Translator where import qualified GHC.Paths -import qualified "clash" CLasH.Translator as Original (makeVHDL, makeVHDLAnn, listBindings, listBind) +import qualified "clash" CLasH.Translator as Original (makeVHDLStrings, makeVHDLAnnotations) -makeVHDL :: String -> String -> Bool -> IO () -makeVHDL filename name stateful = do +-- | Turn Haskell to VHDL, Usings Strings to indicate the Top Entity, Initial +-- State and Test Inputs. +makeVHDLStrings :: + -> [FilePath] -- ^ The FileNames + -> String -- ^ The TopEntity + -> String -- ^ The InitState + -> String -- ^ The TestInput + -> Bool -- ^ Is it stateful? (in case InitState is empty) + -> IO () +makeVHDLStrings filenames topentity initstate testinput stateful = do let libdir = GHC.Paths.libdir - Original.makeVHDL libdir filename name stateful + Original.makeVHDLStrings libdir filenames topentity initstate testinput stateful -makeVHDLAnn :: String -> IO () -makeVHDLAnn filename = do +-- | Turn Haskell to VHDL, Using the Annotations for Top Entity, Initial State +-- and Test Inputs found in the Files. +makeVHDLAnnotations :: + -> [FilePath] -- ^ The FileNames + -> Bool -- ^ Is it stateful? (in case InitState is not specified) + -> IO () +makeVHDLAnnotations libdir filenames stateful = do let libdir = GHC.Paths.libdir - Original.makeVHDLAnn libdir filename - -listBindings :: String -> IO [()] -listBindings filename = do - let libdir = GHC.Paths.libdir - Original.listBindings libdir filename - -listBind :: String -> String -> IO () -listBind filename name = do - let libdir = GHC.Paths.libdir - Original.listBind libdir filename name + Original.makeVHDLAnnotations libdir filenames stateful diff --git "a/c\316\273ash-nolibdir/CLasH/Utils.hs" "b/c\316\273ash-nolibdir/CLasH/Utils.hs" new file mode 100644 index 0000000..14b1857 --- /dev/null +++ "b/c\316\273ash-nolibdir/CLasH/Utils.hs" @@ -0,0 +1,16 @@ +module CLasH.Utils where + +import qualified GHC.Paths +import qualified "clash" CLasH.Utils as Original (listBindings, listBind) + +-- | Show the core structure of all the binds in the given file. +listBindings :: [FilePath] -> IO [()] +listBindings filenames = do + let libdir = GHC.Paths.libdir + Original.listBindings libdir filename + +-- | Show the core structure of the given binds in the given file. +listBind :: [FilePath] -> String -> IO () +listBind filename name = do + let libdir = GHC.Paths.libdir + Original.listBind libdir filename name \ No newline at end of file diff --git "a/c\316\273ash-nolibdir/clash-nolibdir.cabal" "b/c\316\273ash-nolibdir/clash-nolibdir.cabal" index 7ed0838..18deb67 100644 --- "a/c\316\273ash-nolibdir/clash-nolibdir.cabal" +++ "b/c\316\273ash-nolibdir/clash-nolibdir.cabal" @@ -20,4 +20,5 @@ Library build-depends: base > 4, clash, ghc-paths extensions: PackageImports exposed-modules: CLasH.Translator + CLasH.Utils -- 2.30.2