Hoogle Search
Within LTS Haskell 24.42 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
type
PackageDescriptionOverride = Maybe ByteStringcabal-install-solver Distribution.Solver.Types.SourcePackage We sometimes need to override the .cabal file in the tarball with the newer one from the package index.
PackageVar :: qpn -> Variable qpncabal-install-solver Distribution.Solver.Types.Variable No documentation available.
type
Parser = Parsec ConversionError ByteStringcassava-megaparsec Data.Csv.Parser.Megaparsec.Internals Parser type that uses “custom error component” ConversionError.
-
cdar-mBound Data.CDAR.Approx A type synonym. Used to denote number of bits after binary point.
-
cdar-mBound Data.CDAR.Extended No documentation available.
-
An implementation of the program side of the CGI protocol.
module Clash.Annotations.
Primitive Instruct the Clash compiler to look for primitive HDL templates provided inline or in a specified directory. For distribution of new packages with primitive HDL templates. Primitive guards can be added to warn on instantiating primitives.
-
clash-prelude Clash.Annotations.Primitive The Primitive constructor instructs the clash compiler to look for primitive HDL templates in the indicated directory. InlinePrimitive is equivalent but provides the HDL template inline. They are intended for the distribution of new packages with primitive HDL templates.
Example of Primitive
You have some existing IP written in one of HDLs supported by Clash, and you want to distribute some bindings so that the IP can be easily instantiated from Clash. You create a package which has a myfancyip.cabal file with the following stanza:data-files: path/to/MyFancyIP.primitives cpp-options: -DCABAL
and a MyFancyIP.hs module with the simulation definition and primitive.module MyFancyIP where import Clash.Prelude myFancyIP :: ... myFancyIP = ... {-# NOINLINE myFancyIP #-}The NOINLINE pragma is needed so that GHC will never inline the definition. Now you need to add the following imports and ANN pragma:#ifdef CABAL import Clash.Annotations.Primitive import System.FilePath import qualified Paths_myfancyip import System.IO.Unsafe {-# ANN module (Primitive [VHDL] (unsafePerformIO Paths_myfancyip.getDataDir </> "path" </> "to")) #-} #endifAdd more files to the data-files stanza in your .cabal files and more ANN pragma's if you want to add more primitive templates for other HDLsExample of InlineYamlPrimitive
The following example shows off an inline HDL primitive template. It uses the string-interpolate package for nicer multiline strings.{-# LANGUAGE QuasiQuotes #-} module InlinePrimitive where import Clash.Annotations.Primitive import Clash.Prelude import Data.String.Interpolate (__i) {-# ANN example (InlineYamlPrimitive [VHDL] [__i| BlackBox: kind: Declaration name: InlinePrimitive.example template: |- -- begin InlinePrimitive example: ~GENSYM[example][0] : block ~RESULT <= 1 + ~ARG[0]; end block; -- end InlinePrimitive example |]) #-} {-# NOINLINE example #-} example :: Signal System (BitVector 2) -> Signal System (BitVector 2) example = fmap succ Primitive :: [HDL] -> FilePath -> Primitiveclash-prelude Clash.Annotations.Primitive Description of a primitive for given HDLs in a file at FilePath
-
clash-prelude Clash.Annotations.Primitive Primitive guard to mark a value as either not translatable or as having a blackbox with an optional extra warning. Helps Clash generate better error messages. For use, see dontTranslate, hasBlackBox, warnNonSynthesizable and warnAlways.