clash-lib-0.9999: CAES Language for Synchronous Hardware - As a Library
Copyright(C) 2012-2016 University of Twente
2017 Myrtle Software Ltd
2018 Google Inc.
LicenseBSD2 (see the file LICENSE)
MaintainerChristiaan Baaij <christiaan.baaij@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Clash.Primitives.Util

Description

Utility functions to generate Primitives

Synopsis

Documentation

generatePrimMap Source #

Arguments

:: HasCallStack 
=> [UnresolvedPrimitive]

unresolved primitives found in annotations (in LoadModules and LoadInterfaceFiles)

-> [(Text, PrimitiveGuard ())] 
-> [FilePath]

Directories to search for primitive definitions

-> IO ResolvedPrimMap 

Generate a set of primitives that are found in the primitive definition files in the given directories.

hashCompiledPrimMap :: CompiledPrimMap -> Int Source #

Hash a compiled primitive map. It needs a separate function (as opposed to just hash) as it might contain (obviously unhashable) Haskell functions. This function takes the hash value stored with the function instead.

constantArgs :: Text -> CompiledPrimitive -> Set Int Source #

Determine what argument should be constant / literal

decodeOrErr Source #

Arguments

:: (HasCallStack, FromJSON a) 
=> FilePath

Path read from (for error message)

-> ByteString

Bytestring to parse

-> a 

Parse a ByteString according to the given JSON template. Throws exception if it fails.