-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
214 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Prelude | ||
import Distribution.Extra.Doctest (defaultMainWithDoctests) | ||
|
||
main :: IO () | ||
main = defaultMainWithDoctests "doctests" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
import Prelude | ||
import System.Environment (getArgs) | ||
import Clash.Main (defaultMain) | ||
|
||
main :: IO () | ||
main = getArgs >>= defaultMain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
import Prelude | ||
import System.Environment (getArgs) | ||
import Clash.Main (defaultMain) | ||
|
||
main :: IO () | ||
main = getArgs >>= defaultMain . ("--interactive":) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
packages: | ||
clashfsm.cabal | ||
|
||
package clash-prelude | ||
-- 'large-tuples' generates tuple instances for various classes up to the | ||
-- GHC imposed maximum of 62 elements. This severely slows down compiling | ||
-- Clash, and triggers Template Haskell bugs on Windows. Hence, we disable | ||
-- it by default. This will be the default for Clash >=1.4. | ||
flags: -large-tuples | ||
|
||
write-ghc-environment-files: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
cabal-version: 2.4 | ||
name: clashfsm | ||
version: 0.1 | ||
license: BSD-2-Clause | ||
author: John Smith <[email protected]> | ||
maintainer: John Smith <[email protected]> | ||
|
||
common common-options | ||
default-extensions: | ||
BangPatterns | ||
BinaryLiterals | ||
ConstraintKinds | ||
DataKinds | ||
DefaultSignatures | ||
DeriveAnyClass | ||
DeriveDataTypeable | ||
DeriveFoldable | ||
DeriveFunctor | ||
DeriveGeneric | ||
DeriveLift | ||
DeriveTraversable | ||
DerivingStrategies | ||
InstanceSigs | ||
KindSignatures | ||
LambdaCase | ||
NoStarIsType | ||
PolyKinds | ||
RankNTypes | ||
ScopedTypeVariables | ||
StandaloneDeriving | ||
TupleSections | ||
TypeApplications | ||
TypeFamilies | ||
TypeOperators | ||
ViewPatterns | ||
|
||
-- TemplateHaskell is used to support convenience functions such as | ||
-- 'listToVecTH' and 'bLit'. | ||
TemplateHaskell | ||
QuasiQuotes | ||
|
||
-- Prelude isn't imported by default as Clash offers Clash.Prelude | ||
NoImplicitPrelude | ||
ghc-options: | ||
-Wall -Wcompat | ||
-haddock | ||
|
||
-- Plugins to support type-level constraint solving on naturals | ||
-fplugin GHC.TypeLits.Extra.Solver | ||
-fplugin GHC.TypeLits.Normalise | ||
-fplugin GHC.TypeLits.KnownNat.Solver | ||
|
||
-- Clash needs access to the source code in compiled modules | ||
-fexpose-all-unfoldings | ||
|
||
-- Worker wrappers introduce unstable names for functions that might have | ||
-- blackboxes attached for them. You can disable this, but be sure to add | ||
-- a no-specialize pragma to every function with a blackbox. | ||
-fno-worker-wrapper | ||
build-depends: | ||
base, | ||
Cabal, | ||
template-haskell, | ||
containers >= 0.6 && < 0.7, | ||
trifecta >= 2.1 && < 2.2, | ||
parsers >= 0.12 && < 0.13, | ||
unordered-containers >= 0.2 && < 0.3, | ||
haskell-src-meta >= 0.8 && < 0.9, | ||
prettyprinter >= 1.7 && < 1.8, | ||
mtl >= 2.2 && < 2.3, | ||
lens >= 4.19 && < 4.20, | ||
|
||
-- clash-prelude will set suitable version bounds for the plugins | ||
clash-prelude >= 1.2.5 && < 1.6, | ||
ghc-typelits-natnormalise, | ||
ghc-typelits-extra, | ||
ghc-typelits-knownnat | ||
|
||
|
||
custom-setup | ||
setup-depends: | ||
base >= 4.11 && <5, | ||
Cabal >= 2.4, | ||
cabal-doctest >= 1.0.1 && <1.1 | ||
|
||
library | ||
import: common-options | ||
hs-source-dirs: src | ||
exposed-modules: | ||
FSM, | ||
FSMDesc, | ||
FSMDescGenADT, | ||
FSMFreeVars, | ||
FSMLang, | ||
FSMLang2Desc, | ||
FSMLangParser, | ||
FSMLangPretty, | ||
FSMLangProcess | ||
default-language: Haskell2010 | ||
|
||
-- Builds the executable 'clash', with clashfsm project in scope | ||
executable clash | ||
main-is: bin/Clash.hs | ||
default-language: Haskell2010 | ||
Build-Depends: base, clash-ghc, clashfsm | ||
if !os(Windows) | ||
ghc-options: -dynamic | ||
|
||
-- Builds the executable 'clashi', with clashfsm project in scope | ||
executable clashi | ||
main-is: bin/Clashi.hs | ||
default-language: Haskell2010 | ||
if !os(Windows) | ||
ghc-options: -dynamic | ||
build-depends: base, clash-ghc, clashfsm | ||
|
||
-- test-suite doctests | ||
-- import: common-options | ||
-- type: exitcode-stdio-1.0 | ||
-- default-language: Haskell2010 | ||
-- main-is: doctests.hs | ||
-- hs-source-dirs: tests | ||
-- | ||
-- build-depends: | ||
-- base, | ||
-- clashfsm, | ||
-- process, | ||
-- doctest >= 0.16.1 && < 0.18 | ||
-- | ||
-- test-suite test-library | ||
-- import: common-options | ||
-- default-language: Haskell2010 | ||
-- hs-source-dirs: tests | ||
-- type: exitcode-stdio-1.0 | ||
-- ghc-options: -threaded | ||
-- main-is: unittests.hs | ||
-- other-modules: | ||
-- Tests.Example.Project | ||
-- build-depends: | ||
-- clashfsm, | ||
-- QuickCheck, | ||
-- hedgehog, | ||
-- tasty >= 1.2 && < 1.3, | ||
-- tasty-hedgehog, | ||
-- tasty-th | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
resolver: lts-17.13 | ||
|
||
extra-deps: | ||
# At the time of writing, no snapshot includes Clash 1.4 yet so we add it - and | ||
# its dependencies - manually. | ||
- lazysmallcheck-0.6 | ||
- Stream-0.4.7.2 | ||
- arrows-0.4.4.2 | ||
- clash-prelude-1.4.2 | ||
- clash-lib-1.4.2 | ||
- clash-ghc-1.4.2 |