clash-lib
Copyright(C) 2012-2016 University of Twente
2016-2017 Myrtle Software Ltd
2017 Google Inc.
2021-2024 QBayLogic B.V.
2022 Google Inc.
LicenseBSD2 (see the file LICENSE)
MaintainerQBayLogic B.V. <devops@qbaylogic.com>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Clash.Netlist.BlackBox

Description

Functions to create BlackBox Contexts and fill in BlackBox templates

Synopsis

Documentation

mkBlackBoxContext Source #

Arguments

:: HasCallStack 
=> Text

Blackbox function name

-> [Id]

Identifiers binding the primitive/blackbox application

-> [Either Term Type]

Arguments of the primitive/blackbox application

-> NetlistMonad (BlackBoxContext, [Declaration]) 

Generate the context for a BlackBox instantiation.

extractPrimWarnOrFail Source #

Arguments

:: HasCallStack 
=> Text

Name of primitive

-> NetlistMonad CompiledPrimitive 

Extract a compiled primitive from a guarded primitive. Emit a warning if the guard wants to, or fail entirely.

mkPrimitive Source #

Arguments

:: Bool

Put BlackBox expression in parenthesis

-> Bool

Treat BlackBox expression as declaration

-> DeclarationType

Are we concurrent or sequential?

-> NetlistId

Id to assign the result to

-> PrimInfo

Primitive info

-> [Either Term Type]

Arguments

-> [Declaration]

Tick declarations

-> NetlistMonad (Expr, [Declaration]) 

isLiteral :: Term -> Bool Source #

Determine if a term represents a literal