h&*1      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                                                            !!!!!!!!!!!""""""""""###### # # # # # # # # #                                         $ $ $ $ % % % % % % % % % % % % % % % % % % % % % % % % & & & & & & & & & & & & & & & & & ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '  ( ( ( ( ( ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) * * * * * + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , , , , , , , - - - - - - - - - - - - - - . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0                                                                                                                                                                                                                                                                       111122222222222222222222222222222222222222222222222222222222222222222222222222223333333344444444444444444444444444556666666678999999:;<<<<<<<<<<============>>>>>>>????????????????????????                      @@AAAAAAAAABBCDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFGHIIJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJKKKKKKKCCCCCCCCCCCCCCCCCCCCCCCCCCLLLLLLLLLLLLLLLLLLLLLLMMMNNNNNNOOOOOPPQQQQQRRRRRRRRRRSSSSSSTTTTTT555UUUUUUUUUUUUU@@@@@@@@@@AAAAAAAAAVWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWXXXXXXXXXXXXXXXYYYYZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ[[[[\\\\\\\\\\\\]]]]]]]]]]]]]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^____```aaaa(C) 2022, Google Inc.,BSD2 (see the file LICENSE)%QBayLogic B.V. None%&/02356789:;<7  clash-lib3Verilog timescale. Influences simulation precision.  clash-lib(Time step in wait statements, e.g. `#1`. clash-libSimulator precision - all units will get rounded to this period. clash-lib:Verilog time period. A combination of a length and a unit. clash-libVerilog time units clash-lib Pretty print   to Verilog `timescale4scaleToString (Scale (Period 100 Ps) (Period 10 Fs))"`timescale 100ps/10fs" clash-libConvert  to Verilog time unitperiodToString (Period 100 Fs)"100fs" clash-libConvert  to Verilog time unitunitToString Ms"ms" clash-lib1Parse string representing a Verilog time unit to .parseUnit "ms"Just MsparseUnit "xs"Nothing clash-libParse a VerilogparsePeriod "100ms"Just (Period 100 Ms)parsePeriod "100xs"NothingparsePeriod "100"NothingparsePeriod "ms"Nothing clash-libConvert a period to a specific time unit. Will always output a minimum of 1, even if the given  is already of the right .convertUnit Ps (Period 100 Ps)100convertUnit Fs (Period 100 Ps)100000convertUnit Ns (Period 100 Ps)1convertUnit Ms (Period 0 Ms)1    None&/02356789;<8_1 clash-lib0Performs trace when first argument evaluates to 0101(C) 2024, Martijn BastiaanBSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789:;<9245367245367(C) 2020, QBayLogicBSD2 (see the file LICENSE)%QBayLogic B.V.  Safe-Inferred &/02356789;<= W clash-libTool-specific configuration used by Edalize. Currently only tools which are supported by Clash are provided.^ clash-libA subset of the file types recognized by Edalize. The supported formats are largely from IP-XACT 2014 (IEEE 1685-2014), although Edalize extends this with other types, e.g. QSYS.8Only file types which are generated by Clash are listed._ clash-libUnknown file type.` clash-lib VHDL source.a clash-libVerilog source.b clash-libSystemVerilog source.c clash-libTool Command Language source.d clash-libQSys system source.e clash-lib#Synopsys Design Constraints source.f clash-libInformation about each file in the project. This does not include is_include_file or include_path, as these are not currently used by Clash.k clash-libEDAM data structure to be given to an Edalize backend. This contains all information needed to generate a project scaffolding. Note that hooks and VPI modules are currently not specified by clash.1ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopq1klmnopfghij^_`abcdeWXYZ[\]STUVOPQRKLMNDEFGHIJABCq (C) 2024, QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789;<>> (C) 2021 , QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789;<Br clash-lib>Compare two values using pointer equality. If that fails, use  to determine equality. Note that this function will only shortcut for values that are the same, but will always use  for values that differ.Values are evaluated to WHNF before comparison. This function can therefore not be used if any of its arguments is expected to be bottom. clash-libCompare two values using pointer equality. If that fails, use given function to determine equality. Note that this function will only shortcut for values that are the same, but will always use the given function for values that differ.Values are evaluated to WHNF before comparison. This function can therefore not be used if any of its arguments is expected to be bottom. (C) 2019-2022, QBayLogic B.V. 2013 , Nikita VolkovBSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789;<E clash-libi will reflow the quasi-quoted text to 90 columns wide. If an interpolation variable is on its own line and expands to a multi-line string, the interpolated text will be indented the same as the interpolation variable was: :set -XQuasiQuotes :{ a = "Multi\nLine\nString" b = [i| This line will be reflowed and the interpolated multi-line string here: #{a} will be indented. This text is outdented again. |] :} putStrLn bThis line will be reflowed and the interpolated multi-line string here: Multi Line String will be indented. This text is outdented again. None&/02356789;<G clash-lib A variant of Pretty that is not polymorphic on the type of annotations. This is needed to derive instances from Clash's pretty printer (PrettyPrec), which annotates documents with Clash-specific information and, therefore, fixes the type of annotations.None &/02356789;<PP clash-libA map indexed by a . Typically the elements of this map are also uniqueable and provide their own key, however a unique can be associated with any value. clash-lib An empty map. clash-libA map containing a single value indexed by the given key's unique. clash-lib>A map containing a single value indexed by the value's unique. clash-libCheck if the map is empty. clash-lib)Insert a new key-value pair into the map. clash-libInsert a new value into the map, using the unique of the value as the key. clash-libInsert a new key-value pair into the map, using the given combining function if there is already an entry with the same unique in the map. clash-lib.Insert a list of key-value pairs into the map. clash-lib=Lookup an item in the map, using the unique of the given key. clash-libLookup and item in the map, using the unique of the given key. If the item is not found in the map an error is raised. clash-libCheck if there is an entry in the map for the unique of the given value. clash-libCheck if there is not an entry in the map for the unique of the given value. clash-lib;Filter all elements in the map according to some predicate. clash-libApply a function to all elements in the map, keeping those where the result is not Nothing. clash-lib8Lazily right-fold over the map using the given function. clash-lib9Strictly left-fold over the map using the given function. clash-libDelete the entry in the map indexed by the unique of the given value. clash-libDelete all entries in the map indexed by the uniques of the given values. clash-libMerge two unique maps, using the given combining funcion if a value with the same unique key exists in both maps. clash-libFilter the first map to only contain keys which are not in the second map. clash-lib3Check if there are no common keys between two maps. clash-lib(Check if one map is a submap of another. clash-lib+Convert a list of key-value pairs to a map. clash-lib.Convert a map to a list of unique-value pairs. clash-libGet the unique keys of a map. clash-libGet the values of a map.b Safe-Inferred&/02356789;<Q c Safe-Inferred&/02356789;<U clash-libMonadic version of de clash-libMonadic version of df clash-libMonadic version of . A carbon copy (iterateM1) would not terminate, hence the first argument. clash-lib&Applicative version of 'GHC.Types.(:)' clash-libSafe indexing, returns a  if the index does not exist clash-libLike 8, but the predicate operates over two lists. Asserts to & when the lists are of unequal length clash-lib1Return number of occurrences of an item in a list clash-libZip two lists of equal lengthNB Errors out for a 1 compiler when the two lists are not of equal length clash-lib Only iterate n times. Note that n is the length of the resulting list, _not_ the number of times the iteration function has been invoked clash-libIteration function clash-lib Start value clash-libHaystack clash-lib"Times needle was found in haystack5gNone&/02356789;<Wh Safe-Inferred&/02356789;<>WQiNone&/02356789;<W(C) 2012-2016, University of Twente, 2016 , Myrtle Software Ltd, 2017 , Google Inc., 2021 , QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789:;<>X clash-lib Term Literalj(C) 2019,2021, QBayLogic B.VBSD2 (see the file LICENSE)$QBayLogic B.V None&/02356789;<Yk Safe-Inferred&/02356789;<Z(C) 2020-2021, QBayLogic B.V.BSD2 (see the file LICENSE)$QBayLogic B.V. [9 9 6?(C) 2017, Google Inc. 2023, QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789;<^ clash-libDetermine whether given $ is NOINLINE or more strict (OPAQUE) clash-libDetermine whether given  is OPAQUE. If this function is used on a GHC that does not support OPAQUE yet (<9.4), it will return  if given  is NOINLINE instead.l(C) 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij None&/02356789;<_2(C) 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij None &/02356789:;<>_(C) 2012-2016, University of Twente, 2017-2018, Google Inc. 2021, QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None%&'(/02356789:;<b  clash-lib Type variable clash-lib Term variable clash-libVariables in CoreHW clash-libConstructor for type variables clash-libConstructor for term variables clash-lib6Invariant: forall x . varUniq x ~ nameUniq (varName x) clash-libChange the name of a variable clash-libMake a type variable clash-libMake a term variable(C) 2012-2016, University of Twente, 2017, Google Inc., 2021, QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789:;<>f  clash-libDataCon reference clash-lib:Syntactical position of the DataCon in the type definition clash-libData Constructor clash-libName of the DataCon clash-lib4Invariant: forall x . dcUniq x ~ nameUniq (dcName x) clash-lib+Syntactical position in the type definition clash-libType of the 'DataCon clash-libUniversally quantified type-variables, these type variables are also part of the result type of the DataCon clash-libExistentially quantified type-variables, these type variables are not part of the result of the DataCon, but only of the arguments. clash-libArgument types clash-libArgument strictness clash-libNames of fields. Used when data constructor is referring to a record type.(C) 2012-2016, University of Twente 2021-2024, QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789:;<>k clash-libTyCon reference clash-libType Constructor clash-lib The RHS of an Algebraic Datatype clash-libThe DataCons of a TyCon clash-libThe newtype DataCon clash-libThe argument type of the newtype DataCon in eta-reduced form, which is just the representation of the TyCon. The TyName's are the type-variables from the corresponding TyCon. clash-libAlgorithmic DataCons clash-lib$Function TyCons (e.g. type families) clash-libPrimitive TyCons clash-libName of the TyCon clash-libKind of the TyCon clash-libNumber of type arguments clash-libDataCon definitions clash-libIs this a class dictionary? clash-libDataCon which is promoted clash-lib&List of: ([LHS match types], RHS type) clash-lib Create a Kind out of a TyConName clash-lib&Does the TyCon look like a tuple TyCon clash-lib%Get the DataCons belonging to a TyConm Safe-Inferred&/02356789;<l#(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij None &/02356789;<>s  clash-lib(A class that can generate unique numbers clash-libGet a new unique clash-libCreate a TH expression that returns the a formatted string containing the name of the module 4 is spliced into, and the line where it was spliced. clash-lib$Cache the result of a monadic action clash-lib-Cache the result of a monadic action using a  clash-lib-Cache the result of a monadic action using a  clash-libSame as  with last two arguments swapped clash-libUnsafe indexing, return a custom error message when indexing fails clash-lib*x y -> floor (logBase x y), x > 1 && y > 0 clash-lib,x y -> ceiling (logBase x y), x > 1 && y > 0 clash-lib)Get the package id of the type of a value$pkgIdFromTypeable (0 :: Unsigned 32)"clash-prelude-... clash-libLeft-biased choice on maybes clash-libTrigger warning? clash-lib File name clash-lib Line number clash-libMessage clash-libPass value (like trace) clash-lib%The key the action is associated with clash-lib)The Lens to the HashMap that is the cache clash-libThe action to cache clash-lib!Key the action is associated with clash-libLens to the cache clash-libAction to cache clash-lib!Key the action is associated with clash-libLens to the cache clash-libAction to cache clash-libError message to display clash-libIndex n clash-lib List to index clash-libError or element n clash-libError message to display clash-lib List to index clash-libIndex n clash-libError or element nn(C) 2015-2016, University of Twente 2024, QBayLogic B.V.BSD2 (see the file LICENSE)-Christiaan Baaij None &/02356789;<y clash-libSee . A line map maps "virtual" lines to a range of "real" lines. E.g., a map of {0: (0, 3), 1: (4, 5)} would mean that line 0 in the virtual JSON (i.e., the one with newlines replaced) file map to lines 0 up to and including 3 in the original user-supplied one. clash-libAeson versions <1.5.0 accept unescaped newlines in JSON strings. This is in violation of RFC 7159. Aeson 1.5.0 fixes this bug. Unfortunately, "Clash JSON" files rely on the old behavior. This function replaces newlines (in strings) with their escaped variants. clash-lib/Pretty print part of json file related to error clash-libParse a ByteString according to the given JSON template. Throws exception if it fails. clash-libParse a ByteString according to the given JSON template. Throws exception if it fails. clash-lib"Path read from (for error message) clash-libBytestring to parse clash-lib"Path read from (for error message) clash-libBytestring to parse(C) 2012-2016, University of Twente, 2016 , Myrtle Software Ltd, 2017 , Google Inc. 2021-2024, QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None" %&/02356789:;<>& clash-libReference to a Kind clash-libReference to a Type clash-libThe level above types clash-lib/Types in CoreHW: function and polymorphic types clash-libMake a Type out of a TyCon clash-libEither a Kind or a Type clash-lib Literal Types clash-libType Constants clash-lib TyCon type clash-lib Function type clash-libAn easier view on types clash-lib Function type clash-lib Applied TyCon clash-libNeither of the above clash-lib Type variable clash-lib Type constant clash-libPolymorphic Type clash-libType Application clash-lib Type literal clash-lib9Annotated type, see Clash.Annotations.SynthesisAttributes clash-libAn easier view on typesNote [Arrow arguments]Clash' Arrow type can either have 2 or 4 arguments, depending on who created it. By default it has two arguments: the argument type of a function, and the result type of a function.So when do we have 4 arguments? When in Haskell/GHC land the arrow was unsaturated. This can happen in instance heads, or in the eta-reduced representation of newtypes. So what are those additional 2 arguments compared to the "normal" function type? They're the kinds of argument and result type. clash-libA view on types in which newtypes are transparent, the Signal type is transparent, and type functions are evaluated to WHNF (when possible).Strips away ALL layers. If no layers are found it returns the given type. clash-libA view on types in which newtypes are transparent, the Signal type is transparent, and type functions are evaluated to WHNF (when possible).Only strips away one "layer". clash-lib3Make a function type of an argument and result type clash-libMake a TyCon Application out of a TyCon and a list of argument types clash-lib6Split a TyCon Application in a TyCon and its arguments clash-libIs a type polymorphic? clash-lib4Split a function type in an argument and result type clash-libSplit a poly-function type in a: list of type-binders and argument types, and the result type clash-libMake a polymorphic function type out of a result type and a list of quantifiers and function argument types clash-libSplit a poly-function type in a: list of type-binders and argument types, and the result type. Looks through Signal and type functions. clash-lib)Is a type a polymorphic or function type? clash-lib/Is a type a polymorphic or function type under ? clash-libExtract attributes from type. Will return an empty list if this is an AnnType with an empty list AND if this is not an AnnType at all. clash-libIs a type a function type? clash-libApply a function type to an argument type and get the result type clash-lib clash-lib6Normalize a type, looking through Signals and newtypes For example: %Signal a (Vec (6-1) (Unsigned (3+1))) normalizes to Vec 5 (Unsigned 4) clash-lib Result type clash-lib/List of quantifiers and function argument types00(C) 2012-2016, University of Twente, 2016 , Myrtle Software Ltd, 2021-2024, QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None &/02356789;<(C) 2012-2016, University of Twente, 2017, Google Inc. 2021-2024, QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None!&/02356789:;<>? clash-libTerm reference clash-libTerm representation in the CoreHW language: System F + LetRec + Case clash-lib A list of  CoreContext describes the complete navigation path from the top-level to a specific sub-expression. clash-libContext in which a term appears clash-lib#Function position of an application clash-libArgument position of an application. If this is an argument applied to a primitive, a tuple is defined containing (name of the primitive, #type args, #term args) clash-lib'Function position of a type application clash-lib)RHS of a Let-binder with the sibling LHS' clash-lib)Body of a Let-binding with the bound LHS' clash-lib2Body of a lambda-term with the abstracted variable clash-lib9Body of a TyLambda-term with the abstracted type-variable clash-lib;RHS of a case-alternative with the bound pattern on the LHS clash-libSubject of a case-decomposition clash-libBody of a Cast clash-libBody of a Tick clash-lib+Patterns in the LHS of a case-decomposition clash-libDatatype pattern, '[TyVar]' bind existentially-quantified type-variables of a DataCon clash-libLiteral pattern clash-libDefault pattern clash-libBinding in a LetRec construct clash-lib-Ignores its arguments, and outputs a constant clash-libNever adds any work clash-lib)Does work when the arguments are variable clash-libPerforms work regardless of whether the variables are constant or variable; these are things like clock or reset generators clash-libA more restrictive version of , where the value is the argument at the given position if all arguments for the given list of positions are also  clash-libPrimitive with multiple return values. Useful for primitives that cannot return their results as a single product type, due to limitation of synthesis tooling. It will be applied to its normal arguments, followed by the variables it should assign its results to.See: op clash-lib>Tag to indicate which instance/register name modifier was used clash-lib Clash.Magic.prefixName clash-lib Clash.Magic.suffixName clash-lib Clash.Magic.suffixNameP clash-lib Clash.Magic.setName clash-lib=Source tick, will get added by GHC by running clash with `-g` clash-libModifier for naming module instantiations and registers, are added by the user by using the functions +Clash.Magic.[prefixName,suffixName,setName] clash-libDeduplicate, i.e. try to share expressions between multiple branches. clash-libDo not deduplicate, i.e. keep, an expression inside a case-alternative; do not try to share expressions between multiple branches. clash-libVariable reference clash-libDatatype constructor clash-libLiteral clash-lib Primitive clash-libTerm-abstraction clash-libType-abstraction clash-lib Application clash-libType-application clash-libRecursive let-binding clash-libCase-expression: subject, type of alternatives, list of alternatives clash-lib$Cast a term from one type to another clash-libAnnotated term clash-lib6Get the list of term-binders out of a DataType pattern clash-lib6Abstract a term over a list of term and type variables clash-lib-Abstract a term over a list of type variables clash-lib(Abstract a term over a list of variables clash-lib)Apply a list of types and terms to a term clash-libApply a list of terms to a term clash-libApply a list of types to a term clash-lib1Is the Context a Lambda/Term-abstraction context? clash-libIs the Context a Tick context? clash-libLike + but removes all ticks from subexpressions. clash-lib>Split a (Type)Application in the applied term and it arguments clash-libSplit a (Type)Abstraction in the bound variables and the abstracted term clash-libGiven a function application, find the primitive it's applied. Yields Nothing if given term is not an application or if it is not a primitive. clash-lib1Partition ticks in source ticks and nameMod ticks clash-libVisit all terms in a term, testing it with a predicate, and returning a list of predicate yields. clash-libMake a term variable out of a variable reference or ticked variable reference clash-libFunction application clash-libIf Term= was a primitive: (name of primitive, #type args, #term args) clash-lib(source ticks, nameMod ticks)(C) 2012-2016, University of Twente, 2017 , Myrtle Software Ltd, 2021-2022, QBayLogic B.V. 2022 , LUMI GUIDE FIETSDETECTIE B.V. 2022 , Google Inc.BSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789:;<2 clash-libComponent instantiation hole. First argument indicates which function argument to instantiate. Third argument corresponds to output and input assignments, where the first element is the output assignment, and the subsequent elements are the consecutive input assignments.The LHS of the tuple is the name of the signal, while the RHS of the tuple is the type of the signal clash-libElements of a blackbox context. If you extend this list, make sure to update the following functions: 'Clash.Netlist.BlackBox.Types.prettyElem'Clash.Netlist.BlackBox.Types.renderElem&Clash.Netlist.BlackBox.Types.renderTag#Clash.Netlist.BlackBox.Types.setSym%Clash.Netlist.BlackBox.Util.inputHole-Clash.Netlist.BlackBox.Types.getUsedArguments*Clash.Netlist.BlackBox.Types.usedVariables2Clash.Netlist.BlackBox.Types.verifyBlackBoxContext(Clash.Netlist.BlackBox.Types.walkElement clash-lib*Dumps given text without processing in HDL clash-libComponent instantiation hole clash-lib Output hole; clash-lib Input hole clash-libLike Arg, but its first argument is the scoping level. For use in in generated code only. clash-lib,Like Arg, but input hole must be a constant. clash-lib*Like Arg, but input hole must be a literal clash-lib Name hole clash-libLike Arg but only insert variable reference (creating an assignment elsewhere if necessary). clash-lib Symbol hole clash-libType declaration hole clash-libType root hole clash-libError value hole clash-lib+Select element type from a vector-like type clash-libHole for the name of the component in which the blackbox is instantiated clash-libIndex data type hole, the field is the (exclusive) maximum index clash-libSize of a type hole clash-libLength of a vector-like hole clash-libDepth of a tree hole clash-lib!Max index into a vector-like type clash-lib*Hole containing a filepath for a data file clash-libCreate data file  HOLE0 with contents HOLE1 clash-libHole marking beginning (True) or end (False) of a generative construct clash-libHole indicating whether IntWordInteger are 64-Bit clash-libCompare less-or-equal clash-lib=Hole indicating which synthesis tool we're generating HDL for clash-lib*Convert to (True)/from(False) a bit-vector clash-libRecord selector of a type clash-libWhether element is scalar clash-libWhether a domain's reset lines are active high. Errors if not applied to a  KnownDomain or KnownConfiguration. clash-libTag of a domain. clash-lib/Period of a domain. Errors if not applied to a  KnownDomain or KnownConfiguration. clash-libLongest period of all known domains. The minimum duration returned is 100 ns, see  8https://github.com/clash-lang/clash-compiler/issues/2455. clash-libTest active edge of memory elements in a certain domain. Errors if not applied to a  KnownDomain or KnownConfiguration. clash-libWhether a domain's reset lines are synchronous. Errors if not applied to a  KnownDomain or KnownConfiguration. clash-libWhether the initial (or "power up") value of memory elements in a domain are configurable to a specific value rather than unknown/undefined. Errors if not applied to a  KnownDomain or KnownConfiguration. clash-libWhether given enable line is active. More specifically, whether the enable line is NOT set to a constant . clash-libWhether argument is undefined. E.g., an XException, error call, removed argument, or primitive that is undefined. This template tag will always return 0 (False) if `-fclash-aggressive-x-optimization-blackboxes` is NOT set. clash-libRepeat  hole n times clash-lib Evaluate  hole but swallow output clash-lib The "context name", name set by qr-, defaults to the name of the closest binder clash-libA BlackBox Template is a List of Elements TODO: Add name of function for better error messages clash-libA BlackBox function generates a blackbox template, given the inputs and result type of the function it should provide a blackbox for. This is useful when having a need for blackbox functions, ... TODO: docs clash-libSee s for documentation on this record's fields. (They are intentionally renamed to prevent name clashes.) clash-libWhether this primitive should be rendered when its result type is void. Defaults to . clash-lib,Render blackbox, even if result type is void clash-libDon't render blackbox result type is void. Default for all blackboxes. clash-libUse this value in your blackbox template function if you do want to accept the defaults as documented in s. clash-lib0Argument position of the function to instantiate clash-libSubposition of function: blackboxes can request multiple instances to be rendered of their given functions. This subposition indicates the nth function instance to be rendered (zero-indexed).This is a hack: the proper solution would postpone rendering the function until the very last moment. The blackbox language has no way to indicate the subposition, and every ~INST will default its subposition to zero. Haskell blackboxes can use this data type. clash-lib (name of signal, type of signal) clash-libIndicates whether caller needs a declaration. If set, the function is still free to return an expression, but the caller will convert it to a declaration. clash-libName of primitive clash-lib Arguments clash-lib Result types(C) 2012-2016, University of Twente, 2016-2017, Myrtle Software Ltd 2018 , Google Inc. 2021 , QBayLogic B.V. 2022 , Google Inc.BSD2 (see the file LICENSE)%QBayLogic B.V. None &/02356789:;<>> clash-libExternally defined primitive clash-libPrimitive template written in a Clash specific templating language clash-libPrimitive template rendered by a Haskell function (given as raw source code) clash-libA primitive that carries additional information. These are "real" primitives, hardcoded in the compiler. For example:  mapSignal in GHC2Core.coreToTerm. clash-libName of the primitive clash-lib9Whether the primitive does any work, i.e. takes chip area clash-libWhether this primitive should be rendered when its result type is void. Defaults to . clash-libWether this blackbox assigns its results to multiple variables. See op clash-lib6Whether this results in an expression or a declaration clash-libA warning to be outputted when the primitive is instantiated. This is intended to be used as a warning for primitives that are not synthesizable, but may also be used for other purposes. clash-libHow the result is assigned in HDL. This is used to determine the type of declaration used to render the result (wire/reg or signal/variable). The default usage is continuous assignment. clash-libVHDL only: add library! declarations for the given names clash-libVHDL only: add use! declarations for the given names clash-libIndicates how often a function will be instantiated in a blackbox. For example, consider the following higher-order function that creates a tree structure:%fold :: (a -> a -> a) -> Vec n a -> aIn order to generate HDL for an instance of fold we need log2(n) calls to the first argument, `a -> a -> a` (plus a few more if n is not a power of two). Note that this only targets multiple textual instances of the function. If you can generate the HDL using a for-loop and only need to call ~INST once, you don't have to worry about this option. See the blackbox for tu for an example of this.Right now, option can only be generated by BlackBoxHaskell. It cannot be used within JSON primitives. To see how to use this, see the Haskell blackbox for tv. clash-libCreate files to be included with the generated primitive. The fields are ((name, extension), content), where content is a template of the file Defaults to [] when not specified in the  .primitives file clash-lib0(Maybe) Control the generated name of the result clash-lib8(Maybe) Control the initial/power-up value of the result clash-libUsed to indiciate type of template (declaration or expression). Will be filled with Template or an Either decl expr. clash-libArguments used by blackbox. Used to remove arguments during normalization. clash-libHolds blackbox function and its hash, (Int, BlackBoxFunction), in a CompiledPrimitive. clash-libAdditional information clash-lib=Data type to indicate what arguments are in use by a BlackBox clash-libOnly these are used clash-libAll but these are used clash-lib,Template source stored in file on filesystem clash-libTemplate stored inline clash-libA BBFN is a parsed version of a fully qualified function name. It is guaranteed to have at least one module name which is not Main. clash-libA PrimMap maps primitive names to a  Primitive clash-libA compiled primitive has compiled all templates and functions from its ResolvedPrimitive counterpart. The Int in the tuple is a hash of the (uncompiled) BlackBoxFunction. clash-libA parsed primitive does not contain pointers to filesystem files anymore, but holds uncompiled BlackBoxTemplates and BlackBoxFunctions. clash-lib9An unresolved primitive still contains pointers to files.,,(C) 2012-2016, University of Twente, 2017 , Myrtle Software Ltd, 2021-2022, QBayLogic B.V. 2022 , Google Inc.BSD2 (see the file LICENSE)%QBayLogic B.V. None &/02356789;<Ʉ clash-libParse a text as a BlackBoxTemplate, returns a list of errors in case parsing fails(C) 2012-2016, University of Twente, 2016 , Myrtle Software Ltd, 2021-2022, QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None &/02356789;<>c  clash-lib'PrettyPrec printing Show-like typeclass clash-libClash's specialized Doc type holds metadata of type ClashAnnotation. clash-lib&Specific places in the program syntax. clash-lib+Annotations carried on pretty-printed code. clash-lib)marking navigation to a different context clash-lib!marking a specific sort of syntax clash-libOptions for the pretty-printer, controlling which elements to hide. clash-lib%whether to display unique identifiers clash-lib#whether to display type information clash-lib$whether to display module qualifiers clash-libwhether to display ticks clash-lib$Print a PrettyPrec thing to a StringNone &/02356789:;<>8 clash-lib-Rename environment for e.g. alpha equivalence!When going under binders for e.g.  x -> e1 aeq y -> e2 We want to rename [x -> y] or [y -> x]8, but we have to pick a binder that is neither free in e1 nor e2 or we risk accidental capture.So we must maintain: A renaming for the left termA renaming for the right termA set of in scope variables clash-lib/Set of variables that is in scope at some pointThe  is a kind of hash-value used to generate new uniques. It should never be zeroSee "Secrets of the Glasgow Haskell Compiler inliner" Section 3.2 for the motivation clash-libSet of variables clash-libMap indexed by variables clash-lib Empty map clash-lib3Environment containing a single variable-value pair clash-lib%Look up a value based on the variable clash-lib0Lookup a value based on the unique of a variable clash-lib$Lookup a value based on the variable+Errors out when the variable is not present clash-lib1Remove a variable-value pair from the environment clash-lib:Remove a list of variable-value pairs from the environment clash-libAdd a variable-value pair to the environment; overwrites the value if the variable already exists clash-libAdd a variable-value pair to the environment; if the variable already exists, the two values are merged with the given function clash-libAdd a list of variable-value pairs; the values of existing keys will be overwritten clash-libIs the environment empty clash-lib/Get the (left-biased) union of two environments clash-libGet the union of two environments, mapped values existing in both environments will be merged with the given function. clash-libFilter the first varenv to only contain keys which are not in the second varenv. clash-lib5Create an environment given a list of var-value pairs clash-lib4Apply a function to every element in the environment clash-libApply a function to every element in the environment; values for which the function returns ! are removed from the environment clash-libStrict left-fold over an environment using both the unique of the the variable and the value clash-libExtract the elements clash-lib*Does the variable exist in the environment clash-lib.Does the variable not exist in the environment clash-lib The empty set clash-libThe set of a single variable clash-libUnion two sets clash-libTake the difference of two sets clash-lib%Is the variable an element in the set clash-lib)Is the variable not an element in the set clash-lib5Is the set of variables A a subset of the variables B clash-lib"Are the sets of variables disjoint clash-libCheck whether a varset is empty clash-lib,Remove a variable from the set based on its  clash-lib%Create a set from a list of variables clash-lib The empty set clash-lib Add a list of variables in scope clash-lib$Union two sets of in scope variables clash-lib Is the set of variables in scope clash-libLook up a variable in the 7. This gives you the canonical version of the variable clash-libIs the variable in scope clash-lib8Check whether an element exists in the set based on the  contained in that element clash-libIs the variable not in scope clash-lib"Create a set of variables in scope clash-lib The empty set clash-libEnsure that the % of a variable does not occur in the  clash-lib$Create an empty renaming environment clash-libLook up the renaming of an type-variable occurrence in the left term clash-libLook up the renaming of an type-variable occurrence in the right term clash-lib1Simultaneously go under the type-variable binder bTvL and type-variable binder bTvR, finds a new binder newTvB%, and return an environment mapping [bTvL -> newB] and [bTvR -> newB] clash-libApplies  to several variables: the two variable lists must be of equal length. clash-lib6Look up the renaming of an occurrence in the left term clash-lib6Look up the renaming of an occurrence in the left term clash-lib#Simultaneously go under the binder bL and binder bR, finds a new binder newTvB$, and return an environment mapping  [bL -> newB] and  [bR -> newB] clash-libApplies  to several variables: the two variable lists must be of equal length. clash-libSet of variables A clash-libSet of variables B clash-libUnique in scope test clash-libSeed:: (C) 2013-2016, University of Twente, 2016-2017, Myrtle Software Ltd, 2017 , QBayLogic, Google Inc., 2020-2022, QBayLogic, 2022 , Google Inc.,BSD2 (see the file LICENSE)%QBayLogic B.V. None #$&/02356789:;https://peterfab.com/ref/vhdl/vhdl_renerta/source/vhd00037.htm https://peterfab.com/ref/verilog/verilog_renerta/source/vrg00018.htm clash-libForce all generated basic identifiers to lowercase. Among others, this affects module and file names. clash-libPerform a high-effort compile, trading improved performance for potentially much longer compile times.#Name inspired by Design Compiler's  compile_ultra flag. clash-libNothing!: generate undefined's in the HDL Just Nothing: replace undefined's by a constant in the HDL; the compiler decides what's best Just (Just x): replace undefined's by x in the HDL clash-lib!Check whether paths specified in  exists on the filesystem. clash-libEnable aggressive X optimization, which may remove undefineds from generated HDL by replaced with defined alternatives. clash-libEnable aggressive X optimization, which may remove undefineds from HDL generated by blackboxes. This enables the ~ISUNDEFINED template tag. clash-libAt what size do we cache normalized work-free top-level binders. clash-lib+Generate an EDAM file for use with Edalize. clash-libRender sum types with all zero-width fields as enums where supported, as opposed to rendering them as bitvectors. clash-libTimescale precision set in Verilog files. E.g., setting this would sets the second part of `timescale 100fs/100fs. clash-lib"Options related to debugging. See  clash-libCheck that the results of applied transformations do not violate the invariants for rewriting (e.g. no accidental shadowing, or type changes).+Command line flag: -fclash-debug-invariants clash-libThe information to show when debugging a transformation. See the # type for different configurations.Command line flag: -fclash-debug-info (None|FinalTerm|AppliedName|AppliedTerm|TryName|TryTerm) clash-libList the transformations that are being debugged. When the set is empty, all transformations are debugged.;Command line flag: -fclash-debug-transformations t1[,t2...] clash-libCount how many times transformations are applied and provide a summary at the end of normalization. This includes all transformations, not just those in .6Command line flag: -fclash-debug-count-transformations clash-libDebug transformations applied after the nth transformation applied. This includes all transformations, not just those in .7Command line flag: -fclash-debug-transformations-from=N clash-libDebug up to the nth applied transformation. If this limit is exceeded then Clash will error. This includes all transformations, not just those in .8Command line flag: -fclash-debug-transformations-limit=N clash-libSave information about all applied transformations to a history file for use with  clash-term./Command line flag: -fclash-debug-history[=FILE] clash-lib=Information to show about transformations during compilation.NB: The Ord, instance compares by amount of information. clash-lib*Show no information about transformations. clash-lib6Show the final term after all applied transformations. clash-lib6Show the name of every transformation that is applied. clash-libShow the name and result of every transformation that is applied. clash-libShow the name of every transformation that is attempted, and the result of every transformation that is applied. clash-libShow the name and input to every transformation that is applied, and the result of every transformation that is applied. clash-libGlobal function bindersGlobal functions cannot be mutually recursive, only self-recursive. clash-lib%The core identifier for this binding. clash-libThe source location of this binding in the original source code. clash-libthe inline specification for this binding, in the original source code. clash-libIs the binding a core term corresponding to a primitive with a known implementation? If so, it can potentially be inlined despite being marked as NOINLINE in source. clash-libThe term representation for this binding. This is polymorphic so alternate representations can be used if more appropriate (i.e. in the evaluator this can be Value for evaluated bindings). clash-lib!Whether the binding is recursive.TODO Ideally the BindingMap would store recursive and non-recursive bindings in a way similar to Let / Letrec. GHC also does this. clash-lib-The binding is the unfolding for a primitive. clash-lib$The binding is an ordinary function. clash-libCheck whether the debugging options mean the compiler is debugging. This is true only if at least one debugging feature is enabled, namely one ofchecking for invariants showing info for transformations counting applied transformations&limiting the number of transformationsOther flags, such as writing to a history file or offsetting which applied transformation to show information from do not affect the result, as it is possible to enable these but still not perform any debugging checks in functions like  applyDebug. If this is no longer the case, this function will need to be changed. clash-libCheck whether the requested information is available to the specified transformation according to the options. e.g. traceIf (hasDebugInfo AppliedName name opts) ("Trace something using: " <> show name) This accounts for the set of transformations which are being debugged. For a check which is agnostic to the a transformation, see . clash-libCheck that the transformation info shown supports the requested info. If the call-site is in the context of a particular transformation,  should be used instead. clash-libfclash-debug DebugNone clash-libfclash-debug DebugSilent clash-libfclash-debug DebugFinal clash-libfclash-debug DebugCount clash-libfclash-debug DebugName clash-libfclash-debug DebugTry clash-libfclash-debug DebugApplied clash-libfclash-debug DebugAll clash-libRender an SDC file from an SdcInfo. The clock periods, waveforms, and targets are all hardcoded.!(C) 2012-2016, University of Twente 2021, QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789;<`  clash-lib:Gives the free type-variables in a Type, implemented as a The / is closed over the types of its variables, so:  k) Int) = {a, k}  clash-libGives the "interesting" free variables in a Type, implemented as a The + is closed over the types of variables, so: foldMapOf (typeFreeVars' (const True) IntSet.empty) unitVarSet ((a:* -> k) Int) = {a, k} "Note [Closing over kind variables]Consider the type forall k . b -> kwhere b :: k -> Type)When we close over the free variables of forall k . b -> k, i.e. b , then the k in b :: k -> Type is most definitely not the k in forall k . b -> k. So when a type variable is free, i.e. not in the inScope set, its kind variables also arent; so in order to prevent collisions due to shadowing we close using an empty inScope set. See also: https://gitlab.haskell.org/ghc/ghc/-/commit/503514b94f8dc7bd9eab5392206649aee45f140b clash-lib>Check whether a set of variables does not occur free in a term clash-lib6Check whether a local identifier occurs free in a term clash-libCalculate the local free variable of an expression: the free type variables and the free identifiers that are not bound in the global environment. clash-lib7Gives the free identifiers of a Term, implemented as a  clash-libCalculate the local free identifiers of an expression: the free identifiers that are not bound in the global environment. clash-libCalculate the global free identifiers of an expression: the free identifiers that are bound in the global environment. clash-lib:Gives the free type-variables of a Term, implemented as a The + is closed over the types of variables, so: foldMapOf termFreeTyVars unitVarSet (case (x : (a:* -> k) Int)) of {}) = {a, k}  clash-libGives the "interesting" free variables in a Term, implemented as a The + is closed over the types of variables, so: foldMapOf (termFreeVars' (const True)) unitVarSet (case (x : (a:* -> k) Int)) of {}) = {x, a, k} "Note [Closing over type variables]Consider the term /\(k :: Type) -> \(b :: k) -> awhere a :: k)When we close over the free variables of /k -> (b :: k) -> (a :: k), i.e. a , then the k in a :: k is most definitely not the k in introduced by the /k ->. So when a term variable is free, i.e. not in the inScope set, its type variables also arent; so in order to prevent collisions due to shadowing we close using an empty inScope set. See also: https://gitlab.haskell.org/ghc/ghc/-/commit/503514b94f8dc7bd9eab5392206649aee45f140b clash-libGet the free variables of an expression and count the number of occurrences clash-lib3Predicate telling whether a variable is interesting clash-lib+Uniques of the variables in scope, used by  clash-lib3Predicate telling whether a variable is interesting  "(C) 2021, QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789;<> clash-libSomething is closed if it has no free variables. This function may be replaced with a more efficient implementation. clash-libCheck if a variable is free in the given value. This function may be replaced with a more efficient implementation. clash-libCheck if a variable is not free in the given value. This function may be replaced with a more efficient implementation. clash-libCheck if all variables in a set are free in the given value. This function may be replaced with a more efficient implementation. clash-libCheck if no variables in a set are free in the given value. This function may be replaced with a more efficient implementation.#(C) 2021-2024 QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None &/02356789;<  clash-libData type that indicates what kind of solution (if any) was found clash-lib1Solution was found. Variable equals some integer. clash-lib8A solution was found, but it involved negative naturals. clash-lib4Given type wasn't an equation, or it was unsolvable. clash-lib9Solve given equations and return all non-absurd solutions  clash-lib Solve simple equalities such as:a ~ 33 ~ aSomeType a b ~ SomeType 3 5SomeType 3 5 ~ SomeType a bSomeType a 5 ~ SomeType 3 b  clash-libSolve equations supported by  normalizeAdd. See documentation of TypeEqSolution to understand the return value.  clash-libGiven the left and right side of an equation, normalize it such that equations of the following forms: 5 ~ n + 2 5 ~ 2 + n n + 2 ~ 5 2 + n ~ 5are returned as (5, 2, n)  clash-libTests for nonsencical patterns due to types being "absurd". See  isAbsurdEq for more info.  clash-lib-Determines if an "equation" obtained through patEqs or typeEq is absurd. That is, it tests if two types that are definitely not equal are asserted to be equal OR if the computation of the types yield some absurd (intermediate) result such as -1.  clash-libGet constraint equations  clash-lib+If type is an equation, return LHS and RHS.  clash-libexistential tvs   (C) 2012-2016, University of Twente, 2017, Google Inc. 2021, QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None &/02356789;<6 clash-libAlpha equality for types clash-libType substitution, see Works only if the domain of the substitution is superset of the type being substituted into  clash-lib6A substitution environment containing containing both  and  substitutions.6Some invariants apply to how you use the substitution: The  contains at least those s and s that will be in scope after applying the substitution to a term. Precisely, the in-scope set must be a superset of the free variables of the substitution range that might possibly clash with locally-bound variables in the thing being substituted in..You may only apply the substitution once. See  There are various ways of setting up the in-scope set such that the first of of these invariants holds:?Arrange that the in-scope set really is all the things in scopeArrange that it's the free vars of the range of the substitutionMake it empty, if you know that all the free variables of the substitution are fresh, and hence cant possibly clash  clash-libType substitution#The following invariants must hold: The 8 is needed only to guide the generation of fresh uniques5In particular, the kind of the type variables in the  is not relevant.%The substitution is only applied onceNote [Apply Once]We might instantiate forall a b. ty with the types [a, b] or [b, a]%. So the substitution might go like [a -> b, b -> a]. A similar situation arises in terms when we find a redex like (a ->  b -> e) b a. Then we also end up with a substitution that permutes variables. Other variations happen to; for example  [a -> (a,b)].SO A TvSubst MUST BE APPLIED PRECISELY ONCE, OR THINGS MIGHT LOOP!Note [The substitution invariant]?When calling (substTy subst ty) it should be the case that the  is a superset of both:3The free variables of the range of the substitutionThe free variables of ty% minus the domain of the substitution  clash-libA substitution of s for s%Note [Extending the TvSubstEnv] See  " for the invariants that must holdThis invariant allows a short-cut when the subst env is empty: if the TvSubstEnv is empty, i.e. nullVarEnv TvSubstEnv. holds, then (substTy subst ty) does nothing.For example, consider:(a -> b(a ~ Int) -> ... b ...) IntWe substitute Int for a. The Unique of b+ does not change, but nevertheless we add b to the   because b's kind does change(This invariant has several consequences:In , we extend TvSubstEnv if the unique has changed, or if the kind has changedIn  , we do not need to consult the ; the TvSubstEnv is enoughIn  /, we can short-circuit when TvSubstEnv is empty  clash-libAn empty substitution, starting the variables currently in scope  clash-libCreate a type substitution  clash-lib/Extend the substitution environment with a new  substitution  clash-lib3Extend the substitution environment with a list of  substitutions  clash-lib:Extend the substitution environment with a list of global  substitutions  clash-lib/Extend the substitution environment with a new  substitution  clash-lib3Extend the substitution environment with a list of  substitutions  clash-libAdd an  to the in-scope set: as a side effect, remove any existing substitutions for it.  clash-libAdd  s to the in-scope set. See also   clash-libSubstitute within a None&/02356789;<9  clash-lib Derive a %w instance for given type  clash-libFor  , constructs: showsTypePrec n _ = let showSpace = showChar ' ' precCalls = [showsTypePrec 11 (Proxy @a)] interspersedPrecCalls = intersperse showSpace precCalls showType = foldl (.) (showString "Maybe") (showSpace : interspersedPrecCalls) in showParen (n > 10) showType  %(C) 2019, Myrtle Software Ltd, 2021, QBayLogic B.V. 2022, Google Inc.BSD2 (see the file LICENSE)%QBayLogic B.V. None%&/02356789;<>@  clash-lib)Tools to deal with literals encoded as a .  clash-libConvert  to the constant it represents. Will return an error if (one of the subterms) fail to translate.  clash-libPretty print the type of a term (for error messages). Its default implementation uses  to print the type. Note that this method is there to allow an instance for % to exist (and other GADTs imposing #). Without it, GHC would ask for a KnownNat constraint on the instance, which would defeat the purpose of it.  clash-libPretty print type a  clash-libUnsafe warning: If you use this instance in a monomorphic context (e.g., TermLiteral (SNat 5)), you need to make very sure that the term corresponds to the literal. If you don't, there will be a mismatch between type level variables and the proof carried in s ;. Typical usage of this instance will therefore leave the n polymorphic.  clash-libSame as  , but returns printable error message if it couldn't translate a term.  clash-libTerm to convert clash-lib indicates a failure, containing the (sub)term that failed to translate.  indicates a success.  clash-libThe operator precedence of the enclosing context (a number from 0 to 11'). Function application has precedence 10. Used to determine whether the result should be wrapped in parentheses. clash-lib6Proxy for a term whose type needs to be pretty printed  &(C) 2021, QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None &/02356789;<EQ  clash-libGet the result type of a polymorphic function given a list of arguments  clash-libLike  , but only applies a single type. If multiple types are being applied use  , as it is more efficient to only substitute once with many types.  clash-lib"(piResultTys f_ty [ty1, ..., tyn]) gives the type of (f ty1 .. tyn) where  f :: f_ty  is interesting because: f_ty* may have more foralls than there are args)Less obviously, it may have fewer forallsFore case 2. think of:,piResultTys (forall a . a) [forall b.b, Int]5This really can happen, such as situations involving s type:undefined :: forall a. a undefined (forall b. b -> b) IntThis term should have the type  (Int -> Int)<, but notice that there are more type args than foralls in s type.For efficiency reasons, when there are no foralls, we simply drop arrows from a function type/kind.  clash-lib+The complete term, used for error messages. '(C) 2012-2016, University of Twente, 2021-2024, QBayLogic B.V., 2022 , Google Inc.BSD2 (see the file LICENSE)%QBayLogic B.V. None  %&'(/02356789;<Z  clash-libHelper existential for  , contains a function that: ,given a term of a type that should be split,creates projections of that term for all the constructor arguments  clash-libRebuild a let expression / let expressions by taking the SCCs of a list of bindings and remaking Let (NonRec ...) ... and Let (Rec ...) ...  clash-lib The type  forall a . a  clash-lib The type forall a. forall b. a -> b  clash-lib$Create a vector of supplied elements  clash-lib&Append elements to the supplied vector  clash-libCreate let-bindings with case-statements that select elements out of a vector. Returns both the variables to which element-selections are bound and the let-bindings  clash-libCreate let-bindings with case-statements that select elements out of a tree. Returns both the variables to which element-selections are bound and the let-bindings  clash-lib$Create a vector of supplied elements  clash-lib*Determine whether a type is isomorphic to Clash.Signal.Internal.Signal It is i.e.: Signal clk a(Signal clk a, Signal clk b)Vec n (Signal clk a)data Wrap = W (Signal clk' Int)etc.#This also includes BiSignals, i.e.:BiSignalIn High System Intetc.  clash-lib>Determines whether given type is an (alias of en) Enable line.  clash-libDetermines whether given type is an (alias of en) Clock or Reset line  clash-libSame as dataConInstArgTys, but it tries to compute existentials too, hence the extra argument TyConMap=. WARNING: It will return the types of non-existentials only  clash-libGiven a DataCon and a list of types, the type variables of the DataCon type are substituted for the list of types. The argument types are returned.The list of types should be equal to the number of type variables, otherwise Nothing is returned.  clash-libMake a coercion  clash-libMake an unsafe coercion  clash-libTry to reduce an arbitrary type to a literal type (Symbol or Nat), and subsequently extract its String representation  clash-libDetermine whether we should split away types from a product type, i.e. clocks should always be separate arguments, and not part of a product.  clash-lib Worker of   , works on  instead of   clash-libPotentially split apart a list of function argument types. e.g. given: [Int,(Clock,(Reset,Bool)),Char] we return nt,Clock,Reset,Bool,Char]But we would leave [Int, (Bool,Int), Char] unchanged.  clash-lib&Strip implicit parameter wrappers (IP)  clash-libDo an inverse topological sorting of the let-bindings in a let-expression  clash-libGroup let-bindings into cyclic groups and acyclic individual bindings  clash-libMake a case-decomposition that extracts a field out of a (Sum-of-)Product type  clash-lib+Make a binder that should not be referenced  clash-libMake a new, unique, identifier  clash-libThe Nil constructor clash-libThe Cons (:>) constructor clash-lib Element type clash-libLength of the vector clash-libElements to put in the vector  clash-libThe Cons (:>) constructor clash-lib Element type clash-lib$The vector to append the elements to clash-libLength of the vector clash-libElements to append  clash-lib Unique supply clash-lib (Superset of) in scope variables clash-libThe Cons (:>) constructor clash-libThe element type clash-lib*Char to append to the bound variable names clash-libLength of the vector clash-lib The vector  clash-lib Unique supply clash-lib (Superset of) in scope variables clash-libThe LR constructor clash-libThe BR constructor clash-libThe element type clash-lib*Char to append to the bound variable names clash-libDepth of the tree clash-libThe tree  clash-libThe LR constructor clash-libThe BR constructor clash-lib Element type clash-libDepth of the tree clash-libElements to put in the tree  clash-libType to examine clash-lib:If we want to split values of the given type then we have Just: The (type-applied) data-constructor which, when applied to values of the types in 3., creates a value of the examined typeFunction that give a term of the type we need to split, creates projections of that term for all the types in 3.:The arguments types of the product we are trying to split.Note that we only split one level at a time (although we check all the way down), e.g. given (Int, (Clock, Bool)) we return: Just ( (,) @Int @(Clock, Bool) , \s -> [case s of (a,b) -> a, case s of (a,b) -> b] , [Int, (Clock, Bool)])4An outer loop is required to subsequently split the  (Clock, Bool) tuple.  clash-lib#Name of the caller of this function clash-lib TyCon cache clash-libSubject of the case-composition clash-lib n'th DataCon clash-lib n'th field  clash-libName of the identifier" " =(C) 2021, QBayLogic B.V., 2022, Google Inc.BSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789;<^n clash-libThe undefinedX primitive represents an X-exception throwing value that was identified during normalization. clash-libThe undefined primitive represents an undefined value that was identified during normalization. This includes undefined results to compile-time evaluation, such as division by zero.  clash-libThe removedArg primitive represents an argument which is computationally irrelevant, and has been removed from the circuit (as removing it does not change the behaviour of the circuit). Examples of such arguments are unused arguments to blackboxes, as removing them does not affect the rendered HDL.  ((C) 2020-2021, QBayLogic B.V.BSD2 (see the file LICENSE)$QBayLogic B.V. None &/02356789;<c   clash-libDetermine whether a term does any work, i.e. adds to the size of the circuit. This function requires a cache (specified as a lens) to store the result for querying work info of global binders.  clash-lib)Determine if a term represents a constant  clash-libA conservative version of  . Is used to determine in bindConstantVar to determine whether an expression can be "bound" (locally inlined). While binding workfree expressions won't result in extra work for the circuit, it might very well cause extra work for Clash. In fact, using   in bindConstantVar makes Clash two orders of magnitude slower for some of our test cases.)In effect, this function is a version of   that also considers references to clocks and resets constant. This allows us to bind HiddenClock(ResetEnable) constructs, allowing Clash to constant spec subconstants - most notably KnownDomain. Doing that enables Clash to eliminate any case-constructs on it.  )(C) 2020-2021, QBayLogic B.V., 2022 , Google Inc.BSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789;<r  clash-libGlobal term environment. These are the potentially evaluated bodies of the top level definitions which are forced on lookup.  clash-lib+The type constructors known about by Clash.  clash-libThe set of in scope variables during partial evaluation. This includes new variables introduced by the evaluator (such as the ids of binders introduced during eta expansion.)  clash-lib5The supply of fresh names for generating identifiers.  clash-libThe remaining fuel which can be spent inlining global variables. This is saved in the local environment, so when evaluation resumes from WHNF the amount of fuel used is preserved.  clash-lib?The heap containing the results of any evaluated IO primitives.  clash-lib=The address of the next element to be inserted into the heap.  clash-libCache for the results of isWorkFree. This is required to use Clash.Rewrite.WorkFree.isWorkFree.  clash-lib.The id of the term currently under evaluation.  clash-libLocal type environment. These are types that are introduced while evaluating the current term (i.e. by type applications)  clash-libLocal term environment. These are WHNF terms or unevaluated thunks introduced while evaluating the current term (i.e. by applications)  clash-libThe amount of fuel left in the local environment when the previous head was reached. This is needed so resuming evaluation does not lead to additional fuel being available.  clash-libWhen evaluating, keep data constructors for boxed data types (e.g. I#) instead of converting these back to their corresponding primitive. This is used when evaluating terms where the result is subject of a case expression (see note: lifted data types).  clash-libA term which is in beta-normal eta-long form (NF). This has no redexes, and all partially applied functions in sub-terms are eta-expanded.While not strictly necessary, NLam includes the environment at the point the original term was evaluated. This makes it easier for the AsTerm instance for Normal to reintroduce let expressions before lambdas without accidentally floating a let using a lambda bound variable outwards.  clash-libA term which has been potentially evaluated to WHNF. If evaluation has occurred, then there will be no redexes at the head of the Value, but sub-terms may still have redexes. Data constructors are only considered to be values when fully applied, if partially applied they should be eta-expanded during evaluation.Thunks are included so that lazy evaluation can be modelled without needing to store Either Term Value in the environment. This makes the presentation simpler, with the caveat that values must be forced when they are required to not be thunks.  clash-libNeutral terms cannot be reduced, as they represent things like variables which are unknown, partially applied functions, or case expressions where the subject cannot be inspected. Consider:v Stuck if "v" is a free variable p x1 ... xn Stuck if "p" is a primitive that cannot be reduced x $ y Stuck if "x" is not known to be a lambda x @ A Stuck if "x" is not known to be a type lambda case x of ... Stuck if "x" is neutral (cannot choose an alternative)Neutral terms can also be let expressions which preserve required bindings in the normal form representation. Examples of bindings that may be kept are bindings which perform work (and should not be copied) or bindings that are recursive and are still referred to by the body of the let expression.8let ... in ... Preserved bindings are needed by the body  clash-lib"An argument applied to a function  data constructor  primitive.1 1 *(C) 2020-2021, QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789;<t  clash-libConvert a term in some normal form back into a Term. This is important, as it may perform substitutions which have not yet been performed (i.e. when converting from WHNF where heads contain the environment at that point).  +(C) 2020-2021, QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789;<v  clash-libThe monad of partial evaluation. The inner monad is IO, as primitive evaluation can attempt to evaluate IO actions.  clash-libEvaluate an action in the partial evaluator, returning the result, and the final state of the global environment.  ,(C) 2020 QBayLogic B.V.BSD2 (see the file LICENSE)%QBayLogic B.V. None&/02356789;<~  clash-libAn evaluator for Clash core. This consists of two functions: one to evaluate a term to weak-head normal form (WHNF) and another to recursively evaluate sub-terms to obtain beta-normal eta-long form (NF).  clash-libEvaluate a term to WHNF, converting the result back to a Term. The global environment at the end of evaluation is also returned, callers should preserve any parts of the global environment needed for later calls.  clash-libEvaluate a term to NF, converting the result back to a Term. See   for more details.  clash-lib$The evaluator implementation to use. clash-libThe initial global environment. clash-libWhether evaluation should keep lifted data constructors. See NOTE [Lifted Constructors] in Clash.Core.PartialEval.NormalForm. clash-lib$The id of the term under evaluation. clash-libThe term under evaluation. clash-libNone &/02356789;<  clash-lib Functions  clash-libType abstractions  clash-libData constructors  clash-libLiterals  clash-libClash's number types are represented by their "fromInteger#" primitive function. So some primitives are values.  clash-libUsed by lazy primitives  clash-lib#Preserve ticks from Terms in Values  clash-lib#Preserve casts from Terms in Values  clash-libA machine represents the current state of the abstract machine used to evaluate terms. A machine has a term under evaluation, a stack, and three heaps:a primitive heap to store IO values from primitives (like ByteArrays)2a global heap to store top-level bindings in scope-a local heap to store local bindings in scopeMachines also include a unique supply and InScopeSet. These are needed when new heap bindings are created, and are just an implementation detail.  clash-libA single step in the partial evaluator. The result is the new heap and stack, and the next expression to be reduced.  clash-libAn evaluator is a collection of basic building blocks which are used to define partial evaluation. In this implementation, it consists of two types of function:?steps, which applies the reduction realtion to the current term Safe-Inferred&/02356789;<  clash-libThe Tcl Connector: a Tcl script that can parse Clash output and emit the correct commands for loading the design into Vivado (Quartus support will be added later).Apart from parsing the clash-manifest.json files produced by Clash, the Tcl Connector also supports the so-called Clash<->Tcl API. This functionality enables Clash primitives to pass complex instructions to the Tcl Connector. Current features are instantiating IP in Vivado and passing metadata along with Vivado XDC files.An example use of the Tcl Connector, demonstrating its basic features: source -notrace clashConnector.tcl # Pass it the path to "clash-manifest.json" of your top entity clash::readMetadata vhdl/Design.topEntity # Instantiate IP (no-op if no IP defined) file mkdir ip clash::createAndReadIp -dir ip # Read all VHDL/Verilog/SystemVerilog files generated by Clash clash::readHdl # Handle XDC files, in correct order clash::readXdc early # A file containing PACKAGE_PIN and IOSTANDARD definitions (but not # create_clock, clocks are part of the Clash-generated files) read_xdc Arty-A7-35-Master.xdc set_property USED_IN implementation [get_files Arty-A7-35-Master.xdc] clash::readXdc {normal late} synth_design -top $clash::topEntity -part xc7a35ticsg324-1L opt_design place_design route_design write_bitstream ${clash::topEntity}.bitClash.Xilinx.ClockGen and clash-cores:Clash.Cores.Xilinx modules make use of the IP instantiating functionality; XDC metadata functionality is not currently used as the IP is already packaged with correct constraints by Vivado.More documentation about the Tcl Connector and the Clash<->Tcl API will be made available later.In addition to this module, you can also write a copy of the Tcl script to a file by invoking cabal run clash-lib:static-files -- --tcl-connector clashConnector.tcl  0(C) 2015-2016, University of Twente, 2017 , Myrtle Software Ltd, Google Inc., 2021-2022, QBayLogic B.V. 2022 , Google Inc.BSD2 (see the file LICENSE)%QBayLogic B.V. None &/02356789;<(  clash-libInitial state for state monad  clash-lib"What HDL is the backend generating  clash-lib&Location for the primitive definitions  clash-libName of backend, used for directory to put output files in. Should be constant function / ignore argument.  clash-lib"File extension for target langauge  clash-lib!Get the set of types out of state  clash-lib$Generate HDL for a Netlist component  clash-libGenerate a HDL package containing type definitions for the given HWTypes  clash-lib-Convert a Netlist HWType to a target HDL type  clash-lib+Query what kind of type a given HDL type is  clash-libNone( &'(/02356789:;<>U{ clash-libThe usage of a signal refers to how the signal is written to in netlist. This is used to determine if the signal should be a wire or reg in (System)Verilog, or a signal or variable in VHDL.| clash-lib