diff --git a/app/FiatLux/FiatLux.pcf b/app/FiatLux.pcf similarity index 100% rename from app/FiatLux/FiatLux.pcf rename to app/FiatLux.pcf diff --git a/app/FiatLux/Main.hs b/app/FiatLux/Main.hs deleted file mode 100644 index 61e9054..0000000 --- a/app/FiatLux/Main.hs +++ /dev/null @@ -1,63 +0,0 @@ -module Main where - -import Bayeux.Rtlil -import Development.Shake -import Data.Text (Text) -import qualified Data.Text.IO as TIO -import Prettyprinter -import Prettyprinter.Render.Text - -main :: IO () -main = shakeArgs shakeOptions{ shakeFiles = "_build" } $ do - - want ["_build/FiatLux.bin"] - - phony "clean" $ do - putInfo "Cleaning files in _build" - removeFilesAfter "_build" ["//*"] - - phony "compile" $ need ["_build/FiatLux.rtlil"] - phony "synth" $ need ["_build/FiatLux.json"] - phony "pnr" $ need ["_build/FiatLux.asc"] - phony "pack" $ need ["_build/FiatLux.bin"] - phony "prog" $ do - putInfo "Program VELDT" - need ["_build/FiatLux.bin"] - cmd_ "iceprog" "_build/FiatLux.bin" - - -- compile - "_build/FiatLux.rtlil" %> \out -> do - putInfo "compile FiatLux" - liftIO $ TIO.writeFile out $ render $ pretty fiatLux - - -- yosys synthesis - "_build/FiatLux.json" %> \out -> do - putInfo "Synthesizing" - need ["_build/FiatLux.rtlil"] - cmd_ "yosys" - "-q" - "-p" - ["synth_ice40 -json " ++ out] - "-f rtlil" - "_build/FiatLux.rtlil" - - -- place and route NextPNR - "_build/FiatLux.asc" %> \out -> do - putInfo "Place and Route" - need ["_build/FiatLux.json", "app/FiatLux/FiatLux.pcf"] - cmd_ "nextpnr-ice40" - "--up5k" - "--package sg48" - "--pcf app/FiatLux/FiatLux.pcf" - "--asc" - [out] - "--json _build/FiatLux.json" - - -- ice pack - "_build/FiatLux.bin" %> \out -> do - putInfo "Ice pack" - need ["_build/FiatLux.asc"] - cmd_ "icepack" "_build/FiatLux.asc" [out] - -render :: Doc ann -> Text -render = renderStrict . layoutSmart defaultLayoutOptions diff --git a/bayeux.cabal b/bayeux.cabal index 12d0a27..3f312db 100644 --- a/bayeux.cabal +++ b/bayeux.cabal @@ -40,17 +40,6 @@ executable bx hs-source-dirs: app default-language: Haskell2010 -executable FiatLux - ghc-options: -Wall - main-is: Main.hs - build-depends: base - , bayeux - , prettyprinter - , shake - , text - hs-source-dirs: app/FiatLux - default-language: Haskell2010 - test-suite test ghc-options: -Wall -threaded default-language: Haskell2010 diff --git a/lib/Bayeux.hs b/lib/Bayeux.hs index 2822c11..ea3d9ec 100644 --- a/lib/Bayeux.hs +++ b/lib/Bayeux.hs @@ -18,7 +18,7 @@ import Text.Megaparsec hiding (parse) app :: Cli -> IO () app = \case CliDemo demo iceprog -> case demo of - FiatLux -> flow iceprog "FiatLux" "app/FiatLux/FiatLux.pcf" fiatLux + FiatLux -> flow iceprog "FiatLux" "app/FiatLux.pcf" fiatLux RgbCounter -> flow iceprog "RgbCounter" "app/RgbCounter.pcf" rgbCounter RgbCycle -> flow iceprog "RgbCycle" "app/RgbCycle.pcf" rgbCycle CliProve cli -> do