#1u      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~       !"#$%&'()*+,-./01 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstu v w x y z { | } ~                                                                                                                                                    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABC D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ `abcdefghijklmnopqrstuvwxyz{|}~                                                                !!!!!!! !!!"!#"$"%"&"'"(")"*"+","-"."/"0"1"2"3"4"5"6"7"8"9":";"<"=">"?"@"A"B"C"D"E"F"G"H"I"J"K#L#M$N$O%P%Q%R%S%T%U%V%W%X%Y%Z%[%\%]%^%_%`%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%r%s%t%u%v%w%x%y%z%{%|%}%~%%%%%%%%%%%%%%%%%%%%%%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'''''''''''''''''''''''((((((())))))))))))))))))))))))**************** * * * * *++++,,,,,,,,,,,,,, ,!,",#,$,%,&,',(,),*,+,,,-,.,/,0,1,2,3,4,5,6,7#8#9#:#;-<-=->-?-@-A-B-C-D-E-F-G-H.I.J.K.L.M.N.O.P/Q/R/STUVWXYZ[\]0^0_0`0a0b0c0d0e0f0g0h0i1j1k1l1m1n1o1p1q2r2s3t3:4(C) 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>SafeU#(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>Safe%WSafe\?$ 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.$%&'(&'$%(None456M') clash-libSet of things that have a .=Invariant: they keys in the map are the uniques of the values* clash-libMap indexed by a + key/ clash-lib The empty map0 clash-lib Map with a single key-value pair1 clash-libCheck whether the map is empty2 clash-libpExtend the map with a new key-value pair. If the key already exists in the associated value will be overwritten3 clash-libExtend the map with a new key-value pair. If the key already exists in the associated value will be combined with the new value using the function provided4 clash-libtExtend the map with a list of key-value pairs. Positions with existing keys will be overwritten with the new values5 clash-libLook up a value in the map6 clash-libLike 6,, but errors out when the key is not present7 clash-lib!Check whether a key is in the map8 clash-lib@Check whether an element exists in the uniqmap based on a given .9 clash-lib%Check whether a key is not in the map: clash-lib;Derive a map where all the elements adhere to the predicate; clash-lib$Remove a key-value pair from the map< clash-lib-Remove a list of key-value pairs from the map= clash-lib!A (left-biased) union of two maps> clash-lib_A union of two maps, key-value pairs with the same key will be merged using the given function? clash-lib#Get the difference between two maps@ clash-lib*Convert a list of key-value pairs to a mapA clash-lib*Convert a map to a list of key-value pairsB clash-lib)Extract the elements of a map into a listC clash-lib,Apply a function to every element in the mapD clash-lib%Extract the keys of a map into a listE clash-libIApply a function to every element in the map. When the function returns u$, the key-value pair will be removedF clash-lib2Right-fold over a map using both the key and valueG clash-lib The empty setH clash-libSet with a single elementI clash-libAdd an element to the setJ clash-libUnion two setsK clash-lib*Check whether an element exists in the setL clash-lib2Check whether an element does not exist in the setM clash-lib8Check whether an element exists in the set based on the . contained in that elementN clash-lib6Look up an element in the set, returns it if it existsO clash-libRemove an element based on the . it containsP clash-lib%Get the elements of the set as a listQ clash-lib6Create a set out of a list of elements that contain a .R clash-lib Convert a * to a )S clash-lib"Check whether a A is a subset of BS clash-libSet A clash-libSet B+)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRS+.+,-*156/0234;<=>?CE:798FBD@AR)NGHIJOKLMSQP(C) 2018, QBayLogicBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>Safec clash-libSee:  1https://en.wikipedia.org/wiki/Topological_sortingu. This function errors if edges mention nodes not mentioned in the node list or if the given graph contains cycles.d clash-libSame as `reverse (topSort nodes edges)` if alternative representations are considered the same. That is, topSort might produce multiple answers and still deliver on its promise of yielding a topologically sorted node list. Likewise, this function promises oneO of those lists in reverse, but not necessarily the reverse of topSort itself.v clash-libEdges clash-libUnmarked nodes clash-lib Marked nodes clash-lib Sorted so far clash-lib Node to visitw clash-libEdges clash-libUnmarked nodes clash-lib Marked nodes clash-lib Sorted so far clash-lib Node to visitc clash-libNodes clash-libEdges clash-lib+Error message or topologically sorted nodesd clash-libNodes clash-libEdges clash-lib%Reversely, topologically sorted nodescdcd5Safe5xyz{|}Safe=?6efghijklmnopqrstuvwxyz{|}~6efghijklmnopqrstuvwxyz{|}~x66None~      !7(C) 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None178(C) 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None179(C) 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None 79=?@A  P(C) 2012-2016, University of Twente, 2017-2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None$&'79SX  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-lib>Interal version of Clash.Annotations.SynthesisAttributes.Attr.Needed because Clash.Annotations.SynthesisAttributes.Attr uses the Symbol kind for names, which do not have a term-level representation" clash-libVGets a _key_ in the DBMS sense: a value that uniquely identifies a Var. In case of a Var- that is its unique and (if applicable) scope clash-libChange the name of a variable clash-libMake a type variable clash-libMake a term variable9Safe#$%&'()*#(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None=?FPSX clash-lib(A class that can generate unique numbers clash-libGet a new unique clash-lib^Create 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-libIRun a State-action using the State that is stored in a higher-layer Monad clash-libFunctorial version of :; clash-libFunctorial version of :< clash-lib0Performs trace when first argument evaluates to + clash-libMonadic version of => clash-libMonadic version of =? clash-lib)if-then-else as a function on an argument clash-lib&Applicative version of 'GHC.Types.(:)' clash-libSafe indexing, returns a u if the index does not exist clash-libBUnsafe indexing, return a custom error message when indexing fails clash-libSafe version of , clash-libSafe version of -  clash-lib5Split the second list at the length of the first list  clash-lib1Return number of occurrences of an item in a list  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/Determine whether two lists are of equal length clash-lib3Determine whether two lists are not of equal length clash-libZip two lists of equal lengthINB Errors out for a 1 compiler when the two lists are not of equal length clash-libIs this a 1 compiler? clash-lib$Short-circuiting monadic version of . clash-libGet the package id of the type of a value >>> pkgIdFromTypeable (undefined :: TopEntity) "clash-prelude-0.99.3-64904d90747cb49e17166bbc86fec8678918e4ead3847193a395b258e680373c" clash-lib5Converts a curried function to a function on a triple clash-libLeft-biased choice on maybes 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+Lens to the State in the higher-layer monad clash-libThe State-action to perform  clash-libHaystack clash-lib"Times needle was found in haystack;       ;        5@#(C) 2015-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>Noneo/ clash-lib/Pretty print part of json file related to error clash-libWParse a ByteString according to the given JSON template. Throws exception if it fails. clash-lib"Path read from (for error message) clash-libBytestring to parse01/P(C) 2012-2016, University of Twente, 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None 79=?@A  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-liblUniversally 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-libJNames of fields. Used when data constructor is referring to a record type.  #$%&'!"(  #$%&'!"( #(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None79=?@A clash-libTyCon reference clash-libType Constructor1 clash-lib The RHS of an Algebraic Datatype4 clash-libThe DataCons of a TyCon5 clash-libThe newtype DataCon6 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.8 clash-libAlgorithmic DataCons9 clash-lib$Function TyCons (e.g. type families): clash-libPrimitive TyCons; clash-lib'To close the loop on the type hierarchy= clash-libName of the TyCon> clash-libKind of the TyCon? clash-libNumber of type arguments@ clash-libDataCon definitionsA clash-libIs this a class dictionary?B clash-lib&List of: ([LHS match types], RHS type)C clash-lib Create a Kind out of a TyConNameD clash-lib&Does the TyCon look like a tuple TyConE clash-lib%Get the DataCons belonging to a TyCon98:;=>?@<AB1235467CDEF98:;=>?@<AB7123546CDFEX(C) 2012-2016, University of Twente, 2016 , Myrtle Software LtdBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None2 clash-lib Builtin Name3 clash-lib Builtin Name4 clash-lib Builtin Name5 clash-lib Builtin Name6 clash-lib Builtin Kind7 clash-lib Builtin Kind8 clash-lib Builtin Kind9 clash-lib Builtin Kind: clash-lib Builtin Type; clash-lib Builtin Type< clash-lib Builtin Type= clash-lib Builtin Type> clash-lib Builtin Type? clash-lib Builtin Type@ clash-lib Builtin TypeA clash-lib Builtin TypeB clash-lib Builtin TypeC clash-lib Builtin TypeD clash-lib Builtin TypeE clash-lib Builtin TypeQRSTUVWXYZ[\]^_`QRSTUVWXYZ[\]^_`(C) 2012-2016, University of Twente, 2016 , Myrtle Software Ltd, 2017 , Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None79=?@A a clash-lib Term Literalm clash-lib Determines the Type of a Literal agjbcedfhiklm agjbcedfhiklm (C) 2012-2016, University of Twente, 2016 , Myrtle Software Ltd, 2017 , Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None $%79=?@AF>&* 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 TyConu clash-libEither a Kind or a Typev clash-lib Literal Typesy clash-libType Constantsz 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).IStrips 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".F clash-libZInstantiate and Apply the RHS/Original of a NewType with the given list of argument typesReturns Nothing when under-applied clash-lib3Make a function type of an argument and result type clash-libDMake a TyCon Application out of a TyCon and a list of argument types clash-lib6Split a TyCon Application in a TyCon and its argumentsG clash-libIs a type a Superkind? clash-libDetermine the kind of a type clash-libIs a type polymorphic? clash-lib4Split a function type in an argument and result type clash-lib^Split a poly-function type in a: list of type-binders and argument types, and the result type clash-libnSplit 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-libAApply a function type to an argument type and get the result typeH clash-libCSplit a type application in the applied type and the argument types clash-lib clash-lib The type  forall a . a 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)0uvwxyz{|~}0|~}yz{vwxu P(C) 2012-2016, University of Twente, 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None %79=?@A_n]/ clash-libTerm reference clash-libDTerm representation in the CoreHW language: System F + LetRec + Case clash-lib A list of  CoreContextY 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-libVDatatype 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-lib|Performs work regardless of whether the variables are constant or variable; these are things like clock or reset generators 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.setName clash-lib=Source tick, will get added by GHC by running clash with `-g` clash-libgModifier for naming module instantiations and registers, are added by the user by using the functions +Clash.Magic.[prefixName,suffixName,setName] 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-libECase-expression: subject, type of alternatives, list of alternatives clash-lib$Cast a term from one type to another clash-libAnnotated term clash-lib1Is the Context a Lambda/Term-abstraction context? clash-libIs the Context a Tick context? clash-lib>Split a (Type)Application in the applied term and it arguments 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-libFunction application clash-libIf Term& was a primitive: (name of primitive,  type args,  term args) clash-lib(source ticks, nameMod ticks)88W(C) 2012-2016, University of Twente, 2017 , Myrtle Software LtdBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None79* clash-libComponent instantiation hole. First argument indicates which function argument to instantiate. Second argument corresponds to output and input assignments, where the first element is the output assignment, and the subsequent elements are the consecutive input assignments.eThe LHS of the tuple is the name of the signal, while the RHS of the tuple is the type of the signal clash-libfElements 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.Types.usedArguments*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; Bool asserts escape marker stripping clash-lib Input hole; Bool asserts escape marker stripping clash-libZLike 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-lib]Like 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 type& clash-libHHole for the name of the component in which the blackbox is instantiated( clash-lib@Index data type hole, the field is the (exclusive) maximum index) clash-libSize of a type hole* clash-libLength of a vector hole+ clash-libDepth of a tree hole, clash-libMax index into a vector- clash-lib*Hole containing a filepath for a data file. clash-libCreate data file  HOLE0 with contents HOLE1/ clash-libFHole marking beginning (True) or end (False) of a generative construct2 clash-libHole indicating whether IntWordInteger are 64-Bit3 clash-libCompare less-or-equal4 clash-lib=Hole indicating which synthesis tool we're generating HDL for5 clash-lib*Convert to (True)/from(False) a bit-vector6 clash-libRecord selector of a type9 clash-lib/Whether a domain's reset lines are synchronous.: clash-libTag of a domain.; clash-libPeriod of a domain.< clash-lib7Test active edge of memory elements in a certain domain= clash-libXWhether a domain's reset lines are synchronous. Errors if not applied to a KnownDomain.? clash-libjWhether given enable line is active. More specifically, whether the enable line is NOT set to a constant +.D clash-libRepeat  hole n timesE clash-lib Evaluate  hole but swallow outputG clash-lib_A BlackBox Template is a List of Elements TODO: Add name of function for better error messagesH 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: docsI clash-libSee Clash.Primitives.Types.BlackBoxf for documentation on this record's fields. (They are intentionally renamed to prevent name clashes.)S clash-libjUse this value in your blackbox template function if you do want to accept the defaults as documented in Clash.Primitives.Types.BlackBox.H 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 typeC /1-:)*+$F4<!"#%&'(,.02356789;=>?@ABCDEGHIJLKMNOPRQSCIJLKMNOSHGPRQ /1-:)*+$F4<!"#%&'(,.02356789;=>?@ABCDE(C) 2012-2016, University of Twente, 2016-2017, Myrtle Software Ltd 2018 , Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None %45679=?_k clash-libExternally defined primitivel clash-libBPrimitive template written in a Clash specific templating languagem clash-libLPrimitive template rendered by a Haskell function (given as raw source code)n clash-libwA primitive that carries additional information. These are "real" primitives, hardcoded in the compiler. For example:  mapSignal in GHC2Core.coreToTerm.o clash-libName of the primitivep clash-lib9Whether the primitive does any work, i.e. takes chip areaq clash-lib6Whether this results in an expression or a declarationr 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.s clash-lib-Verilog only: whether the result should be a reg(True) or wire (False); when not specified in the .json" file, the value will default to False (i.e. wire).t clash-libVHDL only: add library! declarations for the given namesu clash-libVHDL only: add use! declarations for the given namesv 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 .json filew clash-libUUsed to indiciate type of template (declaration or expression). Will be filled with Template or an Either decl expr.y clash-libWHolds blackbox function and its hash, (Int, BlackBoxFunction), in a CompiledPrimitive.z clash-libAdditional information 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-libHA compiled primitive has compiled all templates and functions from its ResolvedPrimitiveS counterpart. The Int in the tuple is a hash of the (uncompiled) BlackBoxFunction. clash-lib`A 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.I clash-lib:Quick and dirty implementation of Text.splitOn for StringsJ clash-libParses a string into a list of modules and a function name. I.e., it parses the string "Clash.Primitives.Types.parseBBFN" to [Clash,  Primitives, TypesB] and "parseBBFN". The result is stored as a BlackBoxFunctionName.#PRQknlmyxovwqprstuz{|}~#~PRQ{|}knlmyxovwqprstuzW(C) 2012-2016, University of Twente, 2017 , Myrtle Software LtdBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None  clash-libParse a text as a BlackBoxTemplate, returns a list of errors in case parsing fails runParse :: Text -> (BlackBoxTemplate, [Error LineColPos]) runParse = PCC.parse ((,)  $ pBlackBoxD  */ pEnd) . createStr (LineColPos 0 0 0)K clash-lib7Parse a BlackBoxTemplate (Declarations and Expressions)L clash-libParse a single Template ElementM clash-lib!Parse the Text part of a TemplateN clash-lib)Parse a Declaration or Expression elementO clash-libParse a DeclarationP clash-lib#Parse the output tag of DeclarationQ clash-lib"Parse the input tag of DeclarationR clash-libParse an Expression elementS clash-libParse a bracketed textT clash-lib/Parse the expression part of Blackbox TemplatesU clash-libParse an Expression or TextV clash-lib Parse SigDd(C) 2015-2016, University of Twente, 2017 , Myrtle Software Ltd, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>Noneh clash-libInitial state for state monad clash-lib"What HDL is the backend generating clash-lib&Location for the primitive definitions clash-libmName 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-libHGenerate a HDL package containing type definitions for the given HWTypes clash-lib-Convert a Netlist HWType to a target HDL type clash-lib<Convert a Netlist HWType to an HDL error value for that type clash-lib9Convert a Netlist HWType to the root of a target HDL type clash-libCreate a record selector clash-libHCreate a signal declaration from an identifier (Text) and Netlist HWType clash-lib*Create a generative block statement marker clash-lib4Turn a Netlist Declaration to a HDL concurrent block clash-lib/Turn a Netlist expression into a HDL expression clash-libBit-width of Int,Word,Integer clash-libConvert to a bit-vector clash-libConvert from a bit-vector clash-lib'Synthesis tool we're generating HDL for clash-lib mkIdentifier clash-lib mkIdentifier clash-lib setModName clash-lib setSrcSpan clash-lib getSrcSpan clash-libBlock of declarations clash-libunextend/unescape identifier clash-lib+Is a type used for internal or external use clash-lib Internal use clash-lib.External use, field indicates the library name clash-lib]Replace a normal HDL template placeholder with an unescaped/unextended template placeholder.Needed when the the place-holder is filled with an escaped/extended identifier inside an escaped/extended identifier and we want to strip the escape /extension markers. Otherwise we end up with illegal identifiers. clash-libEnclose in parentheses? clash-libExpr to convert,,X(C) 2012-2016, University of Twente, 2016 , Myrtle Software LtdBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%=?_%  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-libCOptions 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-lib$Print a PrettyPrec thing to a StringNone79=?MW8 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 variablesW clash-libType renaming for the left termX clash-libTerm renaming for the left termY clash-lib Type renaming for the right termZ clash-lib Term renaming for the right term[ clash-libIn scope in left or right terms clash-lib/Set of variables that is in scope at some pointThe \O is a kind of hash-value used to generate new uniques. It should never be zeroUSee "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-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-libbAdd 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-libTAdd 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-libwGet the union of two environments, mapped values existing in both environments will be merged with the given function. clash-lib5Create an environment given a list of var-value pairs clash-lib4Apply a function to every element in the environment clash-lib]Apply a function to every element in the environment; values for which the function returns u! are removed from the environment 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-libAdd a variable to the set clash-libUnion 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-lib6Look up a variable in the set, returns it if it exists 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-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-libDLook up the renaming of an type-variable occurrence in the left term( clash-libELook 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 )G 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 -G 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-libSeed1      !"#$%&'()*+,-.1     #" !$%&-).*+,'((C) 2013-2016, University of Twente, 2016-2017, Myrtle Software Ltd, 2017 , QBayLogic, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>Nonew2 clash-libEInformation about the generated HDL between (sub)runs of the compiler4 clash-libjHash of the TopEntity and all its dependencies + (maybe) Hash of the TestBench and all its dependencies6 clash-libFThe rendered versions of the types of the input ports of the TopEntity Used when dealing with multiple  TopEntityBs who have different names for types which are structurally equal8 clash-libGThe rendered versions of the types of the output ports of the TopEntity Used when dealing with multiple  TopEntityBs who have different names for types which are structurally equal9 clash-lib.Names of all the generated components for the  TopEntity7 (does not include the names of the components of the  TestBench accompanying the  TopEntity).F clash-lib[Directory to store temporary files in. Will be cleaned after Clash has finished executing.N clash-libhPerform a high-effort compile, trading improved performance for potentially much longer compile times.#Name inspired by Design Compiler's  compile_ultra flag.O clash-libNothing!: generate undefined's in the HDL Just NothingR: 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 HDLQ clash-libDebug Message VerbosityR clash-libDon't show debug messagesS clash-libDRun invariant checks and err if violated (enabled by any debug flag)T clash-lib&Show completely normalized expressionsU clash-lib Names of applied transformationsV clash-lib/Show sub-expressions after a successful rewriteW clash-lib8Show all sub-expressions on which a rewrite is attemptedX clash-libGlobal function bindersBGlobal functions cannot be mutually recursive, only self-recursive(23987654:;PONMLKJIHGFEBA@?>=<DCQWVUTSRXY(XQWVUTSR:;PONMLKJIHGFEBA@?>=<DCY23987654(C) 2012-2016, University of Twente, 2017 , Myrtle Software Ltd, 2017-2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None&'279:;MSXgmX clash-lib}Monad that caches generated components (StateT) and remembers hidden inputs of components that are being generated (WriterT) clash-lib'Expression used in RHS of a declaration  clash-lib!Component: base unit of a Netlist! clash-libInternals of a Component" clash-libRepresentable hardware types# clash-libSignal referencee clash-lib8Context used to fill in the holes of a BlackBox templateg clash-lib,Blackbox function name (for error reporting)h clash-libResult name and typei clash-lib2Argument names, types, and whether it is a literalj clash-lib&Function arguments (subset of inputs):6( Blackbox Template , Whether the result should be reg or a wire2 (Verilog only) , Partial Blackbox Context )l clash-libAThe scoping level this context is associated with, ensures that  ~ARGN[k][n]8 holes are only filled with values from this context if k0 is equal to the scoping level of this context.m clash-lib-The component the BlackBox is instantiated inn clash-lib Bit literalo clash-libHighp clash-libLowq clash-lib Undefinedr clash-libHigh-impedances clash-libLiterals used in an expressiont clash-libNumber literalu clash-lib Bit literalv clash-libBitVector literalw clash-libBoolean literalx clash-libVector literaly clash-libString literalz clash-libLiteral expression{ clash-libDataCon application| clash-libSignal reference} clash-libLeft e: tagToEnum#, Right e : dataToTag#~ clash-lib&Instantiation of a BlackBox expression clash-libExpression Modifier clash-lib@Index the expression: (Type of expression,DataCon tag,Field Tag) clash-libJSee expression in a DataCon context: (Type of the expression, DataCon tag) clash-lib>See the expression in the context of a Vector append operation clash-lib<See the expression in the context of a Tree append operation clash-lib8Slice the identifier of the given type from start to end clash-libSignal assignment clash-libConditional signal assignment: clash-lib#Instantiation of another component: clash-lib%Instantiation of blackbox declaration clash-libSignal declaration clash-lib%HDL tick corresponding to a Core tick clash-lib Empty type.  Just Size for "empty" Vectors so we can still have primitives that can traverse e.g. Vectors of unit and know the length of that vector. clash-lib String type clash-lib"Integer type (for parameters only) clash-lib Boolean type clash-libBit type clash-libBitVector of a specified size clash-lib9Unsigned integer with specified (exclusive) upper bounder clash-lib"Signed integer of a specified size clash-lib$Unsigned integer of a specified size clash-lib Vector type clash-lib RTree type clash-lib$Sum type: Name and Constructor names clash-libdProduct type: Name, field names, and field types. Field names will be populated when using records. clash-lib=Sum-of-Product type: Name and Constructor names + field types clash-lib#Clock type corresponding to domain  Identifier clash-lib#Reset type corresponding to domain  Identifier clash-lib4Tagging type indicating a bidirectional (inout) port clash-libSame as Sum-Of-Product, but with a user specified bit representation. For more info, see: Clash.Annotations.BitRepresentations. clash-libuSame as Sum, but with a user specified bit representation. For more info, see: Clash.Annotations.BitRepresentations. clash-libAnnotated with HDL attributes clash-libDDomain name, period, active edge, reset kind, initial value behavior clash-libTree structure indicating which constructor fields were filtered from a type due to them being void. We need this information to generate stable and/or user-defined port mappings. clash-lib?Size indication of a type (e.g. bit-size or number of elements) clash-libName of the component clash-lib Input ports clash-lib Output ports clash-libInternal declarations clash-libState of the NetlistMonad clash-libGlobal binders clash-libNumber of signal declarations clash-libCached components clash-libPrimitive Definitions clash-lib#Hardcoded Type -> HWType translator clash-lib TyCon cache clash-libKeeps track of invocations of mkPrimitive. It is currently used to filter duplicate warning invocations for dubious blackbox instantiations, see GitHub pull request #286. clash-lib8The current scoping level assigned to black box contexts clash-libDPrefix for top-level components, and prefix for all other components clash-libSettings Clash was called with clash-lib>Whether we're compiling a testbench (suppresses some warnings) clash-lib3Whether the backend supports ifThenElse expressions clash-libEnvironment of the NetlistMonad clash-lib"Prefix for instance/register names clash-lib#Postfix for instance/register names clash-lib)(Maybe) user given instance/register name clash-libExtract hardware attributes from Annotated. Returns an empty list if non-Annotated given or if Annotated has an empty list of attributes. clash-libNB6: serialisation doesn't preserve the embedded function~ clash-libPrimitive name clash-libVHDL only: add library declarations clash-libVHDL only: add use declarations: clash-libIntel/Quartus only: create a .qsys file from given template. clash-libTemplate tokens clash-lib*Context in which tokens should be rendered clash-libWrap in paretheses? clash-libSignal to assign clash-libAssigned expression clash-libSignal to assign clash-libType of the result/alternatives clash-libScrutinized expression clash-libType of the scrutinee clash-libVList of: (Maybe expression scrutinized expression is compared with,RHS of alternative) clash-lib%Whether it's an entity or a component clash-lib$Comment to add to the generated code clash-lib"The component's (or entity's) name clash-libInstance label clash-libKList of parameters for this component (param name, param type, param value) clash-lib3Ports (port name, port direction, type, assignment) clash-libPrimitive name clash-libVHDL only: add library declarations clash-libVHDL only: add use declarations clash-libIntel Quartus only: create a .qsys file from given template clash-libTemplate tokens clash-lib*Context in which tokens should be rendered clash-lib1Note; will be inserted as a comment in target hdl clash-libWire or register clash-libName of signal clash-libAPointer to type of signal or type of signal ^ Signal declaration clash-lib1Note; will be inserted as a comment in target hdl clash-libName of signal clash-libType of signal clash-libmask clash-libvalueab{z|}~ !"#_`cdefghijklmnproqstuvwxy      !ab{z|}~ !"#_`cdefghijklmnproqstuvwxy      (C) 2019, Myrtle Software LtdBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None5` clash-lib%Parse integer in strings of the form GHC.Word.WordX# where  GHC.Word.Word is the prefix given.& clash-libConstructs "clean" literals.& clash-lib(Base name of constructors (for example:  GHC.Word.W) clash-libFunctions processing!"#$%&#"$!%&(C) 2019, Myrtle Software LtdBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None_' clash-libwTemplate function for Word8,Word16,.. Constructs "clean" literals. This function generates valid (System)Verilog only!a clash-libIs declaration clash-lib Arguments clash-lib Word size''(C) 2019, Myrtle Software LtdBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%_( clash-lib@Template function for Int8,Int16,.. Constructs "clean" literals.b clash-libIs declaration clash-lib Arguments clash-lib Word size((#(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%SX_11 clash-lib:Gives the free type-variables in a Type, implemented as a cThe c/ is closed over the types of its variables, so: <foldMapOf typeFreeVars unitVarSet ((a:* -> k) Int) = {a, k} 2 clash-libCGives the "interesting" free variables in a Type, implemented as a cThe c+ is closed over the types of variables, so: YfoldMapOf (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: Shttps://git.haskell.org/ghc.git/commitdiff/503514b94f8dc7bd9eab5392206649aee45f140b3 clash-lib9Check whether an identifier does not occur free in a term4 clash-lib@Check whether a set of identifiers does not occur free in a term5 clash-lib>Check whether a set of variables does not occur free in a term6 clash-lib6Check whether a local identifier occurs free in a term7 clash-lib6Check whether a local identifier occurs free in a term8 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.9 clash-lib7Gives the free identifiers of a Term, implemented as a c: clash-libCalculate the localg free identifiers of an expression: the free identifiers that are not bound in the global environment.; clash-libCalculate the globalc free identifiers of an expression: the free identifiers that are bound in the global environment.< clash-libDetermines if term has any locally free variables. That is, the free type variables and the free identifiers that are not bound in the global scope.= clash-lib:Gives the free type-variables of a Term, implemented as a cThe c+ is closed over the types of variables, so: PfoldMapOf termFreeTyVars unitVarSet (case (x : (a:* -> k) Int)) of {}) = {a, k} > clash-lib5Gives the free variables of a Term, implemented as a cThe c+ is closed over the types of variables, so: QfoldMapOf termFreeVars unitVarSet (case (x : (a:* -> k) Int)) of {}) = {x, a, k} NB9 this collects both global and local IDs, and you almost NEVER@ want to use this. Use one of the other FV calculations instead? clash-libCGives the "interesting" free variables in a Term, implemented as a cThe c+ is closed over the types of variables, so: afoldMapOf (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: Shttps://git.haskell.org/ghc.git/commitdiff/503514b94f8dc7bd9eab5392206649aee45f140b@ clash-lib4Determine whether a type has no free type variables.A clash-lib=Collect the free variables of a collection of type into a setB clash-lib>Collect the free variables of a collection of terms into a set2 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 interesting123456789:;<=>?@AB1>98:;=AB<@673452? P(C) 2012-2016, University of Twente, 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%_8% clash-libAlpha equality for types clash-libType substitution, see d\Works only if the domain of the substitution is superset of the type being substituted intoC 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 IhThere 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 scopeAArrange that it's the free vars of the range of the substitutionyMake it empty, if you know that all the free variables of the substitution are fresh, and hence cant possibly clashe clash-libA substitution of s for sNote [Extending the Subst] For a term C, which binds Es as well, we make a different choice for Ids than we do for TyVars.For TyVars see K!s Note [Extending the TvSubstEnv]'For Ids, we have a different invariant:mThe IdSubstEnv is extended only when the Unique on an Id changes. Otherwise, we just extend the InScopeSetIn consequence:6If all subst envs are empty, substsTm would be a no-opHowever, substTm still goes ahead and substitutes. Reason: we may want to replace existing Ids with new ones from the in-scope set, to avoid space leaks.In substIdBndr, we extend the e only when the unique changesfIf TvSubstEnv and IdSubstEnv are all empty, substExpr does nothing (Note that the above rule for f maintains this property.)In gg, we must look up the Id in the in-scope set, because it may contain non-trivial changes. Exmaple:(/a -> x:a. ... x ...) IntWe extend the K with a  [a |-> Int]; but x's unique does not change so we only extend the in-scope set. Then we must look up in the in-scope set when we find the occurrence of x.qThe requirement to look up the Id in the in-scope set means that we must not take no-op short cut when the eB is empty. We must still look up ever Id in the in-scope set.(However, we don't need to do so for the expression found in the IdSubstEnv, whose range is assumed to be correct wrt the in-scope set)I 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. A similar situation arises in terms when we find a redex like (a ->  b -> e) b am. Then we also end up with a substitution that permutes variables. Other variations happen to; for example  [a -> (a,b)].ASO 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 substitutionK clash-libA substitution of s for s%Note [Extending the TvSubstEnv] See I" for the invariants that must holdaThis 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 K because b's kind does change(This invariant has several consequences:In hQ, we extend TvSubstEnv if the unique has changed, or if the kind has changedIn i , we do not need to consult the ; the TvSubstEnv is enoughIn U/, we can short-circuit when TvSubstEnv is emptyL clash-lib@An empty substitution, starting the variables currently in scopeM clash-libCreate a type substitutiond clash-lib#Generates the in-scope set for the C- from the types in the incoming environment.qShould only be used the type we're substituting into has no free variables outside of the domain of substitutionN clash-lib/Extend the substitution environment with a new  substitutionO clash-lib3Extend the substitution environment with a list of  substitutionsP clash-lib:Extend the substitution environment with a list of global  substitutionsQ clash-lib/Extend the substitution environment with a new  substitutionR clash-lib3Extend the substitution environment with a list of  substitutionsS clash-libAdd an R to the in-scope set: as a side effect, remove any existing substitutions for it.T clash-libAdd  s to the in-scope set. See also SU clash-libSubstitute within a <The substitution has to satisfy the invariant described in I%s Note [The substitution environment]V clash-libSubstitute within a . See U.j clash-libLike U8, but skips the checks for the invariants described in TvSubtsN Note [The substitution environment]. Should be used inside this module only.k clash-lib=This checks if the substitution satisfies the invariant from TvSbust%s Note [The substitution invariant].l clash-lib When calling U it should be the case that the in-scope set in the substitution is a superset of the free variables of the range of the substitution. See also I$s Note [The substitution invariant].m clash-libThe work-horse of Ui clash-libKSubstitute a variable with a type if it's within the substitution's domain.6Does not substitute within the kind of free variables.h clash-libzSubstitute a type variable in a binding position, returning an extended substitution environment and a new type variable.0Substitutes within the kind of the type variableW clash-libSubstitute within a g clash-libFind the substitution for an  in the Cf clash-libSubstitute an " for another one according to the C, given, returning the result and an update C2 that should be used in subsequent substitutions.n clash-libLike h but takes a C instead of a Io clash-libZApply a substitution to an entire set of let-bindings, additionally returning an updated C1 that should be used by subsequent substitutions.X clash-libeEnsure that non of the binders in an expression shadow each-other, nor conflict with he in-scope setY clash-libA much stronger variant of X3 that ensures that all bound variables are unique.Also returns an extended K additionally containing the (renamed) unique bound variables of the term.p clash-libAlpha comparison for typesq clash-lib(Alpha comparison for types. Faster than pC as it doesn't need to calculate the free variables to create the Z clash-libAlpha equality for termsr clash-lib&Alpha equality for terms. Faster than ZC as it doesn't need to calculate the free variables to create the s clash-libAlpha comparison for typest clash-lib(Alpha comparison for types. Faster than sC as it doesn't need to calculate the free variables to create the Y clash-lib!Current set of variables in scoper clash-lib9Superset of variables in scope of the left and right termt clash-lib9Superset of variables in scope of the left and right termCDEFGHIJKLMNOPQRSTUVWXYZIJKQRUVCDEFGHLMSTNOPWXYZ#(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None$%1` clash-libAData type that indicates what kind of solution (if any) was founda clash-lib1Solution was found. Variable equals some integer.b clash-lib8A solution was found, but it involved negative naturals.c clash-lib4Given type wasn't an equation, or it was unsolvable.d clash-libKind environment/contexte clash-libType environment/contextf clash-libgGiven 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)h clash-lib9Solve given equations and return all non-absurd solutionsi clash-lib Solve simple equalities such as:a ~ 33 ~ aSomeType a b ~ SomeType 3 5SomeType 3 5 ~ SomeType a bSomeType a 5 ~ SomeType 3 bj clash-libSolve equations supported by  normalizeAdd. See documentation of TypeEqSolution to understand the return value.k clash-lib+If type is an equation, return LHS and RHS.l clash-libGet constraint equationsm clash-libDTests for unreachable alternative due to types being "absurd". See  isAbsurdEq for more info.n clash-lib-Determines if an "equation" obtained through altEqs 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.p clash-libSafely substitute type variables in a list of existentials. This function will account for cases where existentials shadow each other.q clash-libSafely substitute a type variable in a list of existentials. This function will account for cases where existentials shadow each other.r clash-libDetermine the type of a terms clash-libHSplit a (Type)Abstraction in the bound variables and the abstracted termt clash-libGGet the result type of a polymorphic function given a list of argumentsu clash-libLike v7, but errors out when a type application is not valid.Do not iterate uN, because it's inefficient to substitute one variable at a time; instead use wv clash-libLike w but for a single argument.Do not iterate vN, because it's inefficient to substitute one variable at a time; instead use ww clash-lib"(piResultTys f_ty [ty1, ..., tyn]) give sthe type of (f ty1 .. tyn) where  f :: f_tyw 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 us 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 us type.dFor efficiency reasons, when there are no foralls, we simply drop arrows from a function type/kind.x clash-lib6Get the list of term-binders out of a DataType patternz clash-lib6Abstract a term over a list of term and type variables{ clash-lib-Abstract a term over a list of term variables| clash-lib-Abstract a term over a list of type 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-lib!Does a term have a function type? clash-lib0Does a term have a function or polymorphic type? clash-libIs a term a term-abstraction? clash-lib"Is a term a recursive let-binding? clash-libIs a term a variable reference? clash-lib!Is a term a datatype constructor? clash-libIs a term a primitive? clash-lib,Make variable reference out of term variable clash-lib0Make a term variable out of a variable reference 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-libSame as dataConInstArgTysF, 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.NThe list of types should be equal to the number of type variables, otherwise Nothing is returned. clash-libMake a coercion clash-libMake an undefined term clash-lib`Try to reduce an arbitrary type to a Symbol, and subsequently extract its String representationo clash-libVariables in scope clash-lib2List of existentials to apply the substitution for clash-lib Substitutionsp clash-libVariables in scope clash-lib2List of existentials to apply the substitution for clash-lib Substitutionsq clash-libVariables in scope clash-lib2List of existentials to apply the substitution for clash-lib Substitution 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?`cbadefghijklmnopqrstuvwxyz{|}~?edf`cbaghijklmnopqrstuvwxyz{|}~(C) 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%F_) clash-libEFunction that can evaluator primitives, i.e., perform delta-reduction clash-libState of the evaluator clash-lib Functions clash-libType abstractions clash-libData constructors clash-libLiterals clash-libpClash's number types are represented by their "fromInteger#" primitive function. So some primitives are values. clash-libUsed by lazy primitives clash-lib The stack clash-lib Global heap clash-libThe heap clash-lib6Evaluate to WHNF starting with an empty Heap and Stack clash-lib1Evaluate to WHNF given an existing Heap and Stack clash-lib<Are we in a context where special primitives must be forced.&See [Note: forcing special primitives] clash-lib9Completely unwind the stack to get back the complete term clash-lib!Small-step operational semantics. clash-lib#Force the evaluation of a variable. clash-libUnwind the stack by 1 clash-lib'Update the Heap with the evaluated term clash-lib*Update the Globals with the evaluated term clash-libApply a value to a function clash-libInstantiate a type-abstraction clash-lib"Evaluation of primitive operations clash-libEvaluate a case-expression clash-lib!Allocate let-bindings on the heap clash-lib6Create a unique name and substitution for a let-binder clash-lib'Create a name that's unique in the heap clash-libName of the primitive clash-libType of the primitive clash-lib Applied types clash-libApplied values clash-libThe current value  clash-lib6The remaining terms which must be evaluated to a value55 (C) 2012-2016, University of Twente, 2016 , Myrtle Software Ltd, 2017 , Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None 79=?@AMC clash-libState of a rewriting session clash-lib!Number of applied transformations clash-libGlobal binders clash-libSupply of unique numbers clash-lib&Function which is currently normalized clash-lib Used for Fresh clash-libIUsed as a heap for compile-time evaluation of primitives that live in I/O clash-libAdditional state clash-libCState used by the inspection mechanism for recording rewrite steps. clash-libcurrent context clash-libName of the transformation clash-libName of the current binder clash-lib Term before apply clash-lib Term after apply clash-lib,Read-only environment of a rewriting session clash-lib(Lvl at which we print debugging messages clash-lib*Hardcode Type -> FilteredHWType translator clash-lib TyCon cache clash-libTuple TyCon cache clash-lib&Hardcoded evaluator (delta-reduction)} clash-lib)Functions that are considered TopEntities clash-libCustom bit representations clash-libA  action in the context of the  clash-lib=Monadic action that transforms a term given a certain context clash-libMonad that keeps track how many transformations have been applied and can generate fresh variables and unique identifiers. In addition, it keeps track if a transformation/rewrite has been successfully applied. clash-lib'Run the computation in the RewriteMonad2     2     !#(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%PXQ  clash-lib1Apply a transformation on the subtrees of an term clash-lib'Apply two transformations in succession clash-libJApply two transformations in succession, and perform a deepseq in between. clash-lib-Apply a transformation in a topdown traversal clash-lib.Apply a transformation in a bottomup traversal clash-lib?Only apply the second transformation if the first one succeeds. clash-lib<Only apply the second transformation if the first one fails.  clash-lib.Keep applying a transformation until it fails." clash-lib<Only traverse downwards when the assertion evaluates to true clash-lib+The transformation to apply to the subtrees  !"  !"6655"O(C) 2012-2016, University of Twente, 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>Nonen# clash-lib State of the 9% clash-libGlobal binders& clash-lib*Cache of previously specialized functions:NKey: (name of the original function, argument position, specialized term/type)AElem: (name of specialized function,type of specialized function)' clash-lib2Cache of how many times a function was specialized( clash-libNumber of time a function f can be specialized) clash-lib,Cache of function where inlining took place:'Key: function where inlining took place=Elem: (functions which were inlined, number of times inlined)* clash-libNumber of times a function f can be inlined in a function g+ clash-libKSize of a function below which it is always inlined if it is not recursive, clash-libASize of a constant below which it is always inlined; 0 = no limit- clash-libPrimitive Definitions. clash-lib7Cache for looking up constantness of blackbox arguments/ clash-lib8Map telling whether a components is recursively defined.NNB: there are only no mutually-recursive component, only self-recursive ones.0 clash-lib:Flattening stage should use the new (no-)inlining strategy1 clash-lib{High-effort normalization session, trading performance improvement for potentially much longer compile times. Follows the 0A flag.2 clash-libDescription of a Term' in terms of the type "components" the Term has.%Is used as a performance/size metric.4 clash-libNumber of functions5 clash-libNumber of primitives6 clash-lib!Number of selections/multiplexers7 clash-libA  Transform action in the context of the  and 98 clash-lib3RewriteSession with extra Normalisation information9 clash-lib?State monad that stores specialisation and inlining information'#$10/.,+*)('&%-23654789:;<=>?@ABCDEFHIJ'#$10/.,+*)('&%-FEDCBA@?>=<;:98723654JIH$(C) 2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>NonesN clash-libConverts a list of BitRepresentation.Bits to their Netlist counterpart.M clash-lib*Type to convert to bit representation typeMNMN%(C) 2012-2016, University of Twente, 2017 , Myrtle Software Ltd 2017-2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None $%>P`0O clash-lib\Throw away information indicating which constructor fields were filtered due to being void.Q clash-lib5Determines if type is a zero-width construct ("void")R clash-libSame as isVoid , but on FilteredHWType instead of HWTypeV clash-libSplit a normalized term into: a list of arguments, a list of let-bindings, and a variable reference that is the body of the let-binding. Returns a String containing the error if the term was not in a normalized form.W clash-libSame as unsafeCoreTypeToHWType&, but discards void filter informationX clash-libConverts a Core type to a HWType given a function that translates certain builtin types. Errors if the Core type is not translatable.Y clash-libSame as unsafeCoreTypeToHWTypeM&, but discards void filter informationZ clash-libKConverts a Core type to a HWType within the NetlistMonad; errors on failure[ clash-libSame as coreTypeToHWTypeM&, but discards void filter information\ clash-lib:Converts a Core type to a HWType within the NetlistMonad; u on failure` clash-libSame as coreTypeToHWType&, but discards void filter informationa clash-libConverts a Core type to a HWType given a function that translates certain builtin types. Returns a string containing the error message when the Core type is not translatable.b clash-libVGenerates original indices in list before filtering, given a list of removed indices.+originalIndices [False, False, True, False][0,1,3]c clash-libRConverts an algebraic Core type (split into a TyCon and its argument) to a HWType.d clash-lib/Simple check if a TyCon is recursively defined.e clash-libnDetermines if a Core type is translatable to a HWType given a function that translates certain builtin types.f clash-libDetermines the bitsize of a type. For types that don't get turned into real values in hardware (string, integer) the size is 0.g clash-lib3Determines the bitsize of the constructor of a typeh clash-lib(Gives the length of length-indexed typesi clash-lib}Gives the HWType corresponding to a term. Returns an error if the term has a Core type that is not translatable to a HWType.j clash-lib2Gives the HWType corresponding to a term. Returns uC if the term has a Core type that is not translatable to a HWType.m clash-libHelper function of collectPortNames, which operates on a PortName instead of a TopEntity.n clash-lib=Recursively get all port names from top entity annotations. The result is a list of user defined port names, which should not be used by routines generating unique function names. Only completely qualified names are returned, as it does not (and cannot) account for any implicitly named ports under a PortProduct.o clash-libFRemove ports having a void-type from user supplied PortName annotationp clash-libLUniquely rename all the variables and their references in a normalized terms clash-lib]Same as idToPort, but * Throws an error if the port is a composite type with a BiSignalInt clash-libJSame as idToPort, but: * Throws an error if port is of type BiSignalIny clash-lib\Make a set of IDs unique; also returns a substitution from old ID to new updated unique ID.{ clash-libPreserve the Netlist ,, when executing a monadic action clash-lib%Prefix given string before portnames except when this string is empty. clash-libIn addition to the original port name (where the user should assert that it's a valid identifier), we also add the version of the port name that has gone through the 'mkIdentifier Basic' process. Why? so that the provided port name is copied verbatim into the generated HDL, but that in e.g. case-insensitive HDLs, a case-variant of the port name is not used as one of the signal names. clash-lib$Create a Vector chain for a list of #s clash-lib#Create a RTree chain for a list of #s clash-libStrips one or more layers of attributes from a HWType; stops at first non-Annotated. Accumilates all attributes of nested annotations. clash-libGenerate output port mappings clash-libNGenerate output port mappings. Will yield Nothing if the only output is Void. clash-libIInstantiate a TopEntity, and add the proper type-conversions where needed clash-lib)Convert between BitVector for an argument clash-lib(Convert between BitVector for the result clash-lib&Add to/from-BitVector conversion logic clash-lib.Generate input port mappings for the TopEntity clash-lib&Consider the following type signature: O f :: Signal dom (Vec 6 A) `Annotate` Attr "keep" -> Signal dom (Vec 6 B) What does the annotation mean, considering that Clash will split these vectors into multiple in- and output ports? Should we apply the annotation to all individual ports? How would we handle pin mappings? For now, we simply throw an error. This is a helper function to do so. clash-lib8Generate output port mappings for the TopEntity. Yields Nothing if the output is Void clash-lib/Generate output port mappings for the TopEntity clash-libdTry to merge nested modifiers into a single modifier, needed by the VHDL and SystemVerilog backend. clash-libDetermines if any type variables (exts) are bound in any of the given type or term variables (tms). It's currently only used to detect bound existentials, hence the name. clash-lib`Run a NetlistMonad computation in the context of the given source ticks and name modifier ticks clash-libQAdd the pre- and suffix names in the current environment to the given identifierW clash-lib,Approximate location in original source fileX clash-lib,Approximate location in original source file[ clash-libType to convert to HWType\ clash-libType to convert to HWType` clash-libType to convert to HWTypea clash-libType to convert to HWTypeb clash-lib3Were voids. Length must be less than or equal to n. clash-libOriginal indicesc clash-lib#Hardcoded Type -> HWType translator clash-lib TyCon cache clash-lib9String representation of the Core type for error messages clash-lib The TyCon clash-libIts applied arguments clash-libSAn error string or a tuple with the type and possibly a list of removed arguments.e clash-libString considered representablej clash-libTerm to convert to HWTypep clash-libTop entity annotation where:!Nothing: term is not a top entityBJust Nothing: term is a top entity, but has no explicit annotationDJust (Just ..): term is a top entity, and has an explicit annotationq clash-libTop entity annotation where:!Nothing: term is not a top entityBJust Nothing: term is a top entity, but has no explicit annotationDJust (Just ..): term is a top entity, and has an explicit annotationr clash-libTop entity annotation where:!Nothing: term is not a top entityBJust Nothing: term is a top entity, but has no explicit annotationDJust (Just ..): term is a top entity, and has an explicit annotationy clash-libExisting substitution clash-libIDs to make unique clash-lib!(Unique IDs, update substitution) clash-libName of the TopEntity component clash-lib(maybe) a corresponding  TopEntity annotation clash-liba corresponding Manifest clash-lib=The name and type of the signal to which to assign the result clash-lib The arguments clash-libTick declarations clash-lib(maybe) Name of the _TopEntity_ clash-libEither: * A normal" argument * An argument with a PortName clash-lib(mabye) Name of the _TopEntity_ clash-libEither: * A normal result * A result with a PortName clash-lib!We only need it for certain types clash-libNothing: No _given_ TopEntity, no need for conversion, this happens when we have a _TestBench_, but no _TopEntity_ annotation.nJust Nothing: Converting to/from a BitVector for one of the internally defined types.fJust (Just top): Converting to/from a BitVector for one of the types defined by top. clash-libTrue: convert to a BitVectorFalse: convert from a BitVector clash-lib>The expression on top of which we have to add conversion logic clash-lib(maybe) Name of the _TopEntity_ clash-libRendered input port names and types clash-lib (maybe) The PortName+ of a _TopEntity_ annotation for this input clash-lib(maybe) Name of the _TopEntity_ clash-libRendered output port names and types clash-lib (maybe) The PortName, of a _TopEntity_ annotation for this output clash-lib(maybe) Name of the _TopEntity_ clash-libRendered output port names and types clash-lib (maybe) The PortName, of a _TopEntity_ annotation for this output clash-lib!The source ticks are turned into s and are passed as an argument to the NetlistMonad computation. Name modifier ticks will change the local environment for the NetlistMonad computation.IOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~IOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~&(C) 2012-2016, University of Twente, 2016 , Myrtle Software Ltd, 2017 , Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None %>SX\_Zh clash-libLift an action working in the  state to the  clash-libkSome transformations might erroneously introduce shadowing. For example, a transformation might result in:)let a = ... b = ... a = ...where the last a, shadows the first, while Clash assumes that this can't happen. This function finds those constructs and a list of found duplicates. clash-lib2Record if a transformation is successfully applied clash-lib"Perform a transformation on a Term clash-lib-Evaluate a RewriteSession to its inner monad. clash-lib7Notify that a transformation has changed the expression clash-lib^Identity function that additionally notifies that a transformation has changed the expression clash-lib3Make a new binder and variable reference for a term clash-libDMake a new binder and variable reference for either a term or a type clash-libMake a new, unique, identifier clash-lib@Inline the binders in a let-binding that have a certain property clash-libRDetermine whether a binder is a join-point created for a complex case expression.lA join-point is when a local function only occurs in tail-call positions, and when it does, more than once. clash-libGCount the number of (only) tail calls of a function in an expression. uB indicates that the function was used in a non-tail call position. clash-lib6Determines whether a function has the following shape: \(w :: Void) -> f a b c8i.e. is a wrapper around a (partially) applied function f!, where the introduced argument w is not used by f clash-libSubstitute the RHS of the first set of Let-binders for references to the first set of Let-binders in: the second set of Let-binders and the additional term clash-libLDetermine whether a term does any work, i.e. adds to the size of the circuit 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 bindConstantVarH 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. clash-libCreate a global function for a Let-binding and return a Let-binding where the RHS is a reference to the new global function applied to the free variables of the original RHS clash-libEnsure that the .% of a variable does not occur in the X clash-lib,Make a global function for a name-term tuple clash-lib+Add a function to the set of global binders clash-libCreate a new name out of the given name, but with another unique. Resulting unique is guaranteed to not be in the given InScopeSet. clash-libCreate a new name out of the given name, but with another unique. Resulting unique is guaranteed to not be in the given BindingMap. clash-lib5Determine if a term cannot be represented in hardware clash-lib5Determine if a type cannot be represented in hardware clash-lib+Make a binder that should not be referenced clash-libNMake a case-decomposition that extracts a field out of a (Sum-of-)Product type clash-lib)Specialise an application on its argument clash-lib)Specialise an application on its argument clash-lib=Create binders and variable references for free variables in specArg clash-libName of the transformation clash-libTransformation to be applied clash-libThe current debugging level clash-libName of the transformation clash-libOriginal expression clash-lib$Whether the rewrite indicated change clash-libNew expression clash-libName of the transformation clash-libTransformation to perform clash-libTerm to transform clash-lib TyCon cache clash-libName of the new binder clash-lib Term to bind clash-lib TyCon cache clash-libName of the new binder clash-libType or Term to bind clash-libName of the identifier clash-lib Property test clash-lib of the local binder clash-lib'Expression in which the binder is bound clash-libFunction to check clash-libExpression to check it in clash-libLet-binders to substitute clash-lib*Let-binders where substitution takes place clash-lib)Expression where substitution takes place clash-lib Property test clash-libTest whether to lift or inline True: inline False: lift clash-libName of the function clash-libTerm bound to the function clash-lib6Name with a proper unique and the type of the function clash-libString representable clash-libString representable clash-lib#Name of the caller of this function clash-lib TyCon cache clash-libSubject of the case-composition clash-lib"Lens into previous specialisations clash-lib$Lens into the specialisation history clash-lib"Lens into the specialisation limit clash-lib"Lens into previous specialisations clash-lib Lens into specialisation history clash-lib"Lens into the specialisation limit clash-lib Original term clash-lib@Function part of the term, split into root and applied arguments clash-libArgument to specialize on(('W(C) 2015-2016, University of Twente, 2016 , Myrtle Software LtdBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None% clash-libReplace an application of the Clash.Sized.Vector.reverse) primitive on vectors of a known length n3, by the fully unrolled recursive "definition" of Clash.Sized.Vector.reverse clash-libReplace an application of the Clash.Sized.Vector.zipWith) primitive on vectors of a known length n3, by the fully unrolled recursive "definition" of Clash.Sized.Vector.zipWith clash-libReplace an application of the Clash.Sized.Vector.map) primitive on vectors of a known length n3, by the fully unrolled recursive "definition" of Clash.Sized.Vector.map clash-libReplace an application of the Clash.Sized.Vector.imap) primitive on vectors of a known length n3, by the fully unrolled recursive "definition" of Clash.Sized.Vector.imap clash-libReplace an application of the Clash.Sized.Vector.traverse#) primitive on vectors of a known length n3, by the fully unrolled recursive "definition" of Clash.Sized.Vector.traverse# clash-libCreate the traversable vector*e.g. for a length '2' input vector, we get *(:>) <$> x0 <*> ((:>) <$> x1 <*> pure Nil) clash-libReplace an application of the Clash.Sized.Vector.foldr) primitive on vectors of a known length n3, by the fully unrolled recursive "definition" of Clash.Sized.Vector.foldr clash-libReplace an application of the Clash.Sized.Vector.fold) primitive on vectors of a known length n3, by the fully unrolled recursive "definition" of Clash.Sized.Vector.fold clash-libReplace an application of the Clash.Sized.Vector.dfold) primitive on vectors of a known length n3, by the fully unrolled recursive "definition" of Clash.Sized.Vector.dfold clash-libReplace an application of the Clash.Sized.Vector.head) primitive on vectors of a known length n4, by a projection of the first element of a vector. clash-libReplace an application of the Clash.Sized.Vector.tail) primitive on vectors of a known length n+, by a projection of the tail of a vector. clash-libReplace an application of the Clash.Sized.Vector.last) primitive on vectors of a known length n3, by a projection of the last element of a vector. clash-libReplace an application of the Clash.Sized.Vector.init) primitive on vectors of a known length n+, by a projection of the init of a vector. clash-libReplace an application of the Clash.Sized.Vector.(++)) primitive on vectors of a known length n3, by the fully unrolled recursive "definition" of Clash.Sized.Vector.(++) clash-libReplace an application of the Clash.Sized.Vector.unconcat) primitive on vectors of a known length n3, by the fully unrolled recursive "definition" of Clash.Sized.Vector.unconcat clash-libReplace an application of the Clash.Sized.Vector.transpose) primitive on vectors of a known length n3, by the fully unrolled recursive "definition" of Clash.Sized.Vector.transpose clash-libReplace an application of the Clash.Sized.Vector.dtfold) primitive on vectors of a known length n3, by the fully unrolled recursive "definition" of Clash.Sized.Vector.dtfold clash-libReplace an application of the Clash.Sized.RTree.tdfold& primitive on trees of a known depth n3, by the fully unrolled recursive "definition" of Clash.Sized.RTree.tdfold clash-libLength of the vector clash-libElement of type of the vector clash-libThe vector to reverse clash-libLength of the vector(s) clash-libType of the lhs of the function clash-libType of the rhs of the function clash-lib"Type of the result of the function clash-libThe zipWith'd functions clash-libThe 1st vector argument clash-libThe 2nd vector argument clash-libLength of the vector clash-libArgument type of the function clash-libResult type of the function clash-libThe map'd function clash-libThe map'd over vector clash-libLength of the vector clash-libArgument type of the function clash-libResult type of the function clash-libThe imap'd function clash-libThe imap'd over vector clash-libLength of the vector clash-lib#Element type of the argument vector clash-libThe type of the applicative clash-lib!Element type of the result vector clash-libThe  Applicative dictionary clash-libThe function to traverse with clash-libThe argument vector  clash-libVec tcon clash-libNil con clash-libCons con clash-lib term clash-lib term clash-libv term clash-libb ty clash-libLength of the vector clash-libElements of the vector clash-libLength of the vector clash-lib#Element type of the argument vector clash-libThe function to fold with clash-libThe starting value clash-libThe argument vector clash-libLength of the vector clash-lib#Element type of the argument vector clash-libThe function to fold with clash-libThe argument vector clash-libLength of the vector clash-lib#Element type of the argument vector clash-libFunction to fold with clash-libStarting value clash-libThe vector to fold clash-libLength of the vector clash-libElement type of the vector clash-libThe argument vector clash-libLength of the vector clash-libElement type of the vector clash-libThe argument vector clash-libLength of the vector clash-libElement type of the vector clash-libThe argument vector clash-libLength of the vector clash-libElement type of the vector clash-libThe argument vector clash-libLength of the LHS arg clash-libLenght of the RHS arg clash-libElement type of the vectors clash-libThe LHS argument clash-libThe RHS argument clash-libLength of the result vector clash-lib+Length of the elements of the result vector clash-lib Element type clash-libArgument vector clash-libLength of the result vector clash-lib+Length of the elements of the result vector clash-lib Element type clash-libArgument vector clash-libSize of vector clash-libType of vector element clash-libType of vector clash-libVector clash-libIndex clash-libElement clash-libSize of vector clash-libType of vector element clash-libVector clash-libIndex clash-libLength of the vector clash-lib#Element type of the argument vector clash-lib!Function to convert elements with clash-lib!Function to combine branches with clash-libThe vector to fold clash-libDepth of the tree clash-lib!Element type of the argument tree clash-lib!Function to convert elements with clash-lib!Function to combine branches with clash-libThe tree to fold clash-libDepth of the tree clash-lib Element type clash-lib Result type clash-libElement(#(C) 2015-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%46NP (  clash-lib Test if a w collected from an expression indicates that application of a global binder is disjoint: occur in separate branches of a case-expression.x clash-lib7Test if all elements in a list are equal to each other.y clash-libCollect ws for (potentially) disjoint applications of globals out of an expression. Also substitute truly disjoint applications of globals by a reference to a lifted out application. clash-libCollect ws for (potentially) disjoint applications of globals out of an expression. Also substitute truly disjoint applications of globals by a reference to a lifted out application.z clash-libCollect ws for (potentially) disjoint applications of globals out of a list of application arguments. Also substitute truly disjoint applications of globals by a reference to a lifted out application.{ clash-libCollect ws for (potentially) disjoint applications of globals out of a list of alternatives. Also substitute truly disjoint applications of globals by a reference to a lifted out application.| clash-libCollect ws for (potentially) disjoint applications of globals out of a list of let-bindings. Also substitute truly disjoint applications of globals by a reference to a lifted out application. clash-libGiven a case-tree corresponding to a disjoint interesting "term-in-a- function-position", return a let-expression: where the let-binding holds a case-expression selecting between the distinct arguments of the case-tree, and the body is an application of the term applied to the shared arguments of the case tree, and projections of let-binding corresponding to the distinct argument positions.} clash-lib{Create a single selector for all the representable distinct arguments by selecting between tuples. This selector is only (~j) created when the number of representable uncommmon arguments is larger than one, otherwise it is not (u).It also returns:<For all the non-representable distinct arguments: a selectorFor all the representable distinct arguments: a projection out of the tuple created by the larger selector. If this larger selector does not exist, a single selector is created for the single representable distinct argument. clash-lib,Arguments are shared between invocations if:7They contain _no_ references to locally-bound variables Are all equal clash-libaCreate a list of arguments given a map of positions to common arguments, and a list of arguments clash-libWCreate a case-expression that selects between the distinct arguments given a case-tree clash-lib_Determine if a term in a function position is interesting to lift out of of a case-expression.]This holds for all global functions, and certain primitives. Currently those primitives are:$All non-power-of-two multiplications<All division-like operations with a non-power-of-two divisor y clash-libSSubstitution of (applications of) a global binder by a reference to a lifted term. clash-lib#List of already seen global binders clash-libThe expression clash-libWhether expression is constant clash-libSSubstitution of (applications of) a global binder by a reference to a lifted term. clash-lib#List of already seen global binders clash-libThe expressionz clash-libSSubstitution of (applications of) a global binder by a reference to a lifted term. clash-lib#List of already seen global binders clash-libThe list of arguments{ clash-libSSubstitution of (applications of) a global binder by a reference to a lifted term. clash-lib#List of already seen global binders clash-libThe subject term clash-libThe list of alternatives| clash-libSSubstitution of (applications of) a global binder by a reference to a lifted term. clash-lib#List of already seen global binders clash-libThe list let-bindings clash-libSVariables in scope at the very top of the case-tree, i.e., the original expression clash-lib5Case-tree of arguments belonging to the applied term.} clash-libTypes of the arguments clash-libCurrent position clash-lib$map from position to common argument clash-lib$(projections for) distinct arguments clash-libType of the alternatives clash-lib"DataCon to pack multiple arguments clash-libTypes of the arguments clash-libCaseTree of arguments clash-libin scope clash-lib Evaluator clash-libTerm in function position clash-lib Arguments)X(C) 2012-2016, University of Twente, 2016-2017, Myrtle Software Ltd,BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None >SX_(  clash-libStrip as many VoidU layers as possible. Might still return a Void if the void doesn't contain a hwtype. clash-lib!Determine if the number of normalliteralqfunction inputs of a blackbox context at least matches the number of argument that is expected by the template. clash-libuUpdate all the symbol references in a template, and increment the symbol counter for every newly encountered symbol. clash-libXRender a blackbox given a certain context. Returns a filled out template and a list of hidden9 inputs that must be added to the encompassing component. clash-lib Render a single template element clash-libFill out the template corresponding to an output/input assignment of a component instantiation, and turn it into a single identifier so it can be used for a new blackbox context. clash-libpGive a context and a tagged hole (of a template), returns part of the context that matches the tag of the hole. clash-libkCompute string from a list of elements. Can interpret ~NAME string literals on template level (constants). clash-lib/Extracts string from SSymbol or string literals clash-libRecursively walk Element , applying f to each element in the tree. clash-libVDetermine variables used in an expression. Used for VHDL sensitivity list. Also see: 7https://github.com/clash-lang/clash-compiler/issues/365 clash-lib:Collect arguments (e.g., ~ARG, ~LIT) used in this blackbox clash-libBlackbox to verify clash-libTemplate to check against clash-libSet of existing names clash-libName for new file ( clash-lib Context used to fill in the hole clash-libBlackbox template(C) 2012-2016, University of Twente, 2017 , Myrtle Software Ltd 2018 , Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None"#$P8 clash-libQHash a compiled primitive map. It needs a separate function (as opposed to just ) as it might contain (obviously unhashable) Haskell functions. This function takes the hash value stored with the function instead. clash-lib(Replace file pointers with file contents clash-lib,Interprets contents of json file as list of  Primitive!s. Throws exception if it fails. clash-libhGenerate a set of primitives that are found in the primitive definition files in the given directories. clash-lib4Determine what argument should be constant / literal clash-libSunresolved primitives found in annotations (in LoadModules and LoadInterfaceFiles) clash-lib/Directories to search for primitive definitions*#(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None"#%_f clash-lib?A call graph counts the number of occurrences that a functions g is used in f. clash-lib>New let-bindings to be created for all the non-constants found clash-lib\A term where all the non-constant constructs are replaced by variable references (found in ) clash-libjWhether the algorithm found a constant at all. (If it didn't, it's no use creating any new let-bindings!) clash-liblDetermine if argument should reduce to a constant given a primitive and an argument number. Caches results. clash-libGiven a list of transformation contexts, determine if any of the contexts indicates that the current arg is to be reduced to a constant / literal. clash-libADetermine if a function is already inlined in the context of the  NetlistMonad clash-lib(Specialize under the Normalization Monad clash-libDetermine if a term is closed clash-libDTest whether a given term represents a non-recursive global variable clash-lib;Assert whether a name is a reference to a recursive binder. clash-lib5Indicate term is fully constant (don't bind anything) clash-libKBind given term to a new variable and indicate that it's fully non-constant clash-libnCalculate constant spec info. The goal of this function is to analyze a given term and yield a new term that:+Leaves all the constant parts as they were.BHas all _variable_ parts replaced by a newly generated identifier./The result structure will additionally contain:4Whether the function found any constant parts at all^A list of let-bindings binding the aforementioned identifiers with the term they replaced.fThis can be used in functions wanting to constant specialize over partially constant data structures. clash-lib=Create a call graph for a set of global binders, given a root clash-libFGive a "performance/size" classification of a function in normal form.  clash-lib;Determine whether a function adds a lot of hardware or not.MIt is considered expensive when it has 2 or more of the following components: functions primitivesselections (multiplexers)  clash-lib7Rewrite a term according to the provided transformation clash-libPrimitive name clash-libArgument number clash-libYields DontCare for if given primitive name is not found, if the argument does not exist, or if the argument was not mentioned by the blackbox. clash-lib!..in the current transformcontext clash-libFunction we want to inline clash-lib1Function in which we want to perform the inlining clash-libFunction we want to inline clash-lib1Function in which we want to perform the inlining clash-lib&Ticks to wrap around proposed new term clash-libOld term clash-lib2Proposed new term in case any constants were found clash-libSubterms  clash-libTransformation to apply clash-libTerm to transform clash-lib&Renew current function being rewritten        +(C) 2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%h,(C) 2012-2016, University of Twente, 2016-2017, Myrtle Software Ltd, 2017-2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None %>FP_`e% clash-lib"Specialize functions on their type clash-lib8Specialize functions on their non-representable argument clash-lib@Lift the let-bindings out of the subject of a Case-decomposition clash-lib9Remove non-reachable alternatives. For example, consider:Ndata STy ty where SInt :: Int -> STy Int SBool :: Bool -> STy Boolef :: STy ty -> ty f (SInt b) = b + 1 f (SBool True) = False f (SBool False) = True {- NOINLINE f -}g :: STy Int -> Int g = ff is always specialized on STy Int^. The SBool alternatives are therefore unreachable. Additional information can be found at: 5https://github.com/clash-lang/clash-compiler/pull/465 clash-lib|Tries to eliminate existentials by using heuristics to determine what the existential should be. For example, consider Vec:qdata Vec :: Nat -> Type -> Type where Nil :: Vec 0 a Cons x xs :: a -> Vec n a -> Vec (n + 1) aThus, / (annotated with existentials) could look like:null :: forall n . Vec n Bool -> Bool null v = case v of Nil {n ~ 0} -> True Cons {n1:Nat} {n~n1+1} (x :: a) (xs :: Vec n1 a) -> False8When it's applied to a vector of length 5, this becomes:null :: Vec 5 Bool -> Bool null v = case v of Nil {5 ~ 0} -> True Cons {n1:Nat} {5~n1+1} (x :: a) (xs :: Vec n1 a) -> FalseThis function solves n1 and replaces every occurrence with its solution. A very limited number of solutions are currently recognized: only adds (such as in the example) will be solved. clash-libVMove a Case-decomposition from the subject of a Case-decomposition to the alternatives clash-lib\Inline function with a non-representable result if it's the subject of a Case-decomposition clash-libSpecialize a Case-decomposition (replace by the RHS of an alternative) if the subject is (an application of) a DataCon; or if there is only a single alternative that doesn't reference variables bound by the pattern.Note [CaseCon deshadow]Imagine: )case D (f a b) (g x y) of D a b -> h a rewriting this to: let a = f a b in h a Uis very bad because the newly introduced let-binding now captures the free variable a in 'f a b'.instead me must rewrite to: let a1 = f a b in h a1  clash-lib>Binds variables on the PureHeap over the result of the rewriteLTo prevent unnecessary rewrites only do this when rewrite changed something. clash-liblBring an application of a DataCon or Primitive in ANF, when the argument is is considered non-representable clash-libkEnsure that top-level lambda's eventually bind a let-expression of which the body is a variable-reference. clash-libRemove unused let-bindings clash-libxInline let-bindings when the RHS is either a local variable reference or is constant (except clock or reset generators)  clash-lib/Push a cast over a case into it's alternatives.! clash-lib(Push a cast over a Letrec into it's body" clash-lib;Push cast over an argument to a function into that function@This is done by specializing on the casted argument. Example: ) y = f (cast a) where f x = g x  transforms to: 6 y = f' a where f' x' = (x -> g x) (cast x') The reason d'etre for this transformation is that we hope to end up with and expression where two casts are "back-to-back" after which we can eliminate them in $.# clash-lib&Only inline casts that just contain a G, because these are guaranteed work-free. These are the result of the % transformation.$ clash-libTEliminate two back to back casts where the type going in and coming out are the same 0 (cast :: b -> a) $ (cast :: a -> b) x ==> x % clash-libDMake a cast work-free by splitting the work of to a separate binding 9let x = cast (f a b) ==> let x = cast x' x' = f a b & clash-libUInline work-free functions, i.e. fully applied functions that evaluate to a constant' clash-libInline small functions( clash-libdSpecialise functions on arguments which are constant, except when they are clock, reset generators.) clash-lib7Propagate arguments of application inwards; except for ' where the argument becomes let-bound.Note [AppProp deshadow]Imagine: $(case x of D a b -> h a) (f x y) rewriting this to: 1let b = f x y in case x of D a b -> h a b is very bad because bT in 'h a b' is now bound by the pattern instead of the newly introduced let-bindinginstead me must rewrite to: 3let b1 = f x y in case x of D a b -> h a b1 "Note [AppProp no-shadow invariant]Imagine  (x -> e) u where u has a free variable named x, rewriting this to: let x = u in e Swould be very bad, because the let-binding suddenly captures the free variable in u. The same for: (let x = w in e) u where u again has a free variable x, rewriting this to: let x = w in (e u) Gwould be bad because the let-binding now captures the free variable in u..To prevent this from happening, we can either: 0Rename the bindings, so that they cannot capture Ensure that AppProp is only called in a context where there is no shadowing, i.e. the bindings can never never collide with the current inScopeSet.RWe have gone for option 2 so that AppProp requires less computation and because AppProp is such a commonly applied transformation. This means that when normalisation starts we deshadow the expression, and when we inline global binders, we ensure that inlined expression is deshadowed taking the InScopeSet of the context into account.* clash-libUnlike )y, which propagates a single argument in an application one level down (and should be called in an innermost traversal), * tries to propagate as many arguments as possible, down as many levels as possible; and should be called in a top-down traversal.hThe idea is that this reduces the number of traversals, which hopefully leads to shorter compile times.UImplementation only works if terms are fully deshadowed, see Note [AppProp deshadow]+ clash-lib3Flatten ridiculous case-statements generated by GHC+For case-statements in haskell of the form: Rf :: Unsigned 4 -> Unsigned 4 f x = case x of 0 -> 3 1 -> 2 2 -> 1 3 -> 0 #GHC generates Core that looks like: f = (x :: Unsigned 4) -> case x == fromInteger 3 of False -> case x == fromInteger 2 of False -> case x == fromInteger 1 of False -> case x == fromInteger 0 of False -> error "incomplete case" True -> fromInteger 3 True -> fromInteger 2 True -> fromInteger 1 True -> fromInteger 0 ]Which would result in a priority decoder circuit where a normal decoder circuit was desired.;This transformation transforms the above Core to the saner: f = (x :: Unsigned 4) -> case x of _ -> error "incomplete case" 0 -> fromInteger 3 1 -> fromInteger 2 2 -> fromInteger 1 3 -> fromInteger 0  clash-libSee Note [ANF InScopeSet], clash-liblTurn an expression into a modified ANF-form. As opposed to standard ANF, constants do not become let-bound. clash-libNote [ANF InScopeSet]The InScopeSet contains: :All the free variables of the expression we are traversing;All the bound variables of the expression we are traversingBThe newly created let-bindings as we recurse back up the traversal4All of these are needed to created let-bindings that Do not shadowAre not shadowed8Nor conflict with each other (i.e. have the same unique)JInitially we start with the local InScopeSet and add the global variables: is1  -unionInScope is0 <$ Lens.use globalInScope WWhich will gives us the (superset of) free variables of the expression. Then we call Y  let (is2,e1) = freshenTm is1 e0 =Which extends the InScopeSet with all the bound variables in e1, the version of e04 where all binders are unique (not just deshadowed).So we start out with an InScopeSet that satisfies points 1 and 2, now every time we create a new binder we must add it to the InScopeSet to satisfy point 3.- clash-lib9Eta-expand top-level lambda's (DON'T use in a traversal!). clash-libEta-expand functions with a Synthesize annotation, needed to allow such functions to appear as arguments to higher-order primitives./ clash-libTurn a normalized recursive function, where the recursive calls only pass along the unchanged original arguments, into let-recursive function. This means that all recursive calls are replaced by the same variable reference as found in the body of the top-level let-expression.0 clash-lib+Inline a function with functional arguments1 clash-libDSimplified CSE, only works on let-bindings, works from top to bottom3 clash-libReplace primitives by their "definition" if they would lead to let-bindings with a non-representable type when a function is in ANF. This happens for example when Clash.Size.Vector.map consumes or produces a vector of non-representable elements.Basically what this transformation does is replace a primitive the completely unrolled recursive definition that it represents. e.g. 8zipWith ($) (xs :: Vec 2 (Int -> Int)) (ys :: Vec 2 Int)is replaced by: let (x0 :: (Int -> Int)) = case xs of (:>) _ x xr -> x (xr0 :: Vec 1 (Int -> Int)) = case xs of (:>) _ x xr -> xr (x1 :: (Int -> Int)( = case xr0 of (:>) _ x xr -> x (y0 :: Int) = case ys of (:>) _ y yr -> y (yr0 :: Vec 1 Int) = case ys of (:>) _ y yr -> xr (y1 :: Int = case yr0 of (:>) _ y yr -> y in (($) x0 y0 :> ($) x1 y1 :> Nil)3Currently, it only handles the following functions:Clash.Sized.Vector.zipWithClash.Sized.Vector.mapClash.Sized.Vector.traverse#Clash.Sized.Vector.foldClash.Sized.Vector.foldrClash.Sized.Vector.dfoldClash.Sized.Vector.(++)Clash.Sized.Vector.headClash.Sized.Vector.tailClash.Sized.Vector.lastClash.Sized.Vector.initClash.Sized.Vector.unconcatClash.Sized.Vector.transposeClash.Sized.Vector.replicateClash.Sized.Vector.replace_intClash.Sized.Vector.imapClash.Sized.Vector.dtfoldClash.Sized.RTree.tdfoldClash.Sized.RTree.treplicate%Clash.Sized.Internal.BitVector.split#"Clash.Sized.Internal.BitVector.eq#4 clash-libaThis transformation lifts applications of global binders out of alternatives of case-statements.e.g. It converts: /case x of A -> f 3 y B -> f x x C -> h x into: let f_arg0 = case x of {A -> 3; B -> x} f_arg1 = case x of {A -> y; B -> x} f_out = f f_arg0 f_arg1 in case x of A -> f_out B -> f_out C -> h x 5 clash-libTGiven a function in the desired normal form, inline all the following let-bindings:Let-bindings with an internal name that is only used once, where it binds: * a primitive that will be translated to an HDL expression (as opposed to a HDL declaration) * a projection case-expression (1 alternative) * a data constructor6 clash-libFlatten's letrecs after 550 sometimes exposes additional possibilities for {, which then introduces let-bindings in what should be ANF. This transformation flattens those nested let-bindings again.1NB: must only be called in the cleaning up phase.% !"#$%&'()*+,-./0123456%)-(,/&0'123+456%# !$".*##(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None L clash-libNormalisation transformation7 clash-lib+Topdown traversal, stops upon first successKL789:LK789:-(C) 2012-2016, University of Twente, 2016 , Myrtle Software Ltd, 2017 , Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%P2X> clash-lib-Run a NormalizeSession in a given environmentA clash-libiCheck whether the normalized bindings are non-recursive. Errors when one of the components is recursive.B clash-lib`Perform general "clean up" of the normalized (non-recursive) function hierarchy. This includes:6Inlining functions that simply "wrap" another function>  clash-lib Level of debug messages to print clash-lib UniqueSupply clash-libGlobal Binders clash-lib#Hardcoded Type -> HWType translator clash-lib TyCon cache clash-libTuple TyCon cache clash-lib%Hardcoded evaluator (delta-reduction) clash-libPrimitive Definitions  clash-lib=Map telling whether a components is part of a recursive group  clash-lib topEntities  clash-libNormalizeSession to runA clash-libList of normalized bindersC clash-libVisited clash-libGlobal binders clash-libRoot of the call graph ;=<>?@ABCDEFG >?@AB;=<CDEFG.(C) 2012-2016, University of Twente, 2016-2017, Myrtle Software Ltd, 2017 , Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None"#%P_FH clash-lib#Emits (colorized) warning to stderrI clash-lib2Generate the context for a BlackBox instantiation.K clash-lib(Determine if a term represents a literalM clash-liboExtract a compiled primitive from a guarded primitive. Emit a warning if the guard wants to, or fail entirely.O clash-libCreate an template instantiation text and a partial blackbox content for an argument term, given that the term is a function. Errors if the term is not a functionI clash-libBlackbox function name clash-lib5Identifier binding the primitive/blackbox application clash-lib/Arguments of the primitive/blackbox applicationL clash-libLHS of the original let-binderM clash-libName of primitiveN clash-lib&Put BlackBox expression in parenthesis clash-lib(Treat BlackBox expression as declaration clash-libId to assign the result to clash-libName of primitive clash-lib Arguments clash-lib Result type clash-libTick declarationsO clash-libBIdentifier binding the encompassing primitive/blackbox application clash-libThe function argument termHIJKLMNOHIJKLMNO/NonePGPQRPQR(C) 2012-2016, University of Twente, 2016-2017, Myrtle Software Ltd, 2017-2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None"#%FPH ) clash-libXGenerate a list of Declarations for a let-binder where the RHS is a function application* clash-libxGenerate a list of Declarations for a let-binder, return an empty list if the bound expression is represented by 0 bits, clash-libWGenerate a declaration that selects an alternative based on the value of the scrutinee- clash-libGGenerate an expression that projects a field out of a data-constructor.6Works for both product types, as sum-of-product types.. clash-libUGenerate an expression for a DataCon application occurring on the RHS of a let-binder/ clash-libFGenerate an expression for a term occurring on the RHS of a let-binder0 clash-lib3Generate a component for a given function (caching)S clash-libEGenerate a hierarchical netlist out of a set of global binders with  topEntity at the top.T clash-lib0Run a NetlistMonad action in a given environmentV clash-lib)Generate a component for a given functionX clash-lib0Generate a list of Declarations for a let-binder ) clash-libLHS of the let-binder clash-libName of the applied function clash-libFunction arguments clash-libTick declarations* clash-libLHS of the let-binder clash-libRHS of the let-binder- clash-lib)Projection must bind to a simple variable clash-lib<The signal to which the projection is (potentially) assigned clash-lib'The subject/scrutinee of the projection clash-libThe type of the result clash-libThe field to be projected. clash-lib#HWType of the LHS of the let-binder clash-libId to assign the result to clash-libApplied DataCon clash-libDataCon Arguments clash-lib@Returned expression and a list of generate BlackBox declarations/ clash-lib(Treat BlackBox expression as declaration clash-libId to assign the result to clash-lib!Type of the LHS of the let-binder clash-lib Term to convert to an expression clash-lib@Returned expression and a list of generate BlackBox declarations0 clash-libName of the functionS clash-libFWhether this we're compiling a testbench (suppresses certain warnings) clash-libOptions Clash was called with clash-lib,Custom bit representations for certain types clash-libGlobal binders clash-libAll the TopEntities clash-libPrimitive definitions clash-lib TyCon cache clash-lib#Hardcoded Type -> HWType translator clash-libIntWordInteger bit-width  clash-libvalid identifiers  clash-libextend valid identifiers  clash-lib3Whether the backend supports ifThenElse expressions  clash-libSeen components  clash-libHDL dir clash-libComponent name prefix clash-lib Name of the  topEntityT clash-libFWhether this we're compiling a testbench (suppresses certain warnings) clash-libOptions Clash was called with clash-lib,Custom bit representations for certain types clash-libGlobal binders clash-libTopEntity annotations clash-libPrimitive Definitions clash-lib TyCon cache clash-lib"Hardcode Type -> HWType translator clash-libIntWordInteger bit-width  clash-libvalid identifiers  clash-libextend valid identifiers  clash-lib3Whether the backend supports ifThenElse expressions  clash-libSeen components  clash-libHDL dir clash-libComponent name prefix clash-lib Action to runV clash-libName of the function clash-libCorresponding termX clash-libLHS of the let-binder clash-libRHS of the let-binder)*+,-./0STUVWXYZ[\STU0V+W*X,YZ[)\/-.0(C) 2012-2016, University of Twente, 2016-2017, Myrtle Software Ltd, 2017 , QBayLogic, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>NonePX\ ] clash-lib.Get modification data of current clash binary.^ clash-lib7Create a set of target HDL files for a set of functions_ clash-libTInterpret a specific function from a specific module. This action tries two things: Interpret without explicitly loading the module. This will succeed if the module was already loaded through a package database (set using interpreterArgs).`If (1) fails, it does try to load it explicitly. If this also fails, an error is returned.` clash-lib:Compiles blackbox functions and parses blackbox templates.b clash-lib(Pretty print Components to HDL Documentsc clash-libPrepares the directory for writing HDL files. This means creating the dir if it does not exist and removing all existing .hdl files from it.d clash-lib(Writes a HDL file to the given directorye clash-libCopy given filesg clash-lib/Get all the terms corresponding to a call graphh clash-libNormalize a complete hierarchy^ clash-libSet of functions clash-lib Primitive / BlackBox Definitions clash-lib TyCon cache clash-libTuple TyCon cache clash-lib Hardcoded  -> HWType translator clash-lib%Hardcoded evaluator (delta-reduction) clash-libHtopEntity bndr + (maybe) TopEntity annotation + (maybe) testBench bndr  clash-lib5Debug information level for the normalization process_ clash-lib(Extra search path (usually passed as -i) clash-libInterpreter args clash-libVThe folder in which the GHC bootstrap libraries (base, containers, etc.) can be found clash-libModule function lives in clash-lib Function name clash-lib Type name (BlackBoxFunction or TemplateFunction)` clash-libImport directories (-i flag) clash-libPackage databases clash-libVThe folder in which the GHC bootstrap libraries (base, containers, etc.) can be found clash-libPrimitive to compileb clash-libBackend clash-libModule hierarchy root clash-libComponent names clash-libList of components clash-lib Top component clash-lib^Name of the manifest file + Either: * Left manifest: Only write/update the hashes of the manifest/ * Right manifest: Update all fields of the manifest clash-libeThe pretty-printed HDL documents + The update manifest file + The data files that need to be copiedc clash-libRemove existing HDL files clash-lib File extension of the HDL files.e clash-libDirectory to copy files to clash-lib(filename, content)g clash-lib All bindings clash-libRoot of the call graphh  clash-lib All bindings clash-libBlackBox HDL templates clash-lib TyCon cache clash-libTuple TyCon cache clash-lib Hardcoded  -> HWType translator clash-lib%Hardcoded evaluator (delta-reduction) clash-lib TopEntities clash-lib5Debug information level for the normalization process  clash-lib Unique supply  clash-libroot of the hierarchy ]^_`abcdefgh ]^_`abcdefgh1P(C) 2015-2016, University of Twente, 2017-2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None %NPSX_`9i clash-libState for the  monad: clash-lib!Depth of current generative block clash-lib(Files to be copied: (filename, old path) clash-lib]Files to be stored: (filename, contents). These files are generated during the execution of  genNetlist. clash-libIntWordInteger bit-width clash-lib%Generate VHDL for a Netlist component clash-lib6Convert a Netlist HWType to the root of a Verilog type clash-lib@Convert a Netlist HWType to an error Verilog value for that type clash-lib+Add attribute notation to given declaration clash-lib*Convert single attribute to verilog syntax clash-lib:Helper function for inst_, handling CustomSP and CustomSum clash-lib8Turn a Netlist Declaration to a Verilog concurrent block clash-libyCalculate the beginning and end index into a variable, to get the desired field. Also returns the HWType of the result. clash-lib3Turn a Netlist expression into a Verilog expression clash-lib/Offset, only used when we have nested modifiers clash-libEnclose in parentheses? clash-libExpr to convertijklmnoijkolmn2P(C) 2015-2016, University of Twente, 2017-2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%HNPVX_`q clash-libState for the BC monad: clash-libPreviously encountered HWTypes clash-libGenerated product types clash-libmCache for type names. Bool indicates whether this name includes length information in its first "part". See ` for more information. clash-lib(Files to be copied: (filename, old path) clash-lib]Files to be stored: (filename, contents). These files are generated during the execution of  genNetlist. clash-libIntWordInteger bit-width clash-lib3For which HDL synthesis tool are we generating VHDL clash-libTime units: are added to 3 as simulators trip over signals named after them. clash-lib<Generate unique (partial) names for product fields. Example:5productFieldNames [Unsigned 6, Unsigned 6, Bit, Bool]0["unsigned6_0", "unsigned6_1", "bit", "boolean"] clash-lib%Generate VHDL for a Netlist component clash-libIGenerate a VHDL package containing type definitions for the given HWTypes clash-librCreate 'attrname -> type' mapping for given attributes. Will err if multiple types are assigned to the same name. clash-liboCreate a 'attrname -> (type, [(signalname, value)]). Will err if multiple types are assigned to the same name. clash-lib=Return all key/value pairs in the map in arbitrary key order. clash-lib'Convert single attribute to VHDL syntax clash-lib,Append size information to given type string clash-libSame as  qualTyName0, but instantiate generic types with their size. clash-libSame as tyName0, but instantiate generic types with their size. clash-libSame as tyName:, but return fully qualified name (name, including module) clash-lib{Generates a unique name for a given type. This action will cache its results, thus returning the same answer for the same HWType] argument. Some type names do not have specific names, but are instead basic types in VHDL. clash-lib{Generates a unique name for a given type. This action will cache its results, thus returning the same answer for the same HWType] argument. Some type names do not have specific names, but are instead basic types in VHDL. clash-liboReturns underlying type of given HWType. That is, the type by which it eventually will be represented in VHDL. clash-lib4Recursively remove transparent types from given type clash-lib0Create a unique type name for user defined types clash-lib=Convert a Netlist HWType to an error VHDL value for that type clash-lib:Helper function for inst_, handling CustomSP and CustomSum clash-lib5Turn a Netlist Declaration to a VHDL concurrent block clash-lib0Turn a Netlist expression into a VHDL expression clash-lib,Label hints. From user records, for example. clash-lib Field types clash-lib,Label hints. From user records, for example. clash-lib Field types clash-libIndex of field clash-lib,Label hints. From user records, for example. clash-lib Field types clash-libIndex of field clash-lib Type to name clash-libkInclude length information in first part of name. For example, say we want to generate a name for a vector signedG, where the vector is of length 5, and signed has 64 bits. When given + , this function would generate array_of_5_signed_64 . When given  it would generate array_of_signed_64. Note that parts other than the first part will always have length information. This option is useful for generating names in VHDL, where the ( case is needed to create generic types. clash-lib Type to name clash-lib Default name clash-libIdentifier stored in hwTy clash-libType to give a (unique) name clash-libEnclose in parentheses? clash-libExpr to convertqq3P(C) 2015-2016, University of Twente, 2017-2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None %NP_`s clash-libState for the  monad: clash-libPreviously encountered HWTypes clash-libProduct type counter clash-lib1Cache for previously generated product type names clash-lib!Depth of current generative block clash-lib(Files to be copied: (filename, old path) clash-lib]Files to be stored: (filename, contents). These files are generated during the execution of  genNetlist. clash-lib(Are we in the context of generating the _types package? clash-libIntWordInteger bit-width clash-lib.Generate SystemVerilog for a Netlist component clash-libRGenerate a SystemVerilog package containing type definitions for the given HWTypes clash-lib6Convert a Netlist HWType to the root of a Verilog type clash-libFConvert a Netlist HWType to an error SystemVerilog value for that type clash-lib0Convert single attribute to systemverilog syntax clash-lib+Add attribute notation to given declaration clash-lib:Helper function for inst_, handling CustomSP and CustomSum clash-lib>Turn a Netlist Declaration to a SystemVerilog concurrent block clash-lib9Turn a Netlist expression into a SystemVerilog expression clash-libEnclose in parentheses? clash-libExpr to convertssD:;DEFDEGDEHDIJDKLDKMD:ND:OD:<DPQDRSTUVTUWXYZ[\][^_[^`[^a[^b[^c[^d[^e[^efghijklmnopqrstuvwxyz{|}~                                        ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 67899:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd@efghijklmnopqrstuvwxy z { | } ~                                                                                                                           W             ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O PQRSTUUVWnXYZ[\ ]^_`abcdefghijklmnoQpqrstuvwxyz{|}~l|       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcddefghijkklmnopqrstuvwxyz{|}A~hqenk      !"#$%&'()*+,j-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a b b c d e f g g h i j k l m n o p q r s t u v w x y z { |}~\                               +                1   <   >       ! " # $ %!&!'!(!)!*!+!,!-!.!/"0"0"1"2"3"4"5"6"7"8""9":";"<"="=">"?"@"A"B"C"D"E"F"G"H"I"J"K"8"L"M"N"O"P""Q"R#S#T$U$V%W%X%Y%Z%[%%%\%]%^%_%`%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%r%s%t%u%v%w%x%y%z%{%|%}%~%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'''''''''''''''''''''''((((((())))))))))))))))))))))))************** * * * * ***++++,,,,,,,,,,,, ,!,",#,$,%,&,',(,),*,+,,,-,.,/,0,1,2,3,4,5,6,7,8,9#:#;#<#=->-?-@-A-B-C-D-E-F-G-H-I-J.K.L.M.N.O.P.Q.R/S/T/UVWXYZ[\]^_0`0a0b0c0d0e0f0g0h0i0j0k1l1m1n1o1p1q1r1s2t2u3v3wDxyz{|}~|}~|}|}|}|}>      !"#"#$% &9'9(9)9*9+9,9-9./01D2D2D3@4@5@6789:;<=>?@ABCDEFGHIJ K L MNOPQRSTUVWXYZ[\]^_`/0abcdefgXhi j k l m n o p q r s t u v w x y zD{|DE}(~((((((Dx((((****D3 ,,,111111111111112222222222222222222222222222222/0333333333333333333clash-lib-1.0.1-inplace Clash.UtilClash.Core.NameData.Text.Prettyprint.Doc.ExtraClash.Netlist.IdClash.Netlist.Types Clash.Pretty Clash.UniqueClash.Util.GraphClash.Core.TyConClash.Core.TypeClash.Core.TermClash.Core.VarClash.Core.SubstClash.Primitives.UtilClash.Core.DataConClash.Core.TysPrimClash.Core.LiteralClash.Netlist.BlackBox.TypesClash.Primitives.TypesClash.Netlist.BlackBox.Parser Clash.BackendClash.Core.PrettyClash.Core.VarEnvClash.Driver.TypesClash.Primitives.GHC.LiteralClash.Primitives.GHC.WordClash.Primitives.GHC.Int Clash.NetlistClash.Core.FreeVarsClash.Core.UtilClash.Core.EvaluatorClash.Rewrite.TypesClash.Rewrite.CombinatorsClash.Normalize.TypesClash.Normalize.Strategy,Clash.Annotations.BitRepresentation.ClashLibClash.Netlist.UtilClash.Rewrite.Util#Clash.Normalize.PrimitiveReductionsClash.Normalize.DECClash.Netlist.BlackBox.UtilClash.Normalize.UtilClash.Primitives.Intel.ClockGenClash.Normalize.TransformationsClash.NormalizeClash.Netlist.BlackBoxClash.Primitives.Sized.Vector Clash.DriverClash.Backend.VerilogClash.Backend.VHDLClash.Backend.SystemVerilog!Clash.Annotations.TopEntity.ExtraData.Semigroup.Monad.ExtraData.Vector.Primitive.ExtraGHC.BasicTypes.ExtraGHC.SrcLoc.ExtraPaths_clash_lib Control.Arrowfirstsecond Data.List partition mapAccumLData.Aeson.Extra opt_ultraClash.Netlist.VHDLVHDLMbaseGHC.Base<*>pure Applicative Data.Functor<$> Control.Monad<=<>=>&&&*** Data.FunctiononGHC.Stack.Types HasCallStackghcSrcLoc noSrcSpanSrcSpanLlens-4.18.1-bc18c8d298d8bc4fe797bd4abdc44221551405c52a172de57e8e1dffed863456Control.Lens.TH makeLensesTprettyprinter-1.3.0-0b9f52e2306ff2240785b25f844892019859225462021ad75f6c92b33870ff76%Data.Text.Prettyprint.Doc.Render.Text renderLazy"Data.Text.Prettyprint.Doc.Internal layoutCompact layoutPretty UnboundedAvailablePerLine PageWidthlayoutPageWidth LayoutOptionsIdTypeBasicExtended mkBasicId'stripDollarPrefixes NetlistMonadBlackBoxExpr Component DeclarationHWType Identifier ClashPretty clashPrettyshowDocremoveAnnotations fromPrettyUniqSetUniqMap Uniquable getUnique setUniqueUnique emptyUniqMap unitUniqMap nullUniqMap extendUniqMapextendUniqMapWithextendListUniqMap lookupUniqMaplookupUniqMap' elemUniqMapelemUniqMapDirectlynotElemUniqMap filterUniqMap delUniqMapdelListUniqMap unionUniqMapunionUniqMapWithdifferenceUniqMap listToUniqMap toListUniqMap eltsUniqMap mapUniqMap keysUniqMapmapMaybeUniqMapfoldrWithUnique emptyUniqSet unitUniqSet extendUniqSet unionUniqSet elemUniqSetnotElemUniqSetelemUniqSetDirectly lookupUniqSetdelUniqSetDirectly eltsUniqSet mkUniqSetuniqMapToUniqSet subsetUniqSet$fUniquableInt $fShowUniqMap$fClashPrettyUniqMap$fClashPrettyUniqSet$fFunctorUniqMap$fFoldableUniqMap$fTraversableUniqMap$fSemigroupUniqMap$fMonoidUniqMap$fNFDataUniqMap$fBinaryUniqMap$fFoldableUniqSet$fSemigroupUniqSet$fMonoidUniqSet$fBinaryUniqSettopSortreverseTopSortDoc layoutOneLine renderOneLineintintegercharlbracerbracecolonsemiequalscommadotlparenrparenspacebracketsbracestupled<+>vcathcatnestindentparensemptyDoc punctuate encloseSeplineline'softline softline'prettystringSstringsquotesdquotesalignhsepvsepisEmptyfillcolumnnestingflatAlt $fIsStringfNameSortUserSystemInternalOccNameNamenameSortnameOccnameUniqnameLocmkUnsafeSystemNamemkUnsafeInternalName appendToName$fUniquableName$fHashableName $fOrdName$fEqName $fEqNameSort $fOrdNameSort$fShowNameSort$fGenericNameSort$fNFDataNameSort$fHashableNameSort$fBinaryNameSort $fShowName $fGenericName $fNFDataName $fBinaryName TyConNameTyConKiNameTyNameKindType mkTyConTyTmNameTermTyVarIdIdScopeGlobalIdLocalIdVarvarNamevarUniqvarTypeidScopeAttr' BoolAttr' IntegerAttr' StringAttr'attrName modifyVarNamemkTyVarmkId mkLocalId mkGlobalId setVarUnique setVarType isGlobalId isLocalId setIdScope$fUniquableVar$fOrdVar$fEqVar $fEqAttr' $fShowAttr' $fNFDataAttr'$fGenericAttr'$fHashableAttr' $fOrdAttr' $fBinaryAttr' $fShowIdScope$fGenericIdScope$fNFDataIdScope$fHashableIdScope$fBinaryIdScope $fEqIdScope $fOrdIdScope $fShowVar $fGenericVar $fNFDataVar $fHashableVar $fBinaryVaraeqType substTyWith MonadUnique getUniqueMClashException assertPanicassertPprPanicpprPanic callStackDoc warnPprTracepprTrace pprTraceDebugpprDebugAndThencurLoc makeCached makeCachedU liftStatefirstMsecondMcombineMtraceIf partitionM mapAccumLM ifThenElse<:> indexMaybe indexNote headMaybe tailMaybe splitAtListclashLibVersioncountEqflogBaseclogBase equalLengthneLengthzipEqual debugIsOnanyMpkgIdFromTypeablereportTimeDiffuncurry3allMorElseorElses$fExceptionClashException$fShowClashException$fMonadUniqueStateT decodeOrErrDcNameConTagDataConMkDatadcNamedcUniqdcTagdcType dcUnivTyVars dcExtTyVarsdcArgTys dcFieldLabels$fUniquableDataCon $fOrdDataCon $fEqDataCon $fShowDataCon$fGenericDataCon$fNFDataDataCon$fHashableDataCon$fBinaryDataCon AlgTyConRhs DataTyConNewTyCondataConsdataCon ntEtadRhsTyConMapAlgTyConFunTyCon PrimTyConSuperKindTyCon tyConUniq tyConName tyConKind tyConArityalgTcRhs isClassTc tyConSubst mkKindTyConisTupleTyConLike tyConDataCons isNewTypeTc$fUniquableTyCon $fEqTyCon $fShowTyCon$fShowAlgTyConRhs$fGenericAlgTyConRhs$fNFDataAlgTyConRhs$fBinaryAlgTyConRhs$fGenericTyCon $fNFDataTyCon $fBinaryTyConliftedTypeKind typeNatKindtypeSymbolKind intPrimTy integerPrimTy charPrimTy stringPrimTy voidPrimTy wordPrimTy int64PrimTy word64PrimTy floatPrimTy doublePrimTy naturalPrimTybyteArrayPrimTy tysPrimMapLiteralIntegerLiteral IntLiteral WordLiteral Int64Literal Word64Literal StringLiteral FloatLiteral DoubleLiteral CharLiteralNaturalLiteralByteArrayLiteral literalType $fEqLiteral $fOrdLiteral $fShowLiteral$fGenericLiteral$fNFDataLiteral$fHashableLiteral$fBinaryLiteral KindOrTypeLitTyNumTySymTyConstTyArrowTypeViewFunTyTyConApp OtherTypeVarTyForAllTyAppTyAnnTypevarAttrstyViewcoreView coreView1mkFunTy mkTyConAppsplitTyConAppMtypeKindisPolyTy splitFunTy splitFunTyssplitFunForallTysplitCoreFunForallTy isPolyFunTyisPolyFunCoreTy typeAttrsisFunTy applyFunTy findFunSubstreduceTypeFamilyisTypeFamilyApplication undefinedTy isIntegerTy normalizeType isClassTy $fEqConstTy $fOrdConstTy $fShowConstTy$fGenericConstTy$fNFDataConstTy$fHashableConstTy$fBinaryConstTy $fEqLitTy $fOrdLitTy $fShowLitTy$fGenericLitTy $fNFDataLitTy$fHashableLitTy $fBinaryLitTy $fShowType $fGenericType $fNFDataType$fHashableType $fBinaryType$fShowTypeViewContext CoreContextAppFunAppArgTyAppC LetBindingLetBodyLamBody TyLamBodyCaseAlt CaseScrutCastBodyTickCAltPatDataPatLitPat DefaultPatWorkInfo WorkConstant WorkNever WorkVariable WorkAlwaysPrimInfoprimType primWorkInfoNameMod PrefixName SuffixNameSetNameTickInfoDataPrimLamTyLamAppTyAppLetrecCaseCastTickisLambdaBodyCtx isTickCtx collectArgs collectTickscollectArgsTicksprimArgpartitionTicks$fEqCoreContext $fEqNameMod $fShowNameMod$fGenericNameMod$fNFDataNameMod$fHashableNameMod$fBinaryNameMod $fEqTickInfo$fShowTickInfo$fGenericTickInfo$fNFDataTickInfo$fHashableTickInfo$fBinaryTickInfo$fShowWorkInfo$fGenericWorkInfo$fNFDataWorkInfo$fHashableWorkInfo$fBinaryWorkInfo$fShowPrimInfo$fGenericPrimInfo$fNFDataPrimInfo$fHashablePrimInfo$fBinaryPrimInfo$fEqPat$fOrdPat $fShowPat $fGenericPat $fNFDataPat $fHashablePat $fBinaryPat $fShowTerm $fGenericTerm $fNFDataTerm$fHashableTerm $fBinaryTerm$fShowCoreContext$fGenericCoreContext$fNFDataCoreContext$fHashableCoreContext$fBinaryCoreContextHdlSynVivadoQuartusOtherDeclElementTextResultArgArgGenConstLitSymTypTypMErrTypElemCompName IncludeName IndexTypeSizeLengthDepthMaxIndexFilePathTemplateGenIFAndIW64CmpLEBVSelIsLitIsVar IsActiveHighTagPeriod ActiveEdgeIsSync IsInitDefinedIsActiveEnableStrCmp OutputWireRegVarsGenSymRepeatDevNullSigDBlackBoxTemplateBlackBoxFunction BlackBoxMeta bbOutputRegbbKind bbLibrary bbImports bbIncludes TemplateKindTDeclTExpremptyBlackBoxMeta$fShowTemplateKind$fEqTemplateKind$fGenericTemplateKind$fNFDataTemplateKind$fBinaryTemplateKind$fHashableTemplateKind $fEqHdlSyn $fShowHdlSyn $fReadHdlSyn$fGenericHdlSyn$fNFDataHdlSyn$fBinaryHdlSyn$fHashableHdlSyn $fShowElement$fGenericElement$fNFDataElement$fBinaryElement$fHashableElement $fShowDecl $fGenericDecl $fNFDataDecl $fBinaryDecl$fHashableDecl PrimitiveBlackBoxHaskellnameworkInfokindwarning outputReg librariesimportsincludestemplate functionNamefunctionprimSortTemplateFormat TTemplateTHaskellTemplateSourceTFileTInlineBlackBoxFunctionNamePrimMapCompiledPrimMapGuardedCompiledPrimitiveCompiledPrimitiveResolvedPrimMapGuardedResolvedPrimitiveResolvedPrimitiveUnresolvedPrimitive$fShowBlackBoxFunctionName$fFromJSONPrimitive$fEqBlackBoxFunctionName$fGenericBlackBoxFunctionName$fNFDataBlackBoxFunctionName$fBinaryBlackBoxFunctionName$fHashableBlackBoxFunctionName$fShowTemplateSource$fEqTemplateSource$fGenericTemplateSource$fNFDataTemplateSource$fShowTemplateFormat$fGenericTemplateFormat$fHashableTemplateFormat$fNFDataTemplateFormat$fShowPrimitive$fGenericPrimitive$fNFDataPrimitive$fBinaryPrimitive$fHashablePrimitive$fFunctorPrimitiverunParseBackend initBackendhdlKindprimDirs extension extractTypesgenHDL mkTyPackagehdlTypehdlTypeErrValue hdlTypeMark hdlRecSelhdlSiggenStmtinstexpriwWidthtoBVfromBVhdlSyn mkIdentifierextendIdentifier setModName setSrcSpan getSrcSpan blockDeclunextend addIncludes addLibraries addImports addAndSetData getDataFilesaddMemoryDataFilegetMemoryDataFilesseenIdentifiersifThenElseExprUsageExternalModNameescapeTemplatemkUniqueIdentifier preserveSeen PrettyPrecpprPrecpprPrec'ClashDoc SyntaxElementKeywordLitS QualifierClashAnnotation AnnContext AnnSyntax PrettyOptionsdisplayUniques displayTypesdisplayQualifierspprppr'fromPprshowPprshowPpr' tracePprIdtracePpr$fClashPrettyVar$fClashPrettyTerm $fPrettyLitTy$fClashPrettyType$fClashPrettyName$fPrettyPrecLiteral$fPrettyPrecDataCon$fPrettyPrecVar$fPrettyPrecSrcSpan$fPrettyPrecTickInfo$fPrettyPrecTerm$fPrettyPrecLitTy$fPrettyPrecTyCon$fPrettyPrecType$fPrettyPrecText$fPrettyPrec(,)$fPrettyPrec[]$fPrettyPrecName$fPrettyPrecPat$fEqSyntaxElement$fShowSyntaxElement$fEqClashAnnotation $fEqTypePrec $fOrdTypePrecRnEnv InScopeSetVarSetVarEnv emptyVarEnv unitVarEnv lookupVarEnv lookupVarEnv' delVarEnv delVarEnvList extendVarEnvextendVarEnvWithextendVarEnvList nullVarEnv unionVarEnvunionVarEnvWithmkVarEnv mapVarEnvmapMaybeVarEnv eltsVarEnv elemVarEnv notElemVarEnv emptyVarSet unitVarSet unionVarSet elemVarSet notElemVarSetdelVarSetByKeymkVarSetextendInScopeSetextendInScopeSetList unionInScope varSetInScope lookupInScopeelemInScopeSetnotElemInScopeSet mkInScopeSetemptyInScopeSetuniqAway uniqAway'mkRnEnvrnOccLTyrnOccRTyrnTyBndr rnTyBndrsrnOccLIdrnOccRIdrnTmBndr rnTmBndrs$fClashPrettyInScopeSet$fGenericInScopeSet$fBinaryInScopeSetManifest manifestHash portInNames portInTypes portOutNames portOutTypescomponentNames ClashOptsopt_inlineLimit opt_specLimitopt_inlineFunctionLimitopt_inlineConstantLimit opt_dbgLevel opt_cachehdl opt_cleanhdl opt_primWarn opt_color opt_intWidth opt_hdlDir opt_hdlSynopt_errorExtraopt_floatSupportopt_importPathsopt_componentPrefixopt_newInlineStratopt_escapedIdsopt_forceUndefined opt_checkIDir DebugLevel DebugNone DebugSilent DebugFinal DebugName DebugAppliedDebugAll BindingMap defClashOpts$fEqDebugLevel$fOrdDebugLevel$fReadDebugLevel$fShowManifest$fReadManifestTemplateFunction BBTemplate BBFunctionBBHashBBNameBlackBoxContextbbNamebbResultbbInputs bbFunctions bbQsysIncNamebbLevel bbCompNameBitHLUZNumLitBitLit BitVecLitBoolLitVecLit StringLitDataTag BlackBoxEConvBV IfThenElseModifierIndexedDC VecAppend RTreeAppendSlicedNested PortDirectionInOut WireOrRegWireRegEntityOrComponentEntityCompEmpty AssignmentCondAssignmentInstDecl BlackBoxDNetDecl'TickDeclVoidStringIntegerBool BitVectorIndexSignedUnsignedVectorRTreeSumProductSPClockReset BiDirectionalCustomSP CustomSum Annotated KnownDomainFilteredHWTypeIsVoid componentNameinputsoutputs declarationsComment NetlistState _bindings _varCount _components _primitives_typeTranslator_tcCache _curCompNm _intWidth_mkIdentifierFn_extendIdentifierFn_seenIds _seenComps_seenPrimitives_componentNames_topEntityAnns_hdlDir _curBBlvl_componentPrefix _customReprs _clashOpts _isTestBench _backEndITE _htyCache NetlistEnv _prefixName _suffixName_setNameHWMap runNetlistNetDecl hwTypeAttrstoBitemptyBBContext$fNFDataWireOrReg$fBinaryTemplateFunction$fNFDataTemplateFunction$fShowBlackBox$fNFDataDeclaration$fNFDataComponent$fShowEntityOrComponent$fShowWireOrReg$fGenericWireOrReg$fEqPortDirection$fOrdPortDirection$fShowPortDirection$fGenericPortDirection$fNFDataPortDirection$fHashablePortDirection $fEqHWType $fOrdHWType $fShowHWType$fGenericHWType$fNFDataHWType$fHashableHWType$fEqFilteredHWType$fShowFilteredHWType$fShowModifier$fEqBit $fShowBit $fLiftBit$fShowBlackBoxContext$fGenericBlackBox$fNFDataBlackBox$fBinaryBlackBox $fShowExpr$fShowDeclaration$fShowComponent$fFunctorNetlistMonad$fMonadNetlistMonad$fApplicativeNetlistMonad$fMonadReaderNetlistMonad$fMonadStateNetlistMonad$fMonadIONetlistMonad$fMonadFailNetlistMonad prefixNamesetName suffixName backEndITEbindings clashOptscomponentPrefix componentscurBBlvl curCompNm customReprsextendIdentifierFnhdlDirhtyCacheintWidth isTestBenchmkIdentifierFn primitives seenCompsseenIdsseenPrimitivestcCache topEntityAnnstypeTranslatorvarCountunsignedsignedassign signedLiteralunsignedLiteral literalTFwordTFintTFmkFunAppmkDeclarations mkNetDecl mkSelection mkProjectionmkDcApplicationmkExpr genComponent typeFreeVars typeFreeVars'localIdDoesNotOccurInlocalIdsDoNotOccurInlocalVarsDoNotOccurInlocalIdOccursInglobalIdOccursIn freeLocalVarsfreeIds freeLocalIds globalIdshasLocalFreeVarstermFreeTyVars termFreeVarsX termFreeVars'noFreeVarsOfType tyFVsOfTypeslocalFVsOfTermsSubst substInScope substTmEnv substTyEnv substGblEnvTvSubst TvSubstEnvmkSubst mkTvSubst extendIdSubstextendIdSubstListextendGblSubstList extendTvSubstextendTvSubstListextendInScopeIdextendInScopeIdListsubstTy substTyInVarsubstTm deShadowTerm freshenTmaeqTerm $fOrdTerm$fEqTerm $fOrdType$fEqType$fClashPrettyTvSubstTypeEqSolutionSolutionAbsurdSolution NoSolutionDeltaGamma normalizeAdd catSolutionssolveNonAbsurdssolveEqsolveAddtypeEqaltEqs isAbsurdAlt isAbsurdEqsubstGlobalsInExistentialssubstInExistentialsListsubstInExistentialstermType collectBndrsapplyTypeToArgs piResultTypiResultTyMaybe piResultTyspatIdspatVars mkAbstractionmkTyLamsmkLamsmkAppsmkTmAppsmkTyAppsmkTicksisFun isPolyFunisLamisLetisVar isLocalVarisConisPrimidToVarvarToIdtermSizemkVec appendToVecavailableUniques extractElems extractTElemsmkRTree isSignalTypeisClockOrReset tyNatSizemkUniqSystemTyVarmkUniqSystemIdmkUniqInternalIddataConInstArgTysEdataConInstArgTysprimCo undefinedTm substArgTys stripTickstySym$fShowTypeEqSolution$fEqTypeEqSolution PrimEvaluatorStateValueLambdaTyLambdaPrimValSuspend StackFrameUpdateGUpdateApply Instantiate PrimApply ScrutiniseTickishStack GlobalHeap GPureHeap unGPureHeapPureHeapHeap mkTickishwhnf'whnfisScrut unwindStackstep newLetBindingnewLetBindings'mkAbstrforceunwindupdategupdate valToTermtoVartoTypeapply instantiatenaturalLiteralintegerLiteralprimop scrutinisesubstAltallocateletSubst uniqueInHeap wrapUnsigned wrapSigned$fClashPrettyStackFrame $fShowValue$fShowStackFrame RewriteState_transformCounter _uniqSupply_curFun _nameCounter _globalHeap_extra RewriteStept_ctxt_namet_bndrSt_beforet_after$fShowRewriteStep$fGenericRewriteStep$fNFDataRewriteStep$fHashableRewriteStep$fBinaryRewriteStep RewriteEnv _dbgLevel _tupleTcCache _evaluator _topEntitiescurFunextra globalHeap nameCountertransformCounter uniqSupplyRewrite TransformTransformContext tfInScope tfContext RewriteMonadRunRdbgLevel evaluator topEntities tupleTcCacherunRcensor$fMonadFixRewriteMonad#$fMonadReaderRewriteEnvRewriteMonad$fMonadWriterAnyRewriteMonad$fMonadUniqueRewriteMonad$$fMonadStateRewriteStateRewriteMonad$fMonadRewriteMonad$fApplicativeRewriteMonad$fFunctorRewriteMonad$fMonadFailRewriteMonadallR>->>-!->topdownR bottomupR!->>-!repeatRwhenR bottomupWhenRNormalizeState _normalized_specialisationCache_specialisationHistory_specialisationLimit_inlineHistory _inlineLimit_inlineFunctionLimit_inlineConstantLimit_primitiveArgs_recursiveComponents_newInlineStrategy_normalizeUltraTermClassification _function _primitive _selection NormRewriteNormalizeSessionNormalizeMonadinlineConstantLimitinlineFunctionLimit inlineHistory inlineLimitnewInlineStrategynormalizeUltra normalized primitiveArgsrecursiveComponentsspecialisationCachespecialisationHistoryspecialisationLimit$fShowTermClassification primitive selectionconstantPropagation normalization coreToType' bitsToBits stripFilteredflattenFilteredisVoidisFilteredVoid isBiSignalOutsplitNormalizedunsafeCoreTypeToHWType'unsafeCoreTypeToHWTypeunsafeCoreTypeToHWTypeM'unsafeCoreTypeToHWTypeMcoreTypeToHWTypeM'coreTypeToHWTypeMpackSPpackSum fixCustomReprcoreTypeToHWType'coreTypeToHWTypeoriginalIndicesmkADT isRecursiveTyrepresentableTypetypeSizeconSize typeLength termHWType termHWTypeM isBiSignalIncontainsBiSignalIncollectPortNames'collectPortNamesfilterVoidPortsmkUniqueNormalizedmkUniqueArgumentsmkUniqueResult idToInPort idToOutPortidToPortid2type id2identifierrepNamemkUniquepreserveVarEnv dcToLiteral extendPortsportName prefixParentappendIdentifieruniquePortNamemkInput mkVectorChain mkRTreeChaingenComponentNamegenTopComponentNamestripAttributesmkOutput mkOutput'mkTopUnWrapperargBVresBVdoConv mkTopInputthrowAnnotatedSplitError mkTopOutput mkTopOutput'concatPortDecls3nestMbindsExistentialsiteAlts withTicks affixName zoomExtrafindAccidentialShadows applyDebug runRewriterunRewriteSession setChangedchangedclosestLetBinder mkDerivedName mkTmBinderFor mkBinderFor mkInternalVar inlineBinders isJoinPointIn tailCalls isVoidWrappersubstituteBinders isWorkFree isFromInt isConstantisConstantNotClockResetisWorkFreeClockOrReset isWorkFreeIshinlineOrLiftBinders liftBindinguniqAwayBinder mkFunction addGlobalBindcloneNameWithInScopeSetcloneNameWithBindingMapisUntranslatableisUntranslatableTypemkWildValBindermkSelectorCase specialise specialise'normalizeTermTypes normalizeIdspecArgBndrsAndVars reduceReverse reduceZipWith reduceMap reduceImapreduceTraverse mkTravVec reduceFoldr reduceFold reduceDFold reduceHead reduceTail reduceLast reduceInit reduceAppendreduceUnconcatreduceTransposereduceReplicatereduceReplace_intreduceIndex_int reduceDTFold reduceTFoldreduceTReplicate buildSNat isDisjointcollectGlobalsmkDisjointGroup $fEqCaseTree$fShowCaseTree$fFunctorCaseTree$fFoldableCaseTree stripVoid inputHoleverifyBlackBoxContextextractLiteralssetSym selectNewNamerenderFilePathrenderTemplaterenderBlackBox renderElem parseFailidToExprlineToIdentifier lineToType renderTagelementsToText elementToText exprToStringprettyBlackBox prettyElem walkElement usedVariables usedArguments onBlackBoxhashCompiledPrimMapgeneratePrimMap constantArgsConstantSpecInfocsrNewBindings csrNewTermcsrFoundConstant isConstantArg shouldReducealreadyInlined addNewInlinespecializeNormisClosedisNonRecursiveGlobalVarisRecursiveBndrconstantSpecInfo callGraphclassifyFunctionisCheapFunctionnormalizeTopLvlBndr rewriteExpr removedTm$fShowConstantSpecInfoaltpllTF alteraPllTFalteraPllTemplatealtpllTemplateinlineOrLiftNonReptypeSpec nonRepSpeccaseLetcaseElemNonReachableelemExistentialscaseCase inlineNonRepcaseCon nonRepANFtopLetdeadCoderemoveUnusedExprbindConstantVarcaseCastletCast argCastSpec inlineCasteliminateCastCast splitCastWorkinlineWorkFree inlineSmall constantSpecappProp appPropFastcaseFlatmakeANFetaExpansionTL etaExpandSyn recToLetRecinlineHO simpleCSE reduceConstreduceNonRepPrimdisjointExpressionConsolidation inlineCleanup flattenLet topdownSucR topdownRR innerMost applyManyCallTreeCLeafCBranchrunNormalization normalize normalize'checkNonRecursive cleanupGraph mkCallTree stripArgs flattenNodeflattenCallTreecallTreeToListwarnmkBlackBoxContextprepareBlackBox isLiteral mkArgumentextractPrimWarnOrFail mkPrimitive mkFunInputindexIntVerilogindexIntVerilogTFindexIntVerilogTemplate genNetlistrunNetlistMonadgenNames genComponentTisWriteToBiSignalPrimitivemkDeclarations'reorderDefault reorderCustompatPos toSimpleVargetClashModificationDate generateHDLloadImportAndInterpretcompilePrimitiveprocessHintError createHDL prepareDirwriteHDLwriteMemoryDataFiles copyDataFilescallGraphBindingsnormalizeEntity VerilogStateincludeuselibsexprLitbitsbit_char encodingNote$fBackendVerilogState VHDLState$fBackendVHDLStateSystemVerilogState$fBackendSystemVerilogState GHC.MaybeNothing topSortVisit' topSortVisitPreducers-3.12.3-40995c158f8b601b8809006d0f87017d1e2388a4a9eb5434c1125248dd49ffc9Data.Semigroup.MonadAction getActionMongetMonPvector-0.12.0.3-173ea7fd00126e1895c0b783b7a97284a3d5473ae68b9c361a51ae7b5d58ec24Data.Vector.Primitive//Rprimitive-0.7.0.0-4ea757bece619ddb73b675bf595d3472b7b570ea7727d490e640774511e61509Data.Primitive.Typescopy unsafeCopyfreezethaw unsafeThaw unsafeFreeze fromListNfromListtoListscanr1'scanr1scanr'scanr postscanr' postscanr prescanr'prescanrscanl1'scanl1scanl'scanl postscanl' postscanl prescanl'prescanlfold1M'_foldM'_fold1M_foldM_fold1M'foldM'fold1MfoldM minIndexByminIndex maxIndexBymaxIndex minimumByminimum maximumBymaximumproductsumanyallifoldr'ifoldrifoldl'ifoldlfoldr1'foldr'foldr1foldrfoldl1'foldl'foldl1foldl elemIndices elemIndex findIndices findIndexfindnotElemelembreakspanunstablePartition dropWhile takeWhilefilterM imapMaybemapMaybeuniqifilterfilter zipWithM_zipWithM izipWith6 izipWith5 izipWith4 izipWith3izipWithzipWith6zipWith5zipWith4zipWith3zipWithforM_forMmapM_mapM concatMapimapmapmodifyunsafeBackpermute backpermutereverseunsafeAccumulate_ unsafeAccum accumulate_accum unsafeUpdate_ unsafeUpdupdate_createTcreate iterateNM generateM replicateMconcat++snocconsenumFromThenTo enumFromTo enumFromStepN enumFromN constructrN constructN unfoldrNMunfoldrMunfoldrNunfoldriterateNgenerate replicate singletonempty unsafeDrop unsafeTake unsafeTail unsafeInit unsafeSlicesplitAtdroptaketailinitslice unsafeLastM unsafeHeadM unsafeIndexMlastMheadMindexM unsafeLast unsafeHead unsafeIndexlasthead!?!nulllengthData.Vector.Primitive.MutableMVectorData.Vector.GenericconvertvarKeyversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNameghc-prim GHC.TypesTrueGHC.List Data.Foldable genLineErrreplaceCommonEscapes genLineErr'tySuperKindTyConNameliftedTypeKindTyConNametypeNatKindTyConNametypeSymbolKindTyConName tySuperKindTcliftedTypeKindTc typeNatKindTctypeSymbolKindTc intPrimTc integerPrimTc charPrimTc stringPrimTc voidPrimTc wordPrimTc int64PrimTc word64PrimTc floatPrimTc doublePrimTc naturalPrimTcbyteArrayPrimTcnewTyConInstRhs isSuperKind splitTyAppMsplitOn parseBBFN pBlackBoxDpElementpTextpTagDpDeclpOutputpInputpTagE brackets' pBlackBoxEpElemEpSigD rn_envLTy rn_envLTm rn_envRTy rn_envRTm rn_inScopeInt extendVarSet subsetVarSet lookupVarSetreadSizewordTF'intTF'Control.Lens.TypeFold zipTvSubst IdSubstEnv substIdBndr lookupIdSubstsubstTyVarBndr substTyVarsubstTyUncheckedcheckValidSubst isValidSubstsubstTy'substTyVarBndr' substBindacmpType acmpType'aeqTerm'acmpTerm acmpTerm'GHC.Err undefinedfmapCaseTreeallEqualcollectGlobals'collectGlobalsArgscollectGlobalsAltscollectGlobalsLbsdisJointSelProjJust areSharedmkDJArgsgenCaseinterestingToLiftQhashable-1.3.0.0-42b3df49d656c5ad33f788724b344a9cb78b18ad49e25e6bb80ff686ba1fa062Data.Hashable.ClasshashresolvePrimitive'resolvePrimitive CallGraph constantCsrbindCsr mergeCsrs bindPureHeap tellBinders collectANFVerilogM _genDepth _dataFiles_memoryDataFiles genVerilogverilogTypeMarkverilogTypeErrValueaddAttrs renderAttrinst_'inst_modifierexpr__tyCache_tySeen _nameCachetyName_hdlsyn timeUnits reservedWordsproductFieldNamesgenVHDL mkTyPackage_ attrTypesattrMapassocs appendSizesizedQualTyName sizedTyName qualTyNametyName' normaliseTypefilterTransparent userTyNamesizedQualTyNameErrValueproductFieldNameselectProductFieldFalseSystemVerilogM _tyPkgCtx