packages feed

copilot-sbv 0.2 → 0.3

raw patch · 2 files changed

+35/−3 lines, 2 filesdep +filepathPVP ok

version bump matches the API change (PVP)

Dependencies added: filepath

API changes (from Hackage documentation)

Files

copilot-sbv.cabal view
@@ -1,6 +1,6 @@ cabal-version             : >= 1.10 name                      : copilot-sbv-version                   : 0.2+version                   : 0.3 synopsis                  : A compiler for CoPilot targeting SBV. description               : Blah blah blah... license                   : BSD3@@ -32,6 +32,7 @@                           , containers >= 0.4                           , copilot-core                           , pretty >= 1                         +                          , filepath >= 1.1    exposed-modules         : Copilot.Compile.SBV                           , Copilot.Compile.SBV.Code
src/Copilot/Compile/SBV.hs view
@@ -20,12 +20,14 @@ import Copilot.Compile.SBV.MetaTable (allocMetaTable) import Copilot.Compile.SBV.Params +import System.FilePath (combine)+ --------------------------------------------------------------------------------  -- Note: we put everything in a directory named by the dirName.  sbvDirName :: String-sbvDirName = "copilot-sbv"+sbvDirName = "copilot-sbv-codegen"  compile :: Params -> C.Spec -> IO () compile params spec = do@@ -36,7 +38,7 @@    S.compileToCLib     (Just dirName)-    sbvName+    sbvName $ omitSBVDriver     (  updateStates    meta spec     ++ updateObservers meta spec     ++ fireTriggers    meta spec @@ -56,6 +58,35 @@                ++ makefileName params ++ " .."   makefile params dirName sbvName +  putStrLn ""+  putStrLn "Writing README .."+  writeFile (combine dirName "README") (unlines readme)+  putStrLn ""+   putStrLn "Done."++--------------------------------------------------------------------------------++readme :: [String]+readme = +  [ "These files are automatically generated by Copilot using the SBV code generator backend."+  , ""+  , "To build, you will need to ensure that all external variables and triggers are visible."+  , "Also, modify driver.c to include a main() function."+  , "Once you have a valid C program, execute"+  , ""+  , "  > make driver"+  , ""+  , "Modify the Makefile rules (Makefile and copilot.mk) as you see fit."+  , ""+  , "Please report bugs to lee pike at gmail . com (remove all spaces)."+  ]++--------------------------------------------------------------------------------++omitSBVDriver :: [(a, S.SBVCodeGen ())] -> [(a, S.SBVCodeGen ())]+omitSBVDriver = map omit +  where+  omit (a, cg) = (a, S.cgGenerateDriver False >> cg)  --------------------------------------------------------------------------------