# oB      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdef g h ijklmnopqrstuvwxyz{|}~       !"#$%&'()*+,-./0123456789:;<=>?@ 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 [ \ ] ^ _ `abcdefghijklmnopqrstuvwxyz{|}~                                                                                                                                                             ! " # $ % & '()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij 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-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.{.|.}.~..................///////++++++++++++++++++++++00000000000000000000000011111111222222222222222222222222222222222222222####3333333333333 ( ( ( ( ((((((444444444)))) )!)")#)$5%5&5'5(5)5*5+5,5-5.5/505152535455666768696:6;6<6=6>7?7@8A8@#(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>Safe%./1245678:;HPUVXakaSafe%./1245678:;HPUVXakfB$ clash-lib A variant of Pretty that is not polymorphic on the type of annotations. This is needed to derive instances from Clash's pretty printer (PrettyPrec), which annotates documents with Clash-specific information and, therefore, fixes the type of annotations.$%&'(&'$%(None%./1245678:;HMPUVXak() 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 B$, the key-value pair will be removedF clash-lib2Right-fold over a map using both the key and valueG clash-lib<Strict left-fold over a map using both the key and the valueH clash-lib The empty setI clash-libSet with a single elementJ clash-libAdd an element to the setK clash-libUnion two setsL clash-lib*Check whether an element exists in the setM clash-lib2Check whether an element does not exist in the setN clash-lib8Check whether an element exists in the set based on the . contained in that elementO clash-lib6Look up an element in the set, returns it if it existsP clash-libRemove an element based on the . it containsQ clash-lib%Get the elements of the set as a listR clash-lib6Create a set out of a list of elements that contain a .S clash-lib Convert a * to a )T clash-lib"Check whether a A is a subset of BT clash-libSet A clash-libSet B,)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST,.+,-*156/0234;<=>?CE:798FGBD@AS)OHIJKPLMNTRQ(C) 2018, QBayLogicBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>Safe%./1245678:;HPUVXakPd 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.e 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.C clash-libEdges clash-libUnmarked nodes clash-lib Marked nodes clash-lib Sorted so far clash-lib Node to visitD clash-libEdges clash-libUnmarked nodes clash-lib Marked nodes clash-lib Sorted so far clash-lib Node to visitd clash-libNodes clash-libEdges clash-lib+Error message or topologically sorted nodese clash-libNodes clash-libEdges clash-lib%Reversely, topologically sorted nodesdede >(C) 2019, QBayLogic B.V. 2013, Nikita VolkovBSD2 (see the file LICENSE)%QBayLogic B.V. <devops@qbaylogic.com>None%./1245678:;HPUVX_akE clash-libaCollects nodes into lines. Expressions might still contain newlines! Does not start or end with F.ff9Safe%./1245678:;HPUVXakGHIJKL:(C) 2019, QBayLogic B.VBSD2 (see the file LICENSE)$QBayLogic B.V <devops@qbaylogic.com>None%./1245678:;HPUVXakIMNOPQRSafe%./1245678:;=?HPUVXakP8ijklmnopqrstuvwxyz{|}~8ijklmnopqrstuvwxyz{|}~|6;None%./1245678:;HPUVXakSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<(C) 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HPUVXak=(C) 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./12456789:;HPUVXakY(C) 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./12456789:;=?@AHPUVXak  P(C) 2012-2016, University of Twente, 2017-2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None$%&'./12456789:;HPSUVXakŜ  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 variable>Safe%./1245678:;HPUVXakb#(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;=?FHPSUVXak=! 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 ?A clash-lib0Performs trace when first argument evaluates to  clash-lib A version of % that works with a monadic predicate. clash-libMonadic version of BC  clash-libMonadic version of BD  clash-lib)if-then-else as a function on an argument  clash-lib&Applicative version of 'GHC.Types.(:)'  clash-libSafe indexing, returns a B if the index does not exist  clash-libSame as  with last two arguments swapped 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-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-libError message to display clash-libIndex n clash-lib List to index clash-libError or element n clash-libError message to display clash-lib List to index clash-libIndex n clash-libError or element n clash-libHaystack clash-lib"Times needle was found in haystackD        !"#$%&'D      !"#$%&'    5E#(C) 2015-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HPUVXak 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 parse +P(C) 2012-2016, University of Twente, 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./12456789:;=?@AHPUVXak , clash-libDataCon reference- clash-lib:Syntactical position of the DataCon in the type definition. clash-libData Constructor0 clash-libName of the DataCon1 clash-lib4Invariant: forall x . dcUniq x ~ nameUniq (dcName x)2 clash-lib+Syntactical position in the type definition3 clash-libType of the 'DataCon4 clash-liblUniversally quantified type-variables, these type variables are also part of the result type of the DataCon5 clash-libExistentially quantified type-variables, these type variables are not part of the result of the DataCon, but only of the arguments.6 clash-libArgument types7 clash-libJNames of fields. Used when data constructor is referring to a record type. ,-./23456017 ./23456017,- #(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./12456789:;=?@AHPUVXakq clash-libTyCon reference clash-libType Constructor@ clash-lib The RHS of an Algebraic DatatypeC clash-libThe DataCons of a TyConD clash-libThe newtype DataConE 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.G clash-libAlgorithmic DataConsH clash-lib$Function TyCons (e.g. type families)I clash-libPrimitive TyConsJ clash-lib'To close the loop on the type hierarchyL clash-libName of the TyConM clash-libKind of the TyConN clash-libNumber of type argumentsO clash-libDataCon definitionsP clash-libIs this a class dictionary?Q clash-lib&List of: ([LHS match types], RHS type)R clash-lib Create a Kind out of a TyConNameS clash-lib&Does the TyCon look like a tuple TyConT clash-lib%Get the DataCons belonging to a TyConHGIJLMNOKPQ@ABDCEFRSTUHGIJLMNOKPQF@ABDCERSUTX(C) 2012-2016, University of Twente, 2016 , Myrtle Software LtdBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HPUVXak'  clash-lib Builtin Name  clash-lib Builtin Name  clash-lib Builtin Name  clash-lib Builtin Name clash-lib Builtin Kind clash-lib Builtin Kind clash-lib Builtin Kind 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 Type clash-lib Builtin Type clash-lib Builtin Type clash-lib Builtin Type clash-lib Builtin Type clash-lib Builtin Type`abcdefghijklmno`abcdefghijklmno(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%./12456789:;=?@AHPUVXak-p clash-lib Term Literal| clash-lib Determines the Type of a Literal pvyqrtsuwxz{| pvyqrtsuwxz{| (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 $%./12456789:;=?@AFHPUVXakcz* clash-libReference to a Kind clash-libReference to a Type clash-libThe level above types clash-lib/Types in CoreHW: function and polymorphic types clash-libMake a Type out of a TyCon clash-libEither a Kind or a Type clash-lib Literal Types clash-libType Constants clash-lib TyCon type clash-lib Function type clash-libAn easier view on types clash-lib Function type clash-lib Applied TyCon clash-libNeither of the above clash-lib Type variable clash-lib Type constant clash-libPolymorphic Type clash-libType Application clash-lib Type literal clash-lib9Annotated type, see Clash.Annotations.SynthesisAttributes clash-libAn easier view on typesNote [Arrow arguments]Clash' Arrow type can either have 2 or 4 arguments, depending on who created it. By default it has two arguments: the argument type of a function, and the result type of a function.+So when do we have 4 arguments? When in Haskell/GHC land the arrow was unsaturated. This can happen in instance heads, or in the eta-reduced representation of newtypes. So what are those additional 2 arguments compared to the "normal" function type? They're the kinds of argument and result type. clash-libA view on types in which newtypes are transparent, the Signal type is transparent, and type functions are evaluated to WHNF (when possible).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". 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 arguments 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-liblMake a polymorphic function type out of a result type and a list of quantifiers and function argument types 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 type 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) clash-lib Result type clash-lib/List of quantifiers and function argument types11 P(C) 2012-2016, University of Twente, 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./12456789:;=?@AHPUVX_ak3 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.suffixNameP 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-libEDeduplicate, i.e. try to share expressions between multiple branches. clash-libDo not deduplicate, i.e. keepf, an expression inside a case-alternative; do not try to share expressions between multiple branches. clash-libVariable reference clash-libDatatype constructor clash-libLiteral clash-lib Primitive clash-libTerm-abstraction clash-libType-abstraction clash-lib Application clash-libType-application clash-libRecursive let-binding clash-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-libbVisit all terms in a term, testing it with a predicate, and returning a list of predicate yields. clash-libFunction application clash-libIf Term& was a primitive: (name of primitive,  type args,  term args) clash-lib(source ticks, nameMod ticks)>>W(C) 2012-2016, University of Twente, 2017 , Myrtle Software LtdBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./12456789:;HPUVXaks.+ 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.getUsedArguments*Clash.Netlist.BlackBox.Types.usedVariables2Clash.Netlist.BlackBox.Types.verifyBlackBoxContext(Clash.Netlist.BlackBox.Types.walkElement. clash-lib*Dumps given text without processing in HDL/ clash-libComponent instantiation hole0 clash-lib Output hole; Bool asserts escape marker stripping1 clash-lib Input hole; Bool asserts escape marker stripping2 clash-libZLike Arg, but its first argument is the scoping level. For use in in generated code only.3 clash-lib,Like Arg, but input hole must be a constant.4 clash-lib*Like Arg, but input hole must be a literal5 clash-lib Name hole6 clash-lib]Like Arg but only insert variable reference (creating an assignment elsewhere if necessary).7 clash-lib Symbol hole8 clash-libType declaration hole9 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 holeA clash-libDepth of a tree holeB clash-libMax index into a vectorC clash-lib*Hole containing a filepath for a data fileD clash-libCreate data file  HOLE0 with contents HOLE1E clash-libFHole marking beginning (True) or end (False) of a generative constructH clash-libHole indicating whether IntWordInteger are 64-BitI clash-libCompare less-or-equalJ clash-lib=Hole indicating which synthesis tool we're generating HDL forK clash-lib*Convert to (True)/from(False) a bit-vectorL clash-libRecord selector of a typeO clash-lib/Whether a domain's reset lines are synchronous.P clash-libTag of a domain.Q clash-libPeriod of a domain.R clash-lib7Test active edge of memory elements in a certain domainS clash-libXWhether a domain's reset lines are synchronous. Errors if not applied to a KnownDomain.U clash-libjWhether given enable line is active. More specifically, whether the enable line is NOT set to a constant .Z clash-libRepeat  hole n times[ clash-lib Evaluate  hole but swallow output] clash-lib The "context name", name set by FG-, defaults to the name of the closest binder^ clash-lib_A BlackBox Template is a List of Elements TODO: Add name of function for better error messages_ clash-libA BlackBox function generates a blackbox template, given the inputs and result type of the function it should provide a blackbox for. This is useful when having a need for blackbox functions, ... TODO: docs` clash-libSee Clash.Primitives.Types.BlackBoxf for documentation on this record's fields. (They are intentionally renamed to prevent name clashes.)l clash-libUWhether this primitive should be rendered when its result type is void. Defaults to n.m clash-lib,Render blackbox, even if result type is voidn clash-libFDon't render blackbox result type is void. Default for all blackboxes.o clash-libjUse this value in your blackbox template function if you do want to accept the defaults as documented in Clash.Primitives.Types.BlackBox., clash-lib0Argument position of the function to instantiate clash-libSubposition of function: blackboxes can request multiple instances to be rendered of their given functions. This subposition indicates the nth function instance to be rendered (zero-indexed).This is a hack: the proper solution would postpone rendering the function until the very last moment. The blackbox language has no way to indicate the subposition, and every ~INST will default its subposition to zero. Haskell blackboxes can use this data type. clash-lib (name of signal, type of signal)_ clash-libIndicates whether caller needs a declaration. If set, the function is still free to return an expression, but the caller will convert it to a declaration. clash-libName of primitive clash-lib Arguments clash-lib Result typeI'*()+,-5E0.G3C1P?@A:24\JR/8;679<=>BDFHIKLMNOQSTUVWXYZ[]^_`acbdefghikjlmnoI`acbdefgho_^ikj-5E0.G3C1P?@A:24\JR/8;679<=>BDFHIKLMNOQSTUVWXYZ[]+,'*()lmn(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$%./12456789:;=?HPUVX_ak'  clash-libExternally defined primitive clash-libBPrimitive template written in a Clash specific templating language clash-libLPrimitive template rendered by a Haskell function (given as raw source code) clash-libwA primitive that carries additional information. These are "real" primitives, hardcoded in the compiler. For example:  mapSignal in GHC2Core.coreToTerm. clash-libName of the primitive clash-lib9Whether the primitive does any work, i.e. takes chip area clash-libUWhether this primitive should be rendered when its result type is void. Defaults to n. clash-lib6Whether this results in an expression or a declaration clash-libA warning to be outputted when the primitive is instantiated. This is intended to be used as a warning for primitives that are not synthesizable, but may also be used for other purposes. clash-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). clash-libVHDL only: add library! declarations for the given names clash-libVHDL only: add use! declarations for the given names clash-libIndicates how often a function will be instantiated in a blackbox. For example, consider the following higher-order function that creates a tree structure:%fold :: (a -> a -> a) -> Vec n a -> avIn order to generate HDL for an instance of fold we need log2(n) calls to the first argument, `a -> a -> a` (plus a few more if n is not a power of two). Note that this only targets multiple textual instances of the function. If you can generate the HDL using a for-loop and only need to call ~INST once, you don't have to worry about this option. See the blackbox for HI for an example of this.Right now, option can only be generated by BlackBoxHaskell. It cannot be used within JSON primitives. To see how to use this, see the Haskell blackbox for HJ. 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 file clash-lib0(Maybe) Control the generated name of the result clash-lib8(Maybe) Control the initial/power-up value of the result clash-libUUsed to indiciate type of template (declaration or expression). Will be filled with Template or an Either decl expr. clash-libJArguments used by blackbox. Used to remove arguments during normalization. clash-libWHolds blackbox function and its hash, (Int, BlackBoxFunction), in a CompiledPrimitive. clash-libAdditional information clash-lib=Data type to indicate what arguments are in use by a BlackBox clash-libOnly these are used clash-libAll but these are used clash-lib,Template source stored in file on filesystem clash-libTemplate stored inline clash-libA BBFN is a parsed version of a fully qualified function name. It is guaranteed to have at least one module name which is not Main. clash-libA PrimMap maps primitive names to a  Primitive clash-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.  clash-lib:Quick and dirty implementation of Text.splitOn for Strings! 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.+ikj+ikjW(C) 2012-2016, University of Twente, 2017 , Myrtle Software LtdBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HPUVXak8?  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)" clash-lib7Parse a BlackBoxTemplate (Declarations and Expressions)# clash-libParse a single Template Element$ clash-lib!Parse the Text part of a Template% clash-lib)Parse a Declaration or Expression element& clash-libParse a Declaration' clash-lib#Parse the output tag of Declaration( clash-lib"Parse the input tag of Declaration) clash-libParse an Expression element* clash-libParse a bracketed text+ clash-lib/Parse the expression part of Blackbox Templates, clash-libParse an Expression or Text- clash-lib Parse SigDX(C) 2012-2016, University of Twente, 2016 , Myrtle Software LtdBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;=?HPUVX_akED  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 StringNone%./12456789:;=?HMPUVXakI: clash-lib-Rename environment for e.g. alpha equivalence!When going under binders for e.g.  x -> e1 aeq y -> e2 We want to rename [x -> y] or [y -> x]8, but we have to pick a binder that is neither free in e1 nor e2 or we risk accidental capture.So we must maintain: A renaming for the left termA renaming for the right termA set of in scope variables. clash-libType renaming for the left term/ clash-libTerm renaming for the left term0 clash-lib Type renaming for the right term1 clash-lib Term renaming for the right term2 clash-libIn scope in left or right terms clash-lib/Set of variables that is in scope at some pointThe 3O 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-lib0Lookup a value based on the unique of a variable  clash-lib$Lookup a value based on the variable+Errors out when the variable is not present  clash-lib1Remove a variable-value pair from the environment  clash-lib:Remove a list of variable-value pairs from the environment  clash-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 B! are removed from the environment clash-lib]Strict left-fold over an environment using both the unique of the the variable and the value clash-libExtract the elements clash-lib*Does the variable exist in the environment clash-lib.Does the variable not exist in the environment clash-lib The empty set clash-libThe set of a single variable4 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 set5 clash-lib5Is the set of variables A a subset of the variables B6 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 term0 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]1 clash-libApplies 0G to several variables: the two variable lists must be of equal length.2 clash-lib6Look up the renaming of an occurrence in the left term3 clash-lib6Look up the renaming of an occurrence in the left term4 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]5 clash-libApplies 4G to several variables: the two variable lists must be of equal length.5 clash-libSet of variables A clash-libSet of variables B, clash-libUnique in scope test clash-libSeed4      !"#$%&'()*+,-./0123454      !*&)"#$'(%+,-405123./(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>None"#%./12456789:;HPUVXak9 clash-libEInformation about the generated HDL between (sub)runs of the compiler; clash-libjHash of the TopEntity and all its dependencies + (maybe) Hash of the TestBench and all its dependencies< clash-lib6Compiler flags used to achieve successful compilation:opt_inlineLimit opt_specLimitopt_floatSupport> 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 equal@ 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 equalA 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).O clash-lib[Directory to store temporary files in. Will be cleaned after Clash has finished executing.W clash-libhPerform a high-effort compile, trading improved performance for potentially much longer compile times.#Name inspired by Design Compiler's  compile_ultra flag.X 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 HDLZ clash-libyEnable aggressive X optimization, which may remove undefineds from generated HDL by replaced with defined alternatives.[ clash-libAAt what size do we cache normalized work-free top-level binders.\ clash-libDebug Message Verbosity] clash-libDon't show debug messages^ clash-libDRun invariant checks and err if violated (enabled by any debug flag)_ clash-lib&Show completely normalized expressions` clash-lib%Show names of applied transformationsa clash-lib/Show names of tried AND applied transformationsb clash-lib/Show sub-expressions after a successful rewritec clash-lib8Show all sub-expressions on which a rewrite is attemptedd clash-libGlobal function bindersCGlobal functions cannot be mutually recursive, only self-recursive.39:A@?>=<;BC[ZYXWVUTSRQPONKJIHGFEDML\cba`_^]defjihgk3efjihgd\cba`_^]BC[ZYXWVUTSRQPONKJIHGFEDMLk9:A@?>=<;#(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HPSUVX_akEy clash-lib:Gives the free type-variables in a Type, implemented as a 7The 7/ is closed over the types of its variables, so: <foldMapOf typeFreeVars unitVarSet ((a:* -> k) Int) = {a, k} z clash-libCGives the "interesting" free variables in a Type, implemented as a 7The 7+ 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/503514b94f8dc7bd9eab5392206649aee45f140b{ clash-lib9Check whether an identifier does not occur free in a term| clash-lib@Check whether a set of identifiers does not occur free in a term} clash-lib>Check whether a set of variables does not occur free in a term~ clash-lib6Check whether a local identifier occurs free in a term clash-lib6Check whether a local identifier occurs free in a term clash-libCalculate the local free variable of an expression: the free type variables and the free identifiers that are not bound in the global environment. clash-lib7Gives the free identifiers of a Term, implemented as a 7 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 7The 7+ is closed over the types of variables, so: PfoldMapOf termFreeTyVars unitVarSet (case (x : (a:* -> k) Int)) of {}) = {a, k}  clash-libCGives the "interesting" free variables in a Term, implemented as a 7The 7+ 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. clash-lib=Collect the free variables of a collection of type into a set clash-lib>Collect the free variables of a collection of terms into a set clash-libKGet the free variables of an expression and count the number of occurrencesz 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 interestingyz{|}~y~{|}zP(C) 2012-2016, University of Twente, 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HPUVX_akk( clash-libAlpha equality for types clash-libType substitution, see 8\Works only if the domain of the substitution is superset of the type being substituted into clash-lib6A substitution environment containing containing both  and  substitutions.6Some invariants apply to how you use the substitution: The  contains at least those s and s that will be in scope after applying the substitution to a term. Precisely, the in-scope set must be a superset of the free variables of the substitution range that might possibly clash with locally-bound variables in the thing being substituted in..You may only apply the substitution once. See hThere 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 clash9 clash-libA substitution of s for sNote [Extending the Subst] For a term , which binds Es as well, we make a different choice for Ids than we do for TyVars.For TyVars see !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 9 only when the unique changesfIf TvSubstEnv and IdSubstEnv are all empty, substExpr does nothing (Note that the above rule for : maintains this property.)In ;g, 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  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 9B 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) 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 substitution clash-libA substitution of s for s%Note [Extending the TvSubstEnv] See " 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  because b's kind does change(This invariant has several consequences:In <Q, we extend TvSubstEnv if the unique has changed, or if the kind has changedIn = , we do not need to consult the ; the TvSubstEnv is enoughIn /, we can short-circuit when TvSubstEnv is empty clash-lib@An empty substitution, starting the variables currently in scope clash-libCreate a type substitution8 clash-lib#Generates the in-scope set for the - 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 substitution clash-lib/Extend the substitution environment with a new  substitution clash-lib3Extend the substitution environment with a list of  substitutions clash-lib:Extend the substitution environment with a list of global  substitutions clash-lib/Extend the substitution environment with a new  substitution clash-lib3Extend the substitution environment with a list of  substitutions clash-libAdd an R to the in-scope set: as a side effect, remove any existing substitutions for it. clash-libAdd  s to the in-scope set. See also  clash-libSubstitute within a <The substitution has to satisfy the invariant described in %s Note [The substitution environment] clash-libSubstitute within a . See .> clash-libLike 8, but skips the checks for the invariants described in TvSubtsN Note [The substitution environment]. Should be used inside this module only.? clash-lib=This checks if the substitution satisfies the invariant from TvSbust%s Note [The substitution invariant].@ clash-lib When calling  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 $s Note [The substitution invariant].A clash-libThe work-horse of = clash-libKSubstitute a variable with a type if it's within the substitution's domain.6Does not substitute within the kind of free variables.< 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 variable clash-libSubstitute within a  clash-lib$Substitute within a case-alternative; clash-libFind the substitution for an  in the : clash-libSubstitute an " for another one according to the , given, returning the result and an update 2 that should be used in subsequent substitutions.B clash-libLike < but takes a  instead of a C clash-libZApply a substitution to an entire set of let-bindings, additionally returning an updated 1 that should be used by subsequent substitutions. clash-libeEnsure that non of the binders in an expression shadow each-other, nor conflict with he in-scope set clash-libgEnsure that non of the binders in an alternative shadow each-other, nor conflict with the in-scope set clash-libVEnsure that non of the let-bindings of a let-expression shadow w.r.t the in-scope set clash-libA much stronger variant of 3 that ensures that all bound variables are unique.Also returns an extended K additionally containing the (renamed) unique bound variables of the term.D clash-libAlpha comparison for typesE clash-lib(Alpha comparison for types. Faster than DC as it doesn't need to calculate the free variables to create the  clash-libAlpha equality for termsF clash-lib&Alpha equality for terms. Faster than C as it doesn't need to calculate the free variables to create the G clash-libAlpha comparison for typesH clash-lib(Alpha comparison for types. Faster than GC as it doesn't need to calculate the free variables to create the  clash-libThe substitution clash-lib2The alternative in which to apply the substitution clash-libCurrent InScopeSet clash-libBindings of the let-expression clash-libThe body of the let-expression clash-liboDeshadowed let-bindings, where let-bound expressions and the let-body properly reference the renamed variables clash-lib!Current set of variables in scopeF clash-lib9Superset of variables in scope of the left and right termH clash-lib9Superset of variables in scope of the left and right term#(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None$%./1245678:;HPUVXak8 clash-libAData type that indicates what kind of solution (if any) was found clash-lib1Solution was found. Variable equals some integer. clash-lib8A solution was found, but it involved negative naturals. clash-lib4Given type wasn't an equation, or it was unsolvable. clash-libKind environment/context clash-libType environment/context 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) clash-lib9Solve given equations and return all non-absurd solutions clash-lib Solve simple equalities such as:a ~ 33 ~ aSomeType a b ~ SomeType 3 5SomeType 3 5 ~ SomeType a bSomeType a 5 ~ SomeType 3 b clash-libSolve equations supported by  normalizeAdd. See documentation of TypeEqSolution to understand the return value. clash-lib+If type is an equation, return LHS and RHS. clash-libGet constraint equations clash-libDTests for unreachable alternative due to types being "absurd". See  isAbsurdEq for more info. 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. clash-libSafely substitute type variables in a list of existentials. This function will account for cases where existentials shadow each other. clash-libSafely substitute a type variable in a list of existentials. This function will account for cases where existentials shadow each other. clash-libDetermine the type of a term clash-libHSplit a (Type)Abstraction in the bound variables and the abstracted term clash-libGGet the result type of a polymorphic function given a list of arguments clash-libLike 7, but errors out when a type application is not valid.Do not iterate N, because it's inefficient to substitute one variable at a time; instead use  clash-libLike  but for a single argument.Do not iterate N, because it's inefficient to substitute one variable at a time; instead use  clash-lib"(piResultTys f_ty [ty1, ..., tyn]) give sthe type of (f ty1 .. tyn) where  f :: f_ty is interesting because: f_ty* may have more foralls than there are args)Less obviously, it may have fewer forallsFore case 2. think of:,piResultTys (forall a . a) [forall b.b, Int]5This really can happen, such as situations involving Is 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 Is type.dFor efficiency reasons, when there are no foralls, we simply drop arrows from a function type/kind. clash-lib6Get the list of term-binders out of a DataType pattern clash-lib6Abstract a term over a list of term and type variables clash-lib-Abstract a term over a list of 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-lib>Determines whether given type is an (alias of en) Enable line. clash-libEDetermines whether given type is an (alias of en) Clock or Reset line 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-libvTry to reduce an arbitrary type to a literal type (Symbol or Nat), and subsequently extract its String representation clash-libDetermine whether we should split away types from a product type, i.e. clocks should always be separate arguments, and not part of a product. clash-lib Worker of  , works on  instead of  clash-libFPotentially split apart a list of function argument types. e.g. given: [Int,(Clock,(Reset,Bool)),Char] we return nt,Clock,Reset,Bool,Char]But we would leave [Int, (Bool,Int), Char] unchanged. clash-lib&Strip implicit parameter wrappers (IP) clash-libIDo an inverse topological sorting of the let-bindings in a let-expression  clash-libVariables in scope clash-lib2List of existentials to apply the substitution for clash-lib Substitutions clash-libVariables in scope clash-lib2List of existentials to apply the substitution for clash-lib Substitutions 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 clash-libType to examine clash-lib:If we want to split values of the given type then we have Just: ~The (type-applied) data-constructor which, when applied to values of the types in 2., creates a value of the examined type:The arguments types of the product we are trying to split.^Note that we only split one level at a time (although we check all the way down), e.g. given (Int, (Clock, Bool)) we return: 4Just ((,) @Int @(Clock, Bool), [Int, (Clock, Bool)])4An outer loop is required to subsequently split the  (Clock, Bool) tuple.DDNone%./1245678:;HPUVXak(C) 2019, Myrtle Software LtdBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;=?HPUVXak  clash-lib)Tools to deal with literals encoded as a Term. clash-libConvert a to the constant it represents. Will return an error if (one of the subterms) fail to translate. clash-libSame as G, but returns printable error message if it couldn't translate a term. clash-libSame as >, but errors hard if it can't translate a given term to data. clash-libTerm to convert clash-libJJ indicates a failure, containing the (sub)term that failed to translate. K indicates a success.(C) 2020, QBayLogic B.V.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HPUVXak  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#Preserve ticks from Terms in Values  clash-lib#Preserve casts from Terms in Values$ clash-lib<Are we in a context where special primitives must be forced.&See [Note: forcing special primitives]2      !"#$%&'()*+,-./0122!      "#$%&'()*+,-./012(C) 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;FHPUVX_ak = 7 clash-libuA single step in the partial evaluator. The result is the new heap and stack, and the next expression to be reduced.9 clash-lib1Evaluate to WHNF given an existing Heap and Stack: clash-lib9Completely unwind the stack to get back the complete termG clash-lib!Small-step operational semantics.H clash-libmTake a list of types or type variables and create a lambda / type lambda for each one around the given term.J clash-libUnwind the stack by 1K clash-lib'Update the Heap with the evaluated termL clash-libApply a value to a functionM clash-libInstantiate a type-abstractionN clash-libEvaluate a case-expressionP clash-lib!Allocate let-bindings on the heapQ clash-lib6Create a unique name and substitution for a let-binder789:;<=>?@ABCDEFGHIJKLMNOPQ89:7;<=>?@ABCDEFGHIJKLMNOPQd(C) 2015-2016, University of Twente, 2017 , Myrtle Software Ltd, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HPUVXak-aS clash-libInitial state for state monadT clash-lib"What HDL is the backend generatingU clash-lib&Location for the primitive definitionsV clash-libmName of backend, used for directory to put output files in. Should be constant function / ignore argument.W clash-lib"File extension for target langaugeX clash-lib!Get the set of types out of stateY clash-lib$Generate HDL for a Netlist componentZ 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 markera clash-lib4Turn a Netlist Declaration to a HDL concurrent blockb clash-lib/Turn a Netlist expression into a HDL expressionc clash-libBit-width of Int,Word,Integerd clash-libConvert to a bit-vectore clash-libConvert from a bit-vectorf clash-lib'Synthesis tool we're generating HDL forg clash-lib mkIdentifierh clash-lib mkIdentifieri clash-lib setModNamej clash-lib setSrcSpank clash-lib getSrcSpanl clash-libBlock of declarationsm clash-libunextend/unescape identifierw clash-lib+Is a type used for internal or external usex clash-lib Internal usey 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.b clash-libEnclose in parentheses? clash-libExpr to convert.Rvutsrqponmifedc_^][ZYXUTSlb\hgW`jkaVwxyz{|}~.{|zwxyRvutsrqponmifedc_^][ZYXUTSlb\hgW`jkaV}~(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 %&'./12456789:;HMPSUVX_agkKq 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 reference clash-lib-Type of declaration, concurrent or sequential clash-libNetlist-level identifier clash-libGIdentifier generated in the NetlistMonad, always derived from another  clash-libAn original Core identifier clash-libA split identifier (into several sub-identifiers), needed to assign expressions of types that have to be split apart (e.g. tuples of Files) clash-lib8Context used to fill in the holes of a BlackBox template clash-lib,Blackbox function name (for error reporting) clash-libResult name and type clash-lib2Argument names, types, and whether it is a literal clash-lib&Function arguments (subset of inputs):6( Blackbox Template , Whether the result should be reg or a wire2 (Verilog only) , Partial Blackbox Context ) 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. clash-lib-The component the BlackBox is instantiated in clash-lib The "context name", name set by FG-, defaults to the name of the closest binder clash-lib Bit literal clash-libHigh clash-libLow clash-lib Undefined clash-libHigh-impedance clash-libLiterals used in an expression clash-libNumber literal clash-lib Bit literal clash-libBitVector literal clash-libBoolean literal clash-libVector literal clash-libString literal clash-libLiteral expression clash-libDataCon application clash-libSignal reference clash-libLeft e: tagToEnum#, Right e : dataToTag# clash-lib&Instantiation of a BlackBox expression clash-lib Do nothing 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-libSequential statements clash-libClocked sequential statements clash-lib@Statements to run at simulator start | Statements to run always clash-lib:Statements to run always | Declaration in sequential form clash-lib&The declaration | Branching statement 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 | Sequential statement 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-libySame as Product, 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-lib"File type for simulation-level I/O 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-lib Existentially quantified backend clash-libPrefix for top-level components clash-libPrefix for all other components 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-libSettings Clash was called with clash-lib>Whether we're compiling a testbench (suppresses some warnings) clash-lib3Whether the backend supports ifThenElse expressions clash-libThe current HDL backend  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-lib\Structure describing a top entity: it's id, its port annotations, and associated testbench. clash-libId of top entity clash-lib(Maybe) a topentity annotation clash-lib2(Maybe) a test bench associated with the topentity clash-libExtract hardware attributes from Annotated. Returns an empty list if non-Annotated given or if Annotated has an empty list of attributes. clash-libEliminator for  clash-libEliminator for  , fails on  clash-libReturn the type(s) of a  NetListId', returns multiple types when given a  clash-libReturn the type of a  , fails on   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-lib2Edge of the clock the statement should be executed clash-libClock expression clash-lib[Statements to be executed on the active clock edge | Statements running at simulator start clash-libScrutinized expresson clash-lib"Type of the scrutinized expression clash-lib*List of: (Maybe match, RHS of Alternative) 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-lib+Pointer to type of signal or type of signal clash-lib#Initial value ^ Signal declaration clash-lib1Note; will be inserted as a comment in target hdl clash-libName of signal clash-libType of signal clash-libmask clash-libvalue clash-lib8Eliminator for Identifiers generated in the NetlistMonad clash-lib(Eliminator for original Core Identifiers clash-lib8Eliminator for Identifiers generated in the NetlistMonad clash-lib(Eliminator for original Core Identifiers !"#     OPQRSTUVWXYZ[\]^_`abcdefghi! !"#     OPQRSTUVWXYZ[\]^_`abcdefghi (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%./12456789:;=?@AHMPUVXakCj clash-libState of a rewriting sessionl clash-lib!Number of applied transformationsm clash-libGlobal bindersn clash-libSupply of unique numberso clash-lib&Function which is currently normalizedp clash-lib Used for Freshq clash-libIUsed as a heap for compile-time evaluation of primitives that live in I/Or clash-libAdditional states clash-libCState used by the inspection mechanism for recording rewrite steps.u clash-libcurrent contextv clash-libName of the transformationw clash-libName of the current binderx clash-lib Term before applyy clash-lib Term after apply clash-lib,Read-only environment of a rewriting session clash-lib*Level at which we print debugging messages clash-lib+Transformations to print debugging info for 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 RewriteMonad6jkrqponlmstyxwuv6styxwuvjkrqponlm!#(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HPUVXak  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>None%./1245678:;HPUVXakz clash-lib State of the  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. clash-lib:Flattening stage should use the new (no-)inlining strategy clash-lib{High-effort normalization session, trading performance improvement for potentially much longer compile times. Follows the 5K flag. clash-lib@At what size do we cache normalized work-free top-level binders. clash-libDescription of a Term' in terms of the type "components" the Term has.%Is used as a performance/size metric. clash-libNumber of functions clash-libNumber of primitives clash-lib!Number of selections/multiplexers clash-libA  Transform action in the context of the  and  clash-lib3RewriteSession with extra Normalisation information clash-lib?State monad that stores specialisation and inlining information))$None%./1245678:;HPUVXak%(C) 2019, Myrtle Software LtdBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HPUVXak8L 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%./1245678:;HPUVXak  clash-libwTemplate function for Word8,Word16,.. Constructs "clean" literals. This function generates valid (System)Verilog only!M 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%./1245678:;HPUVX_ak clash-lib@Template function for Int8,Int16,.. Constructs "clean" literals.N clash-libIs declaration clash-lib Arguments clash-lib Word sizeL(C) 2017, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HPUVXak=*(C) 2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HPUVXak  clash-libConverts a list of BitRepresentation.Bits to their Netlist counterpart. clash-lib*Type to convert to bit representation type,(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$%./1245678:;>HPUVX`ak6 clash-lib\Throw away information indicating which constructor fields were filtered due to being void. clash-libStrip as many VoidU layers as possible. Might still return a Void if the void doesn't contain a hwtype. clash-lib5Determines if type is a zero-width construct ("void") clash-libSame as isVoid , but on FilteredHWType instead of HWType  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.  clash-libSame as unsafeCoreTypeToHWType&, but discards void filter information  clash-libConverts a Core type to a HWType given a function that translates certain builtin types. Errors if the Core type is not translatable.  clash-libSame as unsafeCoreTypeToHWTypeM&, but discards void filter information 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; B on failure clash-libnConstructs error message for unexpected projections out of a type annotated with a custom bit representation. clash-libHelper function of  clash-libGiven a map containing custom bit representation, a type, and the same type represented as HWType, convert the HWType to a CustomSP/CustomSum if it has a custom bit representation. clash-libSame as coreTypeToHWType&, but discards void filter information 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. clash-libVGenerates original indices in list before filtering, given a list of removed indices.+originalIndices [False, False, True, False][0,1,3] clash-libRConverts an algebraic Core type (split into a TyCon and its argument) to a HWType. clash-lib/Simple check if a TyCon is recursively defined. clash-libnDetermines if a Core type is translatable to a HWType given a function that translates certain builtin types. 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. clash-lib3Determines the bitsize of the constructor of a type clash-lib(Gives the length of length-indexed types 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. clash-lib2Gives the HWType corresponding to a term. Returns BC if the term has a Core type that is not translatable to a HWType.! clash-libHelper function of collectPortNames, which operates on a PortName instead of a TopEntity." 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.# clash-libFRemove ports having a void-type from user supplied PortName annotation$ clash-libLUniquely rename all the variables and their references in a normalized term% clash-libSet the name of the binderHNormally, it just keeps the existing name, but there are two exceptions: qIt's the binding for the result which is also referenced by another binding; in this case it's suffixed with _rec;The binding binds a primitive that has a name control fieldktakes priority over 1. Additionally, we create an additional binder when the return value gets a new name.( clash-lib]Same as idToPort, but * Throws an error if the port is a composite type with a BiSignalIn) clash-libJSame as idToPort, but: * Throws an error if port is of type BiSignalIn. clash-lib\Make a set of IDs unique; also returns a substitution from old ID to new updated unique ID.0 clash-libQPreserve the complete state before running an action, and restore it afterwards.1 clash-libPreserve the Netlist ,,! when executing a monadic action5 clash-lib%Prefix given string before portnames except when this string is empty.7 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.9 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 neededA clash-lib)Convert between BitVector for an argumentB clash-lib(Convert between BitVector for the resultC clash-lib&Add to/from-BitVector conversion logicD clash-lib.Generate input port mappings for the TopEntityE 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.F clash-lib8Generate output port mappings for the TopEntity. Yields Nothing if the output is VoidG clash-lib/Generate output port mappings for the TopEntityI clash-libdTry to merge nested modifiers into a single modifier, needed by the VHDL and SystemVerilog backend.J 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.L clash-lib`Run a NetlistMonad computation in the context of the given source ticks and name modifier ticksM clash-libQAdd the pre- and suffix names in the current environment to the given identifier  clash-lib,Approximate location in original source file  clash-lib,Approximate location in original source file clash-libType to convert to HWType clash-libType to convert to HWType clash-libConstructor index clash-lib Field index clash-lib;Map containing all custom representations index on its type clash-libNCustom reprs are index on type, so we need the clash core type to look it up. clash-lib1Type of previous argument represented as a HWType clash-libType to convert to HWType clash-libType to convert to HWType clash-lib3Were voids. Length must be less than or equal to n. clash-libOriginal indices 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. clash-libString considered representable clash-libTerm to convert to HWType$ 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 annotation% clash-libCurrent substitution clash-libThe binder for the result clash-lib9Whether the result binder is referenced by another binder clash-lib#The (renamed) binder for the result=The updated substitution in case the result binder is renamed`A new binding, to assign the result in case the original binder for the result got renamed. clash-lib The binding& 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 annotation' 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 annotation. 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 declarationsA clash-lib(maybe) Name of the _TopEntity_ clash-libEither: * A normal" argument * An argument with a PortNameB clash-lib(mabye) Name of the _TopEntity_ clash-libEither: * A normal result * A result with a PortNameC 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 logicD 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 inputF 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 outputG 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 outputL 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.L      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLML      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLM-(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%./1245678:;>HPSUVX\_ak/"N clash-libLift an action working in the r state to the O 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.P clash-lib2Record if a transformation is successfully appliedR clash-lib"Perform a transformation on a TermS clash-lib-Evaluate a RewriteSession to its inner monad.T clash-lib7Notify that a transformation has changed the expressionU clash-lib^Identity function that additionally notifies that a transformation has changed the expressionX clash-lib3Make a new binder and variable reference for a termY clash-libDMake a new binder and variable reference for either a term or a typeZ 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. BB 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-libpInline the first set of binder into the second set of binders and into the body of the original let expression.` clash-libLift the first set of binders to the level of global bindings, and substitute these lifted bindings into the second set of binders and the body of the original let expression.a clash-libLDetermine whether a term does any work, i.e. adds to the size of the circuitc clash-lib)Determine if a term represents a constantf clash-libA conservative version of a. 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 a in bindConstantVarH makes Clash two orders of magnitude slower for some of our test cases.)In effect, this function is a version of c 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.h 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 RHSi clash-libEnsure that the .% of a variable does not occur in the dj clash-lib,Make a global function for a name-term tuplek clash-lib+Add a function to the set of global bindersl 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.m 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.n clash-lib5Determine if a term cannot be represented in hardwareo clash-lib5Determine if a type cannot be represented in hardwarep clash-lib+Make a binder that should not be referencedq clash-libNMake a case-decomposition that extracts a field out of a (Sum-of-)Product typer clash-lib)Specialise an application on its arguments clash-lib)Specialise an application on its argumentv clash-lib=Create binders and variable references for free variables in specArgw clash-libnEvaluate an expression to weak-head normal form (WHNF), and apply a transformation on the expression in WHNF.x clash-lib>Binds variables on the PureHeap over the result of the rewriteLTo prevent unnecessary rewrites only do this when rewrite changed something.P clash-libName of the transformation clash-libTransformation to be appliedQ clash-libThe current debugging level clash-libTransformations to debug clash-libName of the transformation clash-libOriginal expression clash-lib$Whether the rewrite indicated change clash-libNew expressionR clash-libName of the transformation clash-libTransformation to perform clash-libTerm to transformX clash-lib TyCon cache clash-libName of the new binder clash-lib Term to bindY clash-lib TyCon cache clash-libName of the new binder clash-libType or Term to bindZ 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#Body where substitution takes place clash-lib ILet-bindings that we wanted to substitute, but turned out to be recursive+1 Let-binders where substitution took place$2 Body where substitution took place` clash-lib5Let-binders to lift, and substitute the lifted result clash-lib*Lef-binders where substitution takes place clash-lib#Body where substitution takes placeg clash-lib Property test clash-libTest whether to lift or inline True: inline False: liftj clash-libName of the function clash-libTerm bound to the function clash-lib6Name with a proper unique and the type of the functionn clash-libString representableo clash-libString representableq clash-lib#Name of the caller of this function clash-lib TyCon cache clash-libSubject of the case-compositionr clash-lib"Lens into previous specialisations clash-lib$Lens into the specialisation history clash-lib"Lens into the specialisation limits 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 onw clash-libSWhether the expression we're reducing to WHNF is the subject of a case expression.+NOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwx+NOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwx.W(C) 2015-2016, University of Twente, 2016 , Myrtle Software LtdBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HPUVXaky 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.reversez 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.tdfoldy clash-libLength of the vector clash-libElement of type of the vector clash-libThe vector to reversez 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-libO 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-libElementyz{|}~yz{|}~/#(C) 2015-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HNPUVXak  clash-lib Test if a P collected from an expression indicates that application of a global binder is disjoint: occur in separate branches of a case-expression.Q clash-lib7Test if all elements in a list are equal to each other.R clash-libCollect Ps 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 Ps 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.S clash-libCollect Ps 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.T clash-libCollect Ps 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.U clash-libCollect Ps 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.V clash-lib{Create a single selector for all the representable distinct arguments by selecting between tuples. This selector is only (Wj) created when the number of representable uncommmon arguments is larger than one, otherwise it is not (B).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.X clash-lib,Arguments are shared between invocations if:7They contain _no_ references to locally-bound variables Are all equalY clash-libaCreate a list of arguments given a map of positions to common arguments, and a list of argumentsZ 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 R 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 expressionS 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 argumentsT 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 alternativesU 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.V clash-libTypes of the argumentsY clash-libCurrent position clash-lib$map from position to common argument clash-lib$(projections for) distinct argumentsZ 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 clash-libTick annoations+X(C) 2012-2016, University of Twente, 2016-2017, Myrtle Software Ltd,BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;>HPSUVX_ak9  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!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-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-lib Context used to fill in the hole clash-libBlackbox template clash-libBlackbox to verify clash-libTemplate to check against clash-libSet of existing names clash-libName for new file ((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"#$%./1245678:;HPUVXak 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-libHelper function of  clash-lib?Looks up the plurality of a function's function argument. See K for more information. If not set, the returned plurality will default to 1. clash-libSunresolved primitives found in annotations (in LoadModules and LoadInterfaceFiles) clash-lib/Directories to search for primitive definitions clash-libArguments passed to blackbox clash-lib Result type clash-lib0Argument number holding the function of interest clash-libPlurality of function. Defaults to 1. Does not err if argument isn't a function in the first place. State of monad will not be modified.++0#(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None"#%./1245678:;HPUVX_akP[` 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.a clash-lib5Indicate term is fully constant (don't bind anything)b 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-libATurn type equality constraints into substitutions and apply them. So given: ?/\dom . \(eq : dom ~ "System") . \(eta : Signal dom Bool) . eta#we create the substitution [dom := System] and apply it to create: A\(eq : "System" ~ "System") . \(eta : Signal "System" Bool) . etaNB:F Users of this function should ensure it's only applied to TopEntities clash-libThe type equivalent of  clash-lib7Rewrite a term according to the provided transformation clash-libSA tick to prefix an inlined expression with it's original name. For example, given?foo = bar -- ... bar = baz -- ... baz = quuz -- ...if bar is inlined into foo, then the name of the component should contain the name of the inlined component. This tick ensures that the component in foo is called bar_baz instead of just baz. 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 inliningc 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 rewritten1(C) 2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HPUVXakSx2(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$%./1245678:;>FHPUVX_`ak@-d clash-libMark to track progress of 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, f/ (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-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.  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.Note [AppProp no shadowing]Case 1.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-binding@instead me must deshadow w.r.t. the new variable and rewrite to: 2let b = f x y in case x of D a b1 -> h a b Case 2.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 uH. To prevent this from happening we over-approximate and check whether xY is in the current InScopeSet, and deshadow if that's the case, i.e. we then rewrite to:let x1 = u in e [x:=x1]Case 3. 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 unconditionally deshadow the function part of the application w.r.t. the free variables in the argument part of the application. It is okay to over-approximate in this case and deshadow w.r.t the current InScopeSet. 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 g clash-libSee Note [ANF InScopeSet]h clash-lib6See Note [ANF InScopeSet]; only extends the inscopeseti clash-libIs the given type IO-likej clash-lib!Is the given type the state token clash-liblTurn an expression into a modified ANF-form. As opposed to standard ANF, constants do not become let-bound.k 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   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.Note [ANF no let-bind]| Do not let-bind: rArguments with an untranslatable type: untranslatable expressions should be propagated down as far as possibleeLocal variables or constants: they don't add any work, so no reason to let-bind to enable sharingIO actions, the translation of IO actions to sequential HDL constructs depends on IO actions to be propagated down as far as possible. 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. clash-lib+Inline a function with functional arguments clash-libSimplified CSE, only works on let-bindings, does an inverse topological sort of the let-bindings and then works from top to bottomXXX: Check whether inverse top-sort followed by single traversal removes as many binders as the previous "apply-until-fixpoint" approach in the presence of recursive groups in the let-bindings. If not but just for checking whether changes to transformation affect the eventual size of the circuit, it would be really helpful if we tracked circuit size in the regression/test suite. On the two examples that were tested, Reducer and PipelinesViaFolds, this new version of CSE removed the same amount of let-binders.l clash-lib]XXX: is given inverse topologically sorted binders, but returns topologically sorted binders'TODO: check further speed improvements: JStore the processed binders in a `Map Expr LetBinding`: * Trades O(1) cons and O(n)*aeqTerm find for: * O(log n)*aeqTerm insert and O(log n)*aeqTerm mMStore the processed binders in a `AEQTrie Expr LetBinding` * Trades O(1) cons and O(n)*aeqTerm find for: * O(e) insert and O(e) m 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# 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  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 constructor * I/O actionsn clash-libUsed by Q to inline binders that we want to inline into the binders that we want to keep.e clash-libUsed (transitively) by D inline to-inline let-binders into the other to-inline let-binders. clash-libFlatten's letrecs after 0 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. clash-libWorker function of . clash-libSplit apart (global) function arguments that contain types that we want to separate off, e.g. Clocks. Works on both the definition side (i.e. the lambda), and the call site (i.e. the application of the global variable). e.g. turns 6f :: (Clock System, Reset System) -> Signal System Intinto 6f :: Clock System -> Reset System -> Signal System Int clash-lib0Remove all undefined alternatives from case expressions, replacing them with the value of another defined alternative. If there is one defined alternative, the entire expression is replaced with that alternative. If there are no defined alternatives, the entire expression is replaced with a call to errorX.e.g. It convertsNcase x of D1 a -> f a D2 -> undefined D3 -> undefinedtoWlet subj = x a = case subj of D1 a -> field0 in f aZwhere fieldN is an internal variable referring to the nth argument of a data constructor.i clash-libType to check for IO-likenessj clash-lib!Type to check for state tokennessn clash-libCurrent InScopeSet clash-libXOriginal let-binders with their free variables (+ #occurrences), that we want to inline clash-libProcessed let-binders with their free variables and a tag to mark the progress: * Temp: Will eventually form a recursive cycle * Done: Processed, non-recursive * Rec: Processed, recursive clash-libQThe let-binders with their free variables (+ #occurrences), that we want to keepe clash-libCurrent InScopeSet clash-lib?Original let-binders with their free variables (+ #occurrences) clash-lib Accumulated: ((Maybe) the build up substitution so far3The free variables of the range of the substitutionProcessed let-binders with their free variables and a tag to mark the progress: * Temp: Will eventually form a recursive cycle * Done: Processed, non-recursive * Rec: Processed, recursive clash-lib6The unique of the let-binding that we want to simplify clash-libIgnore, artifact of foldlWithUniqueVarEnv clash-libSame as the third argument clash-lib Lambda binder clash-lib Lambda body clash-libKIf lambda is split up, this function returns a Just containing the new termo clash-lib subject id clash-libconcrete types of fields''##(C) 2012-2016, University of TwenteBSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HPUVXakF clash-libNormalisation transformation clash-lib+Topdown traversal, stops upon first success3(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%./1245678:;HPUVXakZY clash-liblA tree of identifiers and their bindings, with branches containing additional bindings which are used. See Clash.Driver.Types.Binding. clash-lib-Run a NormalizeSession in a given environment clash-libiCheck whether the normalized bindings are non-recursive. Errors when one of the components is recursive. 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 run clash-libList of normalized binders clash-libVisited clash-libGlobal binders clash-libRoot of the call graph  ((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"#%./1245678:;HPUVX_akz  clash-lib2Generate the context for a BlackBox instantiation. clash-liboExtract a compiled primitive from a guarded primitive. Emit a warning if the guard wants to, or fail entirely.  clash-lib#Emits (colorized) warning to stderr  clash-lib(Determine if a term represents a literal clash-libTurn a mealyIO expression into a two sequential processes, one "initial" process for the starting state, and one clocked sequential process. clash-lib(Collect the sequential declarations for bindIO clash-lib(Collect the sequential declarations for appIO clash-libUnwrap the new-type wrapper for things of type SimIO, this is needed to allow applications of the `State# World` token to the underlying IO type.XXX: this is most likely needed because Ghc2Core that threw away the cast that this unwrapping; we should really start to support casts. 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 function clash-libBlackbox function name clash-lib5Identifier binding the primitive/blackbox application clash-lib/Arguments of the primitive/blackbox application clash-libName of primitive  clash-libLHS of the original let-binder  clash-lib&Put BlackBox expression in parenthesis clash-lib(Treat BlackBox expression as declaration clash-libId to assign the result to clash-libPrimitive info clash-lib Arguments clash-libTick declarations clash-lib(Identifier to assign the final result to clash-lib Id to assign the final result to clash-libThe arguments to mealyIO clash-libBIdentifier binding the encompassing primitive/blackbox application clash-libThe function argument term            4None%./1245678:;HPUVXakN clash-libECalculates the number of function calls needed for an evaluation of HJ/, given the length of the vector given to fold. clash-lib8Type signature of function we're generating netlist for:+fold :: (a -> a -> a) -> Vec (n + 1) a -> aBThe implementation promises to create a (balanced) tree structure.  )(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"#$%./1245678:;FHPUVX_`ak&  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-libGenerate a list of concurrent 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-binder clash-lib3Generate a component for a given function (caching) clash-libEGenerate a hierarchical netlist out of a set of global binders with  topEntity at the top. clash-lib0Run a NetlistMonad action in a given environment clash-lib)Generate a component for a given function  clash-libLHS of the let-binder clash-libName of the applied function clash-libFunction arguments clash-libTick declarations clash-lib$Concurrent of sequential declaration clash-libLHS of the let-binder clash-libRHS of the let-binder 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-libHWType of the LHS of the let-binder, can multiple types when we're creating a "split" product type (e.g. a tuple of a Clock and Reset) 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-lib=Should the returned declarations be concurrent or sequential? clash-libId to assign the result to clash-lib Term to convert to an expression clash-lib@Returned expression and a list of generate BlackBox declarations clash-libName of the function 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-libThe current HDL backend  clash-libSeen components clash-libHDL dir clash-libComponent name prefix clash-lib Name of the  topEntity 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-libThe current HDL backend  clash-libSeen components clash-libHDL dir clash-libComponent name prefix clash-lib Action to run clash-libName of the function clash-libCorresponding term !"# !"#5(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>None$%./1245678:;HPUVX\ak$ clash-libWorker function of %& 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-libfList of known BlackBoxFunctions used to prevent Hint from firing. This improves Clash startup times.* clash-libfList of known TemplateFunctions used to prevent Hint from firing. This improves Clash startup times.+ clash-lib:Compiles blackbox functions and parses blackbox templates.- clash-lib(Pretty print Components to HDL Documents. 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./ clash-lib(Writes a HDL file to the given directory0 clash-libCopy given files2 clash-lib/Get all the terms corresponding to a call graph3 clash-libNormalize a complete hierarchy4 clash-lib#topologically sort the top entities $ clash-lib3Source location of top entity (for error reporting) clash-libTop entity body clash-libPort annotations for top entity clash-libBNew top entity with split ports (or the old one if not applicable)' 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-lib$Topentities and associated testbench  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 compile- 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 copied. clash-libRemove existing HDL files clash-lib File extension of the HDL files.0 clash-libDirectory to copy files to clash-lib(filename, content)2 clash-lib All bindings clash-libRoot of the call graph3  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$%&'()*+,-./01234$%&'()*+,-./012346P(C) 2015-2016, University of Twente, 2017-2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HNPSUVX_`ak @5 clash-libState for the p monad:q clash-lib!Depth of current generative blockr clash-lib(Files to be copied: (filename, old path)s clash-lib]Files to be stored: (filename, contents). These files are generated during the execution of  genNetlist.t clash-libIntWordInteger bit-widthu clash-lib%Generate VHDL for a Netlist componentv clash-lib6Convert a Netlist HWType to the root of a Verilog typew clash-lib@Convert a Netlist HWType to an error Verilog value for that typex clash-lib+Add attribute notation to given declarationy clash-lib*Convert single attribute to verilog syntaxz 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-lib`Render a data constructor application for data constructors having a custom bit representation.~ clash-lib3Turn a Netlist expression into a Verilog expression| clash-lib/Offset, only used when we have nested modifiers} clash-lib"Custom representation of data type clash-lib3Custom representation of a specific constructor of dataRepr clash-lib Arguments applied to constructor~ clash-libEnclose in parentheses? clash-libExpr to convert56789:;<567<9:;87P(C) 2015-2016, University of Twente, 2017-2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HNPUVX_`ak OT> clash-libState for the MN 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-lib`Render a data constructor application for data constructors having a custom bit representation. 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-lib"Custom representation of data type clash-lib3Custom representation of a specific constructor of dataRepr clash-lib Arguments applied to constructor clash-libEnclose in parentheses? clash-libExpr to convert>>8P(C) 2015-2016, University of Twente, 2017-2018, Google Inc.BSD2 (see the file LICENSE)-Christiaan Baaij <christiaan.baaij@gmail.com>None%./1245678:;HNPUVX_`ak o@ 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-lib`Render a data constructor application for data constructors having a custom bit representation. clash-lib9Turn a Netlist expression into a SystemVerilog expression clash-libxCalculate the beginning and end index into a variable, to get the desired field. Also returns the HWType of the result.NB: returns a list of slices and indices when selections are into vectors and rtrees. Left -> index/slice from an unpacked array; Right -> slice from a packed type clash-lib"Custom representation of data type clash-lib3Custom representation of a specific constructor of dataRepr clash-lib Arguments applied to constructor clash-libEnclose in parentheses? clash-libExpr to convert clash-lib/Offset, only used when we have nested modifiers clash-libRanges selected so far@@O?@OPQOPROPSOTUOVWOVXO?YO?ZO?AO[\O]^_`a_`bcdefghfijfikfilfimfinfiofipfipqrstuvwxyz{|}~                           ! " # $ ! % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D EFGHIJJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~E                                                                                                             ! " # $ %  & ' ( ) * + + , - . / 0 1 2 3 4 b / 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 qrstuvvwxyyz{|}~rw      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwwxyz{|}~K      !"#$%&'()*+,-./0123456789:;<}=>?@ABCDEFGHIJKKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~|<    y   !"#$%&'()*+,-../012v34456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnGopqrs~tuvwxyz{|}~                                ( r                 x                  !!!!!!!!!!""""""""""""""""""""""""""""""""""""""""""##$$$$$$$$%%%%%%&'(()))))))) ) * * + ,,,,,,,,,,,,,,,,,,,,, ,!,",#,$,%,&,',(,),*,+,,,-,.,/,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-{-|-}-~--.......................///////++++++++++++++++++++++00000000000000000000000011111111222222222222222222222222222222222222222####3333333 3 3 3 3 33((((((((((44444444 4!)")#)$)%)&)')())5*5+5,5-5.5/505152535455565758595:6;6<6=6>6?6@6A6B6C7D7E8F8GOHIJK L MNOPNOPNOQNORNORNOS:T:U:V:W:X:YZ[\Z[Z[]^8Z[_Z[`Z[aZ[bZ[cZ[dZ[eZ[fZ[gZ[hZ[iZ[jZ[kZ[lZ[mZ[nZ[oZ[pZ[qZ[rZ[sZ[tZ[uZ[vZ[wZ[xZ[yZ[zZ[{Z[|Z[}Z[~Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[CZ[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[IZ[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[Z[ZZZ >>>>>>>>  O O O O O  EEE !"#$ % &'()*+,-./0123456789 :;<=c>?@ABCDEFGHIJKLMNOPOQROSTOSU%V&W'XOPY/Z/[/\/]/^/_/`OHa/b/c/d/efghijk0l0m0n0o2p2qO 2r2s2t2u2v2wO x2y2z6{6|6}6~6666666666677777}7~77777777777777777777777777 88888|8}8~8888888888888clash-lib-1.2.0-inplace Clash.UtilClash.Core.NameData.Text.Prettyprint.Doc.ExtraClash.Netlist.IdClash.Netlist.Types Clash.Pretty Clash.UniqueClash.Util.GraphClash.Util.InterpolateClash.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.ParserClash.Core.PrettyClash.Core.VarEnvClash.Driver.TypesClash.Core.FreeVarsClash.Core.UtilClash.Core.TermLiteral.THClash.Core.TermLiteralClash.Core.Evaluator.TypesClash.Core.Evaluator Clash.BackendClash.Rewrite.TypesClash.Rewrite.CombinatorsClash.Normalize.TypesClash.Normalize.Strategy Clash.Primitives.Sized.ToIntegerClash.Primitives.GHC.LiteralClash.Primitives.GHC.WordClash.Primitives.GHC.IntClash.Netlist.BlackBox Clash.Netlist,Clash.Annotations.BitRepresentation.ClashLibClash.Netlist.BlackBox.UtilClash.Netlist.UtilClash.Rewrite.Util#Clash.Normalize.PrimitiveReductionsClash.Normalize.DECClash.Normalize.UtilClash.Primitives.Intel.ClockGenClash.Normalize.TransformationsClash.NormalizeClash.Primitives.Sized.Vector Clash.DriverClash.Backend.VerilogClash.Backend.VHDLClash.Backend.SystemVerilogData.Semigroup.Monad.ExtraData.Set.Ordered.ExtraData.Vector.Primitive.ExtraGHC.BasicTypes.ExtraGHC.SrcLoc.ExtraPaths_clash_lib Control.Arrowfirstsecond Data.List partition mapAccumLData.Aeson.Extra Clash.MagicsetNameClash.Sized.Vectormapfold opt_ultra!Clash.Annotations.TopEntity.ExtraClash.Netlist.VHDLVHDLMbaseGHC.Base<*>pure Applicative Data.Functor<$> Control.Monad<=<>=>&&&*** Data.FunctiononGHC.Stack.Types HasCallStackghcSrcLoc noSrcSpanSrcSpanLlens-4.19.1-592c21758b8c4f83a8cd7cc849ec75a330cd51388dc40916d4321a7ebef06dc2Control.Lens.TH makeLensesTprettyprinter-1.6.1-7934b6fef96c4c9fabc313d4a644eaf7eddb8b06d3b96626bfbfeeba6b59eea1%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 keysUniqMapmapMaybeUniqMapfoldrWithUniquefoldlWithUnique' emptyUniqSet unitUniqSet extendUniqSet unionUniqSet elemUniqSetnotElemUniqSetelemUniqSetDirectly lookupUniqSetdelUniqSetDirectly eltsUniqSet mkUniqSetuniqMapToUniqSet subsetUniqSet$fUniquableInt $fShowUniqMap$fClashPrettyUniqMap$fClashPrettyUniqSet$fFunctorUniqMap$fFoldableUniqMap$fTraversableUniqMap$fSemigroupUniqMap$fMonoidUniqMap$fNFDataUniqMap$fBinaryUniqMap$fFoldableUniqSet$fSemigroupUniqSet$fMonoidUniqSet$fBinaryUniqSettopSortreverseTopSorti $fShowNode $fShowLineDoc layoutOneLine renderOneLineintintegercharlbracerbracecolonsemiequalscommadotlparenrparenspacebracketsbracestupled<+>vcathcatnestindentparensemptyDoc punctuate encloseSeplineline'softline softline'prettystringSstringsquotesdquotesalignhsepvsepisEmptyfillcolumnnestingflatAltcommentsquote $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 concatMapM partitionM mapAccumLM ifThenElse<:> indexMaybe indexNote' indexNote headMaybe tailMaybe splitAtListclashLibVersioncountEqflogBaseclogBase equalLengthneLengthzipEqual debugIsOnanyMorMpkgIdFromTypeablereportTimeDiffuncurry3allM traceWith traceShowWithorElseorElseswantedLanguageExtensionsunwantedLanguageExtensions filterOnFst filterOnSnd$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 splitFunTyssplitFunForallTy mkPolyFunTysplitCoreFunForallTy 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 WorkAlwaysPrimInfoprimNameprimType primWorkInfoNameMod PrefixName SuffixName SuffixNamePSetNameTickInfoDeDupNoDeDupDataPrimLamTyLamAppTyAppLetrecCaseCastTickisLambdaBodyCtx isTickCtx collectArgs collectTickscollectArgsTicksprimArgpartitionTickswalkTermcollectTermIds$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$fBinaryCoreContextHdlSynVivadoQuartusOtherDeclElementTextResultArgArgGenConstLitToVarSymTypTypMErrTypElemCompName IncludeName IndexTypeSizeLengthDepthMaxIndexFilePathTemplateGenIFAndIW64CmpLEBVSelIsLitIsVar IsActiveHighTagPeriod ActiveEdgeIsSync IsInitDefinedIsActiveEnableStrCmp OutputWireRegVarsGenSymRepeatDevNullSigDCtxNameBlackBoxTemplateBlackBoxFunction BlackBoxMeta bbOutputRegbbKind bbLibrary bbImportsbbFunctionPlurality bbIncludes bbRenderVoid TemplateKindTDeclTExpr RenderVoid NoRenderVoidemptyBlackBoxMeta$fShowRenderVoid$fGenericRenderVoid$fNFDataRenderVoid$fBinaryRenderVoid$fHashableRenderVoid$fFromJSONRenderVoid$fShowTemplateKind$fEqTemplateKind$fGenericTemplateKind$fNFDataTemplateKind$fBinaryTemplateKind$fHashableTemplateKind $fEqHdlSyn $fShowHdlSyn $fReadHdlSyn$fGenericHdlSyn$fNFDataHdlSyn$fBinaryHdlSyn$fHashableHdlSyn $fShowElement$fGenericElement$fNFDataElement$fBinaryElement$fHashableElement $fShowDecl $fGenericDecl $fNFDataDecl $fBinaryDecl$fHashableDecl PrimitiveBlackBoxHaskellnameworkInfo renderVoidkindwarning outputReg librariesimportsfunctionPluralityincludes resultName resultInittemplate usedArguments functionNamefunctionprimSort UsedArgumentsIgnoredArgumentsTemplateFormat TTemplateTHaskellTemplateSourceTFileTInlineBlackBoxFunctionNamePrimMapCompiledPrimMapGuardedCompiledPrimitiveCompiledPrimitiveResolvedPrimMapGuardedResolvedPrimitiveResolvedPrimitiveUnresolvedPrimitive$fShowBlackBoxFunctionName$fFromJSONPrimitive$fEqBlackBoxFunctionName$fGenericBlackBoxFunctionName$fNFDataBlackBoxFunctionName$fBinaryBlackBoxFunctionName$fHashableBlackBoxFunctionName$fShowTemplateSource$fEqTemplateSource$fGenericTemplateSource$fNFDataTemplateSource$fShowTemplateFormat$fGenericTemplateFormat$fHashableTemplateFormat$fNFDataTemplateFormat$fShowUsedArguments$fGenericUsedArguments$fHashableUsedArguments$fNFDataUsedArguments$fBinaryUsedArguments$fShowPrimitive$fGenericPrimitive$fNFDataPrimitive$fBinaryPrimitive$fHashablePrimitive$fFunctorPrimitiverunParse PrettyPrecpprPrecpprPrec'ClashDoc SyntaxElementKeywordLitS QualifierClashAnnotation AnnContext AnnSyntax PrettyOptionsdisplayUniques displayTypesdisplayQualifierspprppr'fromPprshowPprshowPpr' tracePprIdtracePpr$fClashPrettyVar$fClashPrettyTerm $fPrettyLitTy$fClashPrettyType$fClashPrettyName$fDefaultPrettyOptions$fPrettyPrecLiteral$fPrettyPrecDataCon$fPrettyPrecVar$fPrettyPrecSrcSpan$fPrettyPrecTickInfo$fPrettyPrecTerm$fPrettyPrecLitTy$fPrettyPrecTyCon$fPrettyPrecType$fPrettyPrecText$fPrettyPrec(,)$fPrettyPrec[]$fPrettyPrecName$fPrettyPrecPat$fEqSyntaxElement$fShowSyntaxElement$fEqClashAnnotation $fEqTypePrec $fOrdTypePrecRnEnv InScopeSetVarSetVarEnv emptyVarEnv unitVarEnv lookupVarEnvlookupVarEnvDirectly lookupVarEnv' delVarEnv delVarEnvList extendVarEnvextendVarEnvWithextendVarEnvList nullVarEnv unionVarEnvunionVarEnvWithmkVarEnv mapVarEnvmapMaybeVarEnvfoldlWithUniqueVarEnv' eltsVarEnv elemVarEnv notElemVarEnv emptyVarSet unitVarSet unionVarSet elemVarSet notElemVarSetdelVarSetByKeymkVarSet eltsVarSetextendInScopeSetextendInScopeSetList unionInScope varSetInScope lookupInScopeelemInScopeSetnotElemInScopeSet mkInScopeSetemptyInScopeSetuniqAway uniqAway'mkRnEnvrnOccLTyrnOccRTyrnTyBndr rnTyBndrsrnOccLIdrnOccRIdrnTmBndr rnTmBndrs$fClashPrettyInScopeSet$fGenericInScopeSet$fBinaryInScopeSetManifest manifestHash succesFlags portInNames portInTypes portOutNames portOutTypescomponentNames ClashOptsopt_inlineLimit opt_specLimitopt_inlineFunctionLimitopt_inlineConstantLimit opt_dbgLevelopt_dbgTransformations opt_cachehdl opt_cleanhdl opt_primWarn opt_color opt_intWidth opt_hdlDir opt_hdlSynopt_errorExtraopt_floatSupportopt_importPathsopt_componentPrefixopt_newInlineStratopt_escapedIdsopt_forceUndefined opt_checkIDiropt_aggressiveXOptopt_inlineWFCacheLimit DebugLevel DebugNone DebugSilent DebugFinal DebugNameDebugTry DebugAppliedDebugAll BindingMapBinding bindingId bindingLoc bindingSpec bindingTerm defClashOpts$fHashableClashOpts$fBinaryBinding$fGenericBinding$fNFDataBinding $fShowBinding$fEqDebugLevel$fOrdDebugLevel$fReadDebugLevel$fEnumDebugLevel$fGenericDebugLevel$fHashableDebugLevel$fShowManifest$fReadManifest typeFreeVars typeFreeVars'localIdDoesNotOccurInlocalIdsDoNotOccurInlocalVarsDoNotOccurInlocalIdOccursInglobalIdOccursIn freeLocalVarsfreeIds freeLocalIds globalIdshasLocalFreeVarstermFreeTyVars termFreeVars'noFreeVarsOfType tyFVsOfTypeslocalFVsOfTermscountFreeOccurancesSubst substInScope substTmEnv substTyEnv substGblEnvTvSubst TvSubstEnvmkSubst mkTvSubst extendIdSubstextendIdSubstListextendGblSubstList extendTvSubstextendTvSubstListextendInScopeIdextendInScopeIdListsubstTy substTyInVarsubstTmsubstAltsubstId deShadowTerm deShadowAltdeshadowLetExpr freshenTmaeqTerm $fOrdTerm$fEqTerm $fOrdType$fEqType$fClashPrettyTvSubstTypeEqSolutionSolutionAbsurdSolution NoSolutionDeltaGamma normalizeAdd catSolutionssolveNonAbsurdssolveEqsolveAddtypeEqaltEqs isAbsurdAlt isAbsurdEqsubstGlobalsInExistentialssubstInExistentialsListsubstInExistentialstermType collectBndrsapplyTypeToArgs piResultTypiResultTyMaybe piResultTyspatIdspatVars mkAbstractionmkTyLamsmkLamsmkAppsmkTmAppsmkTyAppsmkTicksisFun isPolyFunisLamisLetisVar isLocalVarisConisPrimidToVarvarToIdtermSizemkVec appendToVec extractElems extractTElemsmkRTree isSignalTypeisEnableisClockOrReset tyNatSizemkUniqSystemTyVarmkUniqSystemIdmkUniqInternalIddataConInstArgTysEdataConInstArgTysprimCo undefinedTm substArgTys stripTicks tyLitShow shouldSplit shouldSplit0splitShouldSplitstripIPinverseTopSortLetBindings$fShowTypeEqSolution$fEqTypeEqSolutionderiveTermToData TermLiteral termToDatatermToDataErroruncheckedTermToData$fTermLiteralBool$fTermLiteralMaybe$fTermLiteral(,)$fTermLiteralNatural$fTermLiteralChar$fTermLiteralInteger$fTermLiteralInt$fTermLiteralText$fTermLiteral[]$fTermLiteralTermValueLambdaTyLambdaDCPrimValSuspend TickValue CastValue StackFrameUpdateApply Instantiate PrimApply ScrutiniseTickishStackPureHeapPrimHeapMachine mPrimStep mPrimUnwind mHeapPrim mHeapGlobal mHeapLocalmStackmSupply mScopeNamesmTerm PrimEvaluator PrimUnwindPrimStep valToTermcollectValueTicks forcePrims primCount primLookup primInsert primUpdate heapLookup heapContains heapInsert heapDelete stackPushstackPop stackClear stackNullgetTermsetTerm$fClashPrettyStackFrame $fShowMachine $fShowValue$fShowStackFrameStepwhnf'whnf unwindStackstepVarstepData stepLiteralstepPrimstepLam stepTyLamstepApp stepTyApp stepLetRecstepCasestepCaststepTickstep newBinder newLetBindingunwindupdateapply instantiate scrutinise substInAltallocateletSubstBackend initBackendhdlKindprimDirs extension extractTypesgenHDL mkTyPackagehdlTypehdlTypeErrValue hdlTypeMark hdlRecSelhdlSiggenStmtinstexpriwWidthtoBVfromBVhdlSyn mkIdentifierextendIdentifier setModName setSrcSpan getSrcSpan blockDeclunextend addIncludes addLibraries addImports addAndSetData getDataFilesaddMemoryDataFilegetMemoryDataFilesseenIdentifiersifThenElseExprUsageExternalModName primsRootclashVerescapeTemplatemkUniqueIdentifier preserveSeenDeclarationType Concurrent Sequential NetlistIdCoreIdMultiIdTemplateFunction BBTemplate BBFunctionBBHashBBNameBlackBoxContextbbNamebbResultbbInputs bbFunctions bbQsysIncNamebbLevel bbCompName bbCtxNameBitHLUZNumLitBitLit BitVecLitBoolLitVecLit StringLitDataTag BlackBoxEConvBV IfThenElseNoopModifierIndexed VecAppend RTreeAppendSlicedNested PortDirectionInOut WireOrRegWireRegEntityOrComponentEntityCompEmptySeq AlwaysClockedInitial AlwaysCombSeqDeclBranch AssignmentCondAssignmentInstDecl BlackBoxDNetDecl'TickDeclVoidStringIntegerBool BitVectorIndexSignedUnsignedVectorRTreeSumProductSPClockReset BiDirectionalCustomSP CustomSum CustomProduct Annotated KnownDomainFileTypeFilteredHWTypeIsVoid componentNameinputsoutputs declarationsComment SomeBackendComponentPrefixcomponentPrefixTopcomponentPrefixOther NetlistState _bindings _varCount _components _primitives_typeTranslator_tcCache _curCompNm _intWidth_mkIdentifierFn_extendIdentifierFn_seenIds _seenComps_seenPrimitives_componentNames_topEntityAnns_hdlDir _curBBlvl_componentPrefix _customReprs _clashOpts _isTestBench _backEndITE_backend _htyCache NetlistEnv _prefixName _suffixName_setNameHWMap runNetlist TopEntityTtopId topAnnotationassociatedTestbenchNetDecl hwTypeAttrstoBit netlistId netlistId1 netlistTypes netlistTypes1emptyBBContext$fNFDataWireOrReg$fBinaryTemplateFunction$fNFDataTemplateFunction$fShowBlackBox $fNFDataExpr$fNFDataDeclaration$fNFDataComponent$fGenericTopEntityT$fShowComponentPrefix$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 $fShowSeq$fShowComponent$fFunctorNetlistMonad$fMonadNetlistMonad$fApplicativeNetlistMonad$fMonadReaderNetlistMonad$fMonadStateNetlistMonad$fMonadIONetlistMonad$fMonadFailNetlistMonad$fShowNetlistId prefixName suffixName backEndITEbackendbindings clashOptscomponentPrefix componentscurBBlvl curCompNm customReprsextendIdentifierFnhdlDirhtyCacheintWidth isTestBenchmkIdentifierFn primitives seenCompsseenIdsseenPrimitivestcCache topEntityAnnstypeTranslatorvarCount RewriteState_transformCounter _uniqSupply_curFun _nameCounter _globalHeap_extra RewriteStept_ctxt_namet_bndrSt_beforet_after$fShowRewriteStep$fGenericRewriteStep$fNFDataRewriteStep$fHashableRewriteStep$fBinaryRewriteStep RewriteEnv _dbgLevel_dbgTransformations_aggressiveXOpt _tupleTcCache _evaluator _topEntitiescurFunextra globalHeap nameCountertransformCounter uniqSupplyRewrite TransformTransformContext tfInScope tfContext RewriteMonadRunRaggressiveXOptdbgLeveldbgTransformations 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_normalizeUltra_inlineWFCacheLimitTermClassification _function _primitive _selection NormRewriteNormalizeSessionNormalizeMonadinlineConstantLimitinlineFunctionLimit inlineHistory inlineLimitinlineWFCacheLimitnewInlineStrategynormalizeUltra normalized primitiveArgsrecursiveComponentsspecialisationCachespecialisationHistoryspecialisationLimit$fShowTermClassification primitive selectionconstantPropagation normalizationbvToIntegerVerilogbvToIntegerVHDLindexToIntegerVerilogindexToIntegerVHDLsignedToIntegerVerilogsignedToIntegerVHDLunsignedToIntegerVerilogunsignedToIntegerVHDLunsignedsignedassign signedLiteralunsignedLiteral literalTFwordTFintTFmkBlackBoxContextextractPrimWarnOrFailmkFunAppmkDeclarations'mkDeclarations mkNetDecl mkSelection mkProjectionmkDcApplicationmkExpr genComponent coreToType' bitsToBitsrenderTemplate stripFiltered stripVoidflattenFiltered isVoidMaybeisVoidisFilteredVoidsplitNormalizedunsafeCoreTypeToHWType'unsafeCoreTypeToHWTypeunsafeCoreTypeToHWTypeM'unsafeCoreTypeToHWTypeMcoreTypeToHWTypeM'coreTypeToHWTypeMunexpectedProjectionErrorMsgconvertToCustomReprmaybeConvertToCustomReprcoreTypeToHWType'coreTypeToHWTypeoriginalIndicesmkADT isRecursiveTyrepresentableTypetypeSizeconSize typeLength termHWType termHWTypeM isBiSignalIncontainsBiSignalIncollectPortNames'collectPortNamesfilterVoidPortsmkUniqueNormalized setBinderNamemkUniqueArgumentsmkUniqueResult idToInPort idToOutPortidToPortid2type id2identifierrepNamemkUnique preserveStatepreserveVarEnv dcToLiteral extendPortsportName prefixParentappendIdentifieruniquePortNamemkInput mkVectorChain mkRTreeChaingenComponentNamegenTopComponentNamestripAttributesmkOutput mkOutput'mkTopUnWrapperargBVresBVdoConv mkTopInputthrowAnnotatedSplitError mkTopOutput mkTopOutput'concatPortDecls3nestMbindsExistentialsiteAlts withTicks affixName zoomExtrafindAccidentialShadows applyDebug runRewriterunRewriteSession setChangedchangedclosestLetBinder mkDerivedName mkTmBinderFor mkBinderFor mkInternalVar inlineBinders isJoinPointIn tailCalls isVoidWrappersubstituteBindersliftAndSubsituteBinders isWorkFree isFromInt isConstantisConstantNotClockResetisWorkFreeClockOrResetOrEnable isWorkFreeIshinlineOrLiftBinders liftBindinguniqAwayBinder mkFunction addGlobalBindcloneNameWithInScopeSetcloneNameWithBindingMapisUntranslatableisUntranslatableTypemkWildValBindermkSelectorCase specialise specialise'normalizeTermTypes normalizeIdspecArgBndrsAndVarswhnfRW bindPureHeap reduceReverse reduceZipWith reduceMap reduceImapreduceTraverse mkTravVec reduceFoldr reduceFold reduceDFold reduceHead reduceTail reduceLast reduceInit reduceAppendreduceUnconcatreduceTransposereduceReplicatereduceReplace_intreduceIndex_int reduceDTFold reduceTFoldreduceTReplicate buildSNat isDisjointcollectGlobalsmkDisjointGroup $fEqCaseTree$fShowCaseTree$fFunctorCaseTree$fFoldableCaseTree inputHoleverifyBlackBoxContextextractLiteralssetSym selectNewNamerenderFilePathrenderBlackBox renderElem parseFailidToExprlineToIdentifier lineToType renderTagelementsToText elementToText exprToStringprettyBlackBox prettyElem walkElement usedVariablesgetUsedArguments onBlackBoxhashCompiledPrimMapgeneratePrimMap constantArgsgetFunctionPluralityConstantSpecInfocsrNewBindings csrNewTermcsrFoundConstant isConstantArg shouldReducealreadyInlined addNewInlinespecializeNormisClosedisNonRecursiveGlobalVarisRecursiveBndrconstantSpecInfo callGraphclassifyFunctionisCheapFunctionnormalizeTopLvlBndr substWithTyEqtvSubstWithTyEq rewriteExpr removedTm mkInlineTick$fShowConstantSpecInfoaltpllTF altpllQsysTF alteraPllTFalteraPllQsysTFalteraPllTemplatealtpllTemplatealtpllQsysTemplatealteraPllQsysTemplateinlineOrLiftNonReptypeSpec nonRepSpeccaseLetcaseElemNonReachableelemExistentialscaseCase inlineNonRepcaseCon nonRepANFtopLetdeadCoderemoveUnusedExprbindConstantVarcaseCastletCast argCastSpec inlineCasteliminateCastCast splitCastWorkinlineWorkFree inlineSmall constantSpec appPropFastcaseFlatmakeANFetaExpansionTL etaExpandSyn recToLetRecinlineHO simpleCSE reduceConstreduceNonRepPrimdisjointExpressionConsolidation inlineCleanup flattenLetseparateLambdaseparateArguments xOptimize topdownSucR topdownRR innerMost applyManyCallTreeCLeafCBranchrunNormalization normalize normalize'checkNonRecursive cleanupGraph mkCallTree stripArgs flattenNodeflattenCallTreecallTreeToListwarnprepareBlackBox isLiteral mkArgument mkPrimitive collectMealy collectBindIO collectAppIOunSimIO mkFunInputFCallfoldFunctionPluralityfoldBBFfoldTFfoldTF'indexIntVerilogindexIntVerilogTFindexIntVerilogTemplate genNetlistrunNetlistMonadgenNames genComponentTreorderDefault reorderCustompatPos toSimpleVar splitTopAnnsplitTopEntityTgetClashModificationDate generateHDLloadImportAndInterpretknownBlackBoxFunctionsknownTemplateFunctionscompilePrimitiveprocessHintError createHDL prepareDirwriteHDLwriteMemoryDataFiles copyDataFilescallGraphBindingsnormalizeEntitysortTop VerilogStateincludeuselibs noEmptyInitexprLitbitsbit_char encodingNote$fBackendVerilogState VHDLState$fBackendVHDLStateSystemVerilogState$fBackendSystemVerilogState GHC.MaybeNothing topSortVisit' topSortVisit nodesToLines EmptyLinePreducers-3.12.3-b7e8c80d95f142f237078b6d6d89a8dfb74b0f044aeb8908a413706fe93a7782Data.Semigroup.MonadAction getActionMongetMonORSetOLSettoSetLtoSetRtoListLtoListRPvector-0.12.1.2-b2d0b8779ae8e78c18a87264aa097e6648f09b956fef04e23fb8e8189b225cf5Data.Vector.Primitive//Rprimitive-0.7.0.1-b4d6acd051f03f706061da85f19eee5523984fc7a92b815541d2d5091a913019Data.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 findIndexfindnotElemelembreakspan partitionWithunstablePartition dropWhile takeWhilefilterM imapMaybemapMaybeuniqifilterfilter zipWithM_zipWithM izipWith6 izipWith5 izipWith4 izipWith3izipWithzipWith6zipWith5zipWith4zipWith3zipWithforM_forMmapM_mapM concatMapimapmodifyunsafeBackpermute backpermutereverseunsafeAccumulate_ unsafeAccum accumulate_accum unsafeUpdate_ unsafeUpdupdate_forcecreateTcreate 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.TypesTrue Data.FoldableGHC.Listor genLineErrreplaceCommonEscapes genLineErr'tySuperKindTyConNameliftedTypeKindTyConNametypeNatKindTyConNametypeSymbolKindTyConName tySuperKindTcliftedTypeKindTc typeNatKindTctypeSymbolKindTc intPrimTc integerPrimTc charPrimTc stringPrimTc voidPrimTc wordPrimTc int64PrimTc word64PrimTc floatPrimTc doublePrimTc naturalPrimTcbyteArrayPrimTcnewTyConInstRhs isSuperKindsplitOn parseBBFN pBlackBoxDpElementpTextpTagDpDeclpOutputpInputpTagE brackets' pBlackBoxEpElemEpSigD rn_envLTy rn_envLTm rn_envRTy rn_envRTm rn_inScopeInt extendVarSet subsetVarSet lookupVarSetControl.Lens.TypeFold zipTvSubst IdSubstEnv substIdBndr lookupIdSubstsubstTyVarBndr substTyVarsubstTyUncheckedcheckValidSubst isValidSubstsubstTy'substTyVarBndr' substBindacmpType acmpType'aeqTerm'acmpTerm acmpTerm'GHC.Err undefined Data.EitherLeftRightreadSizewordTF'intTF'fmapCaseTreeallEqualcollectGlobals'collectGlobalsArgscollectGlobalsAltscollectGlobalsLbsdisJointSelProjJust areSharedmkDJArgsgenCaseinterestingToLiftQhashable-1.3.0.0-ec282a27abb278409311a40b999c4db50e822c47f9441b6f8d689985aa173a2fData.Hashable.ClasshashresolvePrimitive'resolvePrimitivegetFunctionPlurality' CallGraph constantCsrbindCsr mergeCsrsMarkreduceBindersCleanup tellBinders notifyBinders isSimIOTyisStateTokenTy collectANF reduceBinderslookupinlineBndrsCleanupmkFieldSelectorVerilogM _genDepth _dataFiles_memoryDataFiles genVerilogverilogTypeMarkverilogTypeErrValueaddAttrs renderAttrinst_'inst_modifiercustomReprDataConexpr__tyCache_tySeen _nameCachetyName_hdlsyn timeUnits reservedWordsproductFieldNamesgenVHDL mkTyPackage_ attrTypesattrMapassocs appendSizesizedQualTyName sizedTyName qualTyNametyName' normaliseTypefilterTransparent userTyNamesizedQualTyNameErrValueproductFieldNameselectProductFieldFalseSystemVerilogM _tyPkgCtx